Hi,

I have created a content type with a field collection.. I then exported it along with the other bits for the module through features..

After copying in the generated files I get an error on the site when accessing the features and modules pages even before the new feature has been enabled..

PHP Parse error:  syntax error, unexpected '{' in /home/websites/platform/vhosts/www.site.com/sites/default/modules/children/children.features.field.inc on line 626

The "entity" line is line 626 below..

'field_instance' => array(
      'bundle' => 'child_record',
      'default_value' => array(
        0 => array(
          'entity' => {
            "item_id" : null,
            "field_name" : "field_child_contacts",
            "field_child_contact_fullname" : { "und" : [] },
            "field_child_contact_mob_phone" : { "und" : [] },
            "field_child_contact_home_phone" : { "und" : [] },
            "field_child_contact_work_phone" : { "und" : [] },
            "field_child_contact_relation" : { "und" : [] },
            "field_child_contact_emergency" : { "und" : [ { "value" : 0 } ] }
          },
        ),
      ),

Unfortunately I am not a coder and nothing looks obviously wrong to me..

Any help appreciated.. :)

Comments

rfc2460’s picture

hi,

I confirm the bug. I have the same thing when I try to specify a default value in one of the field of the collection. If I remove the default value, it works well.

wipeout_dude’s picture

My fields don't have default values but I do have a select list field and a user reference field which may be seen as having default values even if those values are "- None -"..

Glad its not just me though.. :)

rfc2460’s picture

You can check #1269750: Exporting a Field Collection field with a default value to Features leads to a PHP parse error for a patch (#61 solves the issue for me) (and I think we can close this issue to keep only one discussion)

merilainen’s picture

Status: Active » Closed (duplicate)