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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markusa’s picture

I had upgraded field collection to beta5....perhaps the new version breaks modals?

markusa’s picture

Is anyone even paying attention to this module? Are you looking for a new maintainer??

markusa’s picture

confirmed this bug on
http://simplytest.me/

I'll start looking into a fix

markusa’s picture

Solution 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')),

markusa’s picture

Issue summary: View changes

updating conditions of issue

WorldFallz’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Needs review
FileSize
1.46 KB

Here'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.