Problem/Motivation
Thanks for the module, first of all. I need help here. I want to make the gdpr fields configurations exportable. I have used the hook hook_gdpr_fields_default_field_data() and did this:
function hook_gdpr_fields_default_field_data() {
$export = array();
$field = new GDPRFieldData();
$field->disabled = FALSE; /* Edit this to true to make a default field disabled initially */
$field->name = 'user|user|mail';
$field->entity_type = 'user';
$field->entity_bundle = 'user';
$field->property_name = 'mail';
$field->settings = array(
'gdpr_fields_enabled' => '1',
'gdpr_fields_rta' => 'inc',
'gdpr_fields_rtf' => 'anonymise',
'gdpr_fields_sanitizer' => 'EmailSanitizer',
'gdpr_fields_notes' => '',
'label' => 'Email',
);
$export['user|user|mail'] = $field;
return $export;
}
This is written inside the .module file of a feature. But I don't see the configurations when I am enabling the feature in a different instance. Am I missing something?
Comments
Comment #2
subhojit777Ok. I found the problem. The custom module which exports the field config customization was being called before the base
gdpr_fieldshook. Due to which the customizations done in the custom module were getting overridden.Workaround could be to increase custom module's weight, if you want to use the same fields. Otherwise you have to create new
GDPRFieldDatawith a different field_name.Comment #3
subhojit777