When using MongoDB Field Storage I'm encountering a problem when I changed a field from having only one value to having unlimited values. After saving the change to the content type and re-loading the node I get a white screen.

The error is:

PHP Fatal error: Cannot unset string offsets in /home/aoneill/share/testdrupal/sites/all/modules/mongodb/mongodb_field_storage/mongodb_field_storage.module on line 95, referer: http://testdrupal.local/node/2?render=overlay

I'm working on a patch that fixes this and also preserves field values when changing cardinality.



alxp’s picture

Assigned: alxp » Unassigned
Status: Active » Needs review
1.49 KB
None View

Here's my quick fix for the white screen, as well as preserving field values when you change cardinality of a field from one to more than one and vice versa.

math3usmartins’s picture

I consider this issue is related to #2197361.

Actually it's basically the same issue: MongoDB data structure differs from Drupal's data structure -- the structure is a little flatten within MongoDB for fields with cadinality=1.


  1. It will break the data if you change the field cardinality;
  2. It doesn't support translatable values (multiple values).

I'm not sure how this affects mongodb performance though, but it seems critical to improve MongoDB support for Drupal (i18n and flexibility).