Download & Extend

Fatal error: Call to a member function unpack_translatables()

Project:Internationalization Views
Version:7.x-3.x-dev
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

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.

Comments

#1

Priority:normal» major
Status:active» needs review

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

AttachmentSize
i18nviews-1653170.patch 654 bytes

#2

Patch in #1 works. Thank you.

#3

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.

#4

Works for me also