I've been testing the code added here: https://www.drupal.org/node/2411869
Because it's useful for my CMS Powerstart distribution.
Unfortunately it does not work on my machine.
The code succesfully adds files to the feature module but it fails to store the the file info in mymodules.features.uuid_node.inc
On Import I have the following errors:
Unknown error occurred attempting to import file: public://glazed-header-images/3539107466_4a57c4abde_o-300_0.jpg
Unknown error occurred attempting to import file: public://blog-images/6ec033df-smush-3904401799_5bfe586e29_o.jpg
Unknown error occurred attempting to import file: public://blog-images/6ec033df-smush-8260117875_5ab9373bce_o.jpg
Unknown error occurred attempting to import file: public://glazed-header-images/1920x300blurrscape.jpg
Unknown error occurred attempting to import file: public://blog-images/6ec033df-smush-2535937844_87a8cd3ebe_b.jpg
The other feature modules that still used base64 import worked ok.
It's not a permissions problem, I tried putting chmod -R 777 on the entire Drupal installation.
When I debug the uuid_features_file_field_export function I see that $field[$language][$i][$export_var] = $export_data; is populated with the correct information but this is not stored in the feature code.
My feature uses image fields. I added a normal file field to see if it made a difference but it showed identical behavior. Here is a sample output to mymodule.features.uuid_node.inc:
'field_blog_image' => array(
'und' => array(
0 => array(
'file_uuid' => '943812d8-be87-4997-8367-2b8d0ece87a8',
'width' => 848,
'height' => 616,
'image_field_caption' => array(
'value' => '',
'format' => 'plain_text',
),
),
),
),
'field_glazed_header_image' => array(
'und' => array(
0 => array(
'file_uuid' => '0b626e62-daca-45ab-9978-f5abc25ba038',
'width' => 1920,
'height' => 300,
'image_field_caption' => array(
'value' => '',
'format' => 'plain_text',
),
),
),
),
'field_test_file_field' => array(
'und' => array(
0 => array(
'file_uuid' => '6e38615d-794d-47cb-9151-a0ea3d4d3f4c',
'display' => 1,
'description' => '',
),
),
),
Import fails because it does not contain the 'uuid_features_packaged_file_path' values.
With some further debugging in uuid_node.features.inc I could see that some hook implementation here strips out the package_file_path:
drupal_alter('uuid_entity_features_export_render', $entity_type, $export, $node, $module);
Comments
Comment #1
jurriaanroelofs commentedComment #2
jurriaanroelofs commentedComment #3
jurriaanroelofs commentedIf I comment out the drupal_alter('uuid_entity_features_export_render', $entity_type, $export, $node, $module);
it will export properly, including the uuid_features_packaged_file_path value, but then when I try to import files it creates empty files at the URI for imported files, so that might be a side effect. or another problem.
Comment #4
jurriaanroelofs commentedwith the most recent versions of features and uuid_features this has changed and is not a problem anymore