Notice: Undefined index: .../sites/all/modules/field_collection/field_collection.tokens.inc).

Any thoughts?

Comments

joshuautley created an issue. See original summary.

tusharbodke’s picture

Assigned: Unassigned » tusharbodke

Hi,

Can I have complete message for "Notice: Undefined index:" problem. Want to know for which variable & line above issue is reported.

Thanks

youlikeit’s picture

Hi
I get the same message
Notice: Undefined index: paragraphs_item in field_collection_host_entity_types() (line 143 of...www/sites/all/modules/field_collection/field_collection.tokens.inc).

tusharbodke’s picture

Status: Active » Needs review
StatusFileSize
new1011 bytes

Hi,

Please find attached patch to resolve reported issue.
let me know if anything.

Thanks

Status: Needs review » Needs work

The last submitted patch, 4: field_collection-undefine-index-check-2596817-4.patch, failed testing.

tusharbodke’s picture

StatusFileSize
new1010 bytes
tusharbodke’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 6: field_collection-undefine-index-check-2596817-4.patch, failed testing.

tusharbodke’s picture

Status: Needs work » Needs review
StatusFileSize
new1007 bytes
joshuautley’s picture

#9 worked. Thank you.

tusharbodke’s picture

Hi joshuautley,

Really nice to hear that.
Thanks

genjohnson’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #9 is working for me, too.

jmuzz’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

The comment for the changed line of code states that the check being added is not necessary. It's hard to disagree with that. It would mean that the field collection field belongs to a host entity type that doesn't exist.

Can anybody describe a legitimate use case where this might happen or provide steps to reproduce the error from a clean installation? If so, perhaps the change can be committed with the comment removed.

Modules shouldn't necessarily attempt to support sites that have corrupted data by silently skipping steps. Consider that the error message may be the correct behaviour.

jmuzz’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
frazras’s picture

You can manually go into the database and remove the entries from the table for the problem field

nathan tsai’s picture

As @frazras said, you can go to the `field_config` table in your D7 database and delete the instances of it.