I came across this bug while trying to get Full HTML views header translated via i18nviews module. Basically, the line 330 of base.inc uses wrong array to pull format info from:

$format = $options[$definition['format_key']];

We come to the line 330 after the check on line 305 - if (is_array($options)) - and at line 330 we are inside "else if" , so $options is a string, not an array at this point (in my case - it is views header content). In some PHP environments the attempt to use string as an array will cause an error (I believe that's what is reported here: http://drupal.org/node/1525152) but my debugger (I use phpStorm) just shows the first character of $options string used as format, not the appropriate numeric value (0,1,2,3).
The line 329 of 6.x-3.x-dev checks correctly for isset($storage[$definition['format_key']]) - because indeed $storage[$definition['format_key']] has the format setting (in my case - 3, full HTML).
So the correct syntax of line 330 has to be:

$format = $storage[$definition['format_key']];

I decided to check is it fixed in the HEAD of the 6.x.3.x and was surprised to discover that it is quite opposite: the line 329 has been changed to the wrong syntax isset($options[$definition['format_key']]).

So I made a patch against 6.x-3.x HEAD and it fixes the problem - passes correct format setting to the localization plugin.

I have attached the patch to this bug report.

CommentFileSizeAuthor
base-inc-line-330.patch635 bytescalmforce
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Closed (duplicate)

Thanks for the patch. As you mentioned this is a duplicate of the other issue: #1525152: format_key handling broken which results in lost translations

calmforce’s picture

I decided to post the patch because the solution offered in #1525152 I found to be wrong for 6.x-3.x-dev , but I did not verify mine in 7.x-3.3 so I am not sure will it work there. The current 6.x-3.x HEAD doesn't have a fix - it is a port of 7.x-3.3 #1525152 and it doesn't work.

calmforce’s picture

Issue summary: View changes

clarified some phrases