I’m getting the following when trying to change the visibility of the weight field provided by the Weight module

Fatal error: Cannot use string offset as an array in … sites\all\modules\i18n\i18n_field\i18n_field.inc on line 148

and

Notice: Uninitialized string offset: 0 in i18n_field_instance->build_properties() (line 148 of … sites\all\modules\i18n\i18n_field\i18n_field.inc).

This is a dual language (English-Hungarian) Drupal 7 site with Hungarian as the primary language. The errors appear regardless of which language the change is attempted in. Not sure what other information to provide, but will do my best if asked. The bottom line is the weight field cannot be hidden in the node display as a result.

CommentFileSizeAuthor
#4 uninitialized_string_offset-1493126-4.patch975 bytesjvns

Comments

grabby’s picture

For what it’s worth, I’m also getting the error when I make any changes to the fields for a content type, such as hiding them, changing their widget, etc. This is especially a problem now when I have to add fields. It simply can’t be done!

grabby’s picture

Further information on this problem is that the weight module had nothing to do with it – removing it had no effect – but that unchecking “Field translation” made the errors go away.

smhaller’s picture

Hi,

I just got the same issue here when trying to add a new group to one of my views.

regards,
Stefan

jvns’s picture

Status: Active » Needs review
StatusFileSize
new975 bytes

I've been encountering this problem after upgrading from D6 to D7 (see also http://drupal.org/node/1431104, http://drupal.org/node/1431104).

Here's a 1-line patch that is fixing it for me. ($object['default_value'] is sometimes set but null)

Status: Needs review » Needs work

The last submitted patch, uninitialized_string_offset-1493126-4.patch, failed testing.

mvc’s picture

same problem; this patch works for me.

the test seems very safe. i find it hard to believe that this patch is breaking the test suite.

jose reyero’s picture

Status: Needs work » Fixed

Replaced both conditions with !empty() and committed. Thanks.

Atm the module tests are broken for a different reason, #1568862: Updates for Variable Realm API improvements (testbot using wrong variable version)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

colan’s picture

Actual commit is d709eee.