When I try to regenerate the views string on the translate interface, I get this error when the batch op starts:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /en/batch?render=overlay&id=270&op=do StatusText: OK ResponseText: Fatal error: Call to a member function unpack_translatables() on a non-object in /var/www//sites/all/modules/i18nviews/i18nviews.inc on line 20

I made a small patch, that resolves this for me:

in i18nviews.inc:

20c20,22
< $display->handler->unpack_translatables($translatables);
---
> if(is_object($display->handler)) {
> $display->handler->unpack_translatables($translatables);
> }

After inserting this if(), the the batch operation completes and the views strings can be transleted.

Files: 
CommentFileSizeAuthor
#1 i18nviews-1653170.patch654 bytesjonhattan

Comments

jonhattan’s picture

Priority:Normal» Major
Status:Active» Needs review
StatusFileSize
new654 bytes

Same error installing the module on a site with some views already created (and exported to code btw). Patch attached.

Stan Shevchuk’s picture

Patch in #1 works. Thank you.

wamilton’s picture

Status:Needs review» Reviewed & tested by the community

Applied it, it works.

If there's a better pattern to guarantee that $display->handler has the desired method, it'd be nice to do that instead, but I don't know enough about the internals.

mErilainen’s picture

Works for me also

mvc’s picture

works for me!

yichalal’s picture

works for me too. Thank you Jonhattan.

BrightBold’s picture

This solved the problem for me as well. It would be nice if this could be committed, or, if the problem needs to be solved a different way, someone could recommend a direction for a better solution so this error can be eliminated.

HnLn’s picture

Issue summary:View changes

Same problem here. I only needed i18nviews to translate my exposed filters, the site already had a lot of translated views using core.
So I set the translation plugin to core after installing i18nviews, but I do use the (translated) filters.
Setting up and featuring was no problem, but when running install profile I got above error.

Patch in #1 fixes it for me.
Also had to patch views with https://drupal.org/comment/7356718#comment-7356718.

rolfmeijer’s picture

Yes, patch from #1 works for me too. Thank you.

webflo’s picture

Hmm i can not reproduce this issue. I followed the steps from #1. Looks like #1685144: Call to a member function init_display() on a non-object in modules/all/views/plugins/views_plugin_localization.inc is the proper fix for this issue?

brantwynn’s picture

I can reproduce the issue even with #1685144: Call to a member function init_display() on a non-object in modules/all/views/plugins/views_plugin_localization.inc applied to Views.

The patch from #1 fixes the issue for me.

Sutharsan’s picture

@brantwynn, can you write down the steps to reproduce (with or without #1658144) so webflo can follow them and confirm the problem.

mkhamash’s picture

RTBC patch #1, it seems that i18nviews will not be able to install in an installation profile without it, an example of an installation profile will not work without this patch is df [drupal-org.make].

Anybody’s picture

I can confirm this RTBC and would like to ask kindly for a new .dev and possibly stable release to make the module work again completely.

Thanks a lot for your hard work!