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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexis_saransig created an issue. See original summary.

renatog’s picture

Status: Active » Reviewed & tested by the community

it 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

renatog’s picture

Status: Reviewed & tested by the community » Fixed

Moved to the dev branch

Thank you so much

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.