Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maximpodorov’s picture

What did you mean?

Konstantin Komelin’s picture

Hi Max,

I'm experiencing the same issue. It seems like ddf settings are not exportable through Features module.
Do you have plans to implement Features module support?

Thanks,
Konstantin

maximpodorov’s picture

They are normal field settings. Why won't they be exported?

maximpodorov’s picture

Oh, no, I forget about the additional settings stored in the DB. Could someone provide the patch for this?

Konstantin Komelin’s picture

Hi Max,

Please give us an idea which setting exactly we need to save additionally.

Thanks,
Konstantin

Konstantin Komelin’s picture

Oh, I've found it, the ddf table contains necessary settings.

Konstantin Komelin’s picture

The following code will add necessary setting to the database:

  $settings = array(
    'type' => 'options'
  );

  $fields = array(
    'field_name' => 'field_1',
    'entity_type' => 'node',
    'bundle' => 'article',
    'dependent_field_name' => 'field_2',
    'data' => serialize($settings),
  );

  db_insert('ddf')
    ->fields($fields)
    ->execute();

I've added this code to my hook_update_N as a workaround.

yseki’s picture

Hi,

Here is one patch me make DDF features exportable.

yseki’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: dff_updated_to_be_features_exportable-2201097-8.patch, failed testing.

yseki’s picture

Path for retest

yseki’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: dff_updated_to_be_features_exportable-2201097-11.patch, failed testing.

yseki’s picture

Status: Needs work » Needs review
FileSize
3.29 KB

Oh!
Different folder.

Status: Needs review » Needs work

The last submitted patch, 14: dff_updated_to_be_features_exportable-2201097-14.patch, failed testing.

Konstantin Komelin’s picture

@yuriseki
Advanced patch contributor guide may help.
Also, make sure the number (N) in hook_update_N is correct.

yseki’s picture

Status: Needs work » Needs review
FileSize
3.42 KB

Thanks Konstantin,

I followed the guide, hope it works this time :-)

azinck’s picture

Thanks for the patch. Just a couple of little issues with #17

  • specifies the unique key incorrectly in hook_schema
  • DDF tablename shouldn't be capitalized

Fixed patch attached.

mortona2k’s picture

Status: Needs review » Needs work

On a clean install with a ddf field in a feature, the dynamic field doesn't update properly. Saving the field settings fixes it. It seems that the feature revert isn't saving the settings to the db? It could also be that it uses a field id to target ddf, which can be different depending on when features are enabled.

azinck’s picture

Status: Needs work » Needs review
FileSize
9.32 KB
5.82 KB

Ah, good catch mortona2k...I didn't look at this carefully. Needed to refactor ddf to use a consistent load function and use Ctools to load our exportables. Patch attached.

Status: Needs review » Needs work

The last submitted patch, 20: ddf-features_exportable-2201097-20.patch, failed testing.

azinck’s picture

Version: 7.x-1.6 » 7.x-1.x-dev

azinck’s picture

Status: Needs work » Needs review
maximpodorov’s picture

Maybe it's better to get rid of a dedicated DB table and just store the ddf settings in field instance settings.

Konstantin Komelin’s picture

Maxim, in that case we'd need an upgrade mechanism.

Leiph’s picture

I agree with #25. Storing the settings in field instance settings will make the export more robust.

/Leiph