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.
Problem/Motivation
Not a critical but the module throws an error message:
"Notice: Undefined index: revision_id in field_collection_field_get_entity() line 1685"
In my case I see this error message after feeds importer finishes the process. It doesn't break the import process but shows the message only when it ends.
Steps to reproduce
I haven't tried in other scenarios but these steps I follow in this specific case:
- I have a content type where is set a field as a field_collection type
- There is a feeds importer configured to import content from external link, this is configured to run with cron
- Run manually (UI or Drush) cron
- When it finishes throws the error message
Proposed resolution
There is a single condition missing in field_collection.module line 1685
if ($entity && $entity->revision_id != $item['revision_id']) {
The proposed solution is:
if ($entity && isset($item['revision_id']) && $entity->revision_id != $item['revision_id']) {
I'm leaving a patch for review.
Remaining tasks
NA
User interface changes
NA
API changes
NA
Data model changes
NA
Comment | File | Size | Author |
---|---|---|---|
field_collection_revision_fix.patch | 730 bytes | afsch | |
Comments
Comment #2
renatogit really makes sense. The patch is adding a new verification before using that. It'll prevent this kind of error.
Thanks a lot for that
Comment #4
renatogMoved to the dev branch
Thank you so much