Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This error appears when modifying a content type display which has a Field Collection, and you edit the formatter settings for a non translatable Field Collection.
Steps:
- Create or edit a content type
- Create a Field Collection field
- Go to the content type "Manage display"
- Click on the field collection field settings
- Save the field collection field settings
The solution is just to test for the 'translate' index ($settings['translate'] ? $settings['translate'] : '') in field_collection_field_formatter_settings_form:
$elements['translate'] = array(
'#type' => 'textfield',
'#title' => t('Translate link title'),
'#default_value' => isset($settings['translate']) ? $settings['translate'] : '',
'#description' => t('Leave the title empty, to hide the link.'),
'#access' => field_collection_item_is_translatable(),
);
Comment | File | Size | Author |
---|---|---|---|
#3 | field_collection-undefined-index-translate-2894132-3.patch | 648 bytes | joelstein |
|
Comments
Comment #2
dtamajon CreditAttribution: dtamajon commentedComment #3
joelstein CreditAttribution: joelstein as a volunteer commentedI had the same problem at the attached patch fixed it for me.
Comment #4
RgnYLDZ CreditAttribution: RgnYLDZ commentedI can confirm that this patch works.
Comment #5
renatogReally makes sense.
Thank you very much for the catch.
Comment #7
renatogCommitted and pushed to the dev branch.
Thank you guys for your contributions.
Good Work and Good Weekend.
Best,