Comments

lklimek’s picture

It seems that some work was done in #1973770: Integration with users, entityreference, taxonomy term references, field collections and nodequeue items and committed a few months ago, but it still doesn't work :(

For example, the code depends on setting the variable uuid_features_entity_field_collection_item, and I can't see any place in the code where this value can be changed.

lklimek’s picture

Status: Active » Needs work
StatusFileSize
new2.01 KB

Attached patch adds "field collection" to feature creation screen and makes some progress, but it's still not working well for me (I have a complex structure of field_collection embedding another field_collection embedding term_reference...)

MatthewHager’s picture

Field collection support was added in #1973770 but I'm having issues with it adding extra escape sequences to the exported feature. I haven't been able to track down where the issue originates.

Here is an example:

  $field_collections = array();

  $field_collections[] = array(
    'field_name' => 'field_gallery',
    'default_revision' => 1,
    'archived' => 0,
    'uuid' => '056889f9-baa9-43e8-befa-930b1b6505ff',
    'field_image' => array(
      'und' => array(
        0 => array(
          'uid' => 1,
          'filename' => 'gallery-3.jpg',
          'uri' => 'public:\\/\\/masonry-gallery\\/image\\/gallery-3_0.jpg',
          'filemime' => 'image\\/jpeg',
          'filesize' => 166659,
          'status' => 1,
          'uuid' => '1338d34c-104f-4d6f-9255-ff11eb02adda',
          'alt' => '',
          'title' => '',
          'width' => 400,
          'height' => 268,
          'uuid_features_file_data' => '[redacted because this is a huge base64 encoded image]',
        ),
      ),
    ),
    'field_youtube_video_id' => array(),
  );

You can see that the uri is messed up and where I redacted the uuid_features_file_data, that also contained a bunch of weird double backslash escaped slashes.

To fix the issue I added:

$code = str_replace('\\\\/', '/', $code);

right before the export function returns in order to remove all the extra slashes. This fixed it and now I can import and export field collections. :)

Attached is my patch.

MatthewHager’s picture

Here is another patch rolled with --no-prefix --relative for drush make.