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.
I get this php notice for every field collection I include on my node.
Notice: Undefined offset: 0 in field_collection_modals_field_attach_view_alter() (line 404 of /var/www/web/sites7/educationalfirststeps.org/modules/field_collection_modals/field_collection_modals.module).
Notice: Undefined offset: 0 in field_collection_modals_field_attach_view_alter() (line 414 of /var/www/web/sites7/educationalfirststeps.org/modules/field_collection_modals/field_collection_modals.module).
At the same time, modals do not appear for the edit links....Only the add links
Comment | File | Size | Author |
---|---|---|---|
#5 | Fix for Undefined offset 0 in field_collection_modals_field_attach_view_alter_2024457_5.patch | 1.46 KB | WorldFallz |
Comments
Comment #1
markusa CreditAttribution: markusa commentedI had upgraded field collection to beta5....perhaps the new version breaks modals?
Comment #2
markusa CreditAttribution: markusa commentedIs anyone even paying attention to this module? Are you looking for a new maintainer??
Comment #3
markusa CreditAttribution: markusa commentedconfirmed this bug on
http://simplytest.me/
I'll start looking into a fix
Comment #4
markusa CreditAttribution: markusa commentedSolution to make this module work right with field_collection beta 5
change line 404 from this: if (count($output[$field]['#items'][$key]) == 1) {
to this: if (count($output[$field][$key]['entity']['field_collection_item']) == 1) {
chance line 414 from this: if (count($output[$field]['#items'][$key]) == 1) {
to this: if (count($output[$field][$key]['entity']['field_collection_item']) == 1) {
change line 271 from this: 'title' => ($action == 'update' ? t('Modify Data') : t('Delete Data')),
to this: 'title' => ($action == 'update' ? t('Modify Data') : t('Delete Data')),
Comment #4.0
markusa CreditAttribution: markusa commentedupdating conditions of issue
Comment #5
WorldFallz CreditAttribution: WorldFallz commentedHere's a patch against the current dev.Not sure what the change to line 271 is supposed be (from #4) -- both the from and to are the same, lol.
This works for me. I'm willing to be added as a maintainer if necessary to get this fixed.
Thanks.