Problem/Motivation

Issue #1427158: Use field_collection_field_formatter_prepare_view to increase performance by 50% introduced a new bug. When the field value equals the entity id, then it overwrites it. Specifically L1005 in https://git.drupalcode.org/project/field_collection/blame/7.x-1.x/field_....
If I have 3 fields collection with ids [1][1, 5, 8]. When #1 has a field with values [1,2,3] then it replaces it. [1][1,5,8] becomes [1][1,2,3]
https://git.drupalcode.org/project/field_collection/blame/7.x-1.x/field_... does a for loop of the items. So it does [1], [2], [3], when it should do [1], [5], [8].

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iStryker created an issue. See original summary.

iStryker’s picture

Status: Active » Needs review
FileSize
2.05 KB

Attached is a patch that fixes it. I need someone to review this to make sure the logic of loading the field data still works.

FYI - commenting out line 1005 also works.

  • ram4nd committed 1b1d38d on 7.x-1.x authored by iStryker
    Issue #3091188 by iStryker: Field Collection stop working
    
ram4nd’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Liam Morland’s picture