Closed (fixed)
Project:
Field collection
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Apr 2014 at 16:46 UTC
Updated:
17 Jan 2019 at 15:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sheise commentedHere's a patch.
Comment #2
sheise commentedComment #3
jedihe commentedI'm re-rolling the patch to apply on top of 7.x-1.0-beta7. For 7.x-1.x-dev, sheise's patch (#1) is the correct one.
Comment #4
jedihe commentedI just tested the patch manually and can confirm that it works. I was seeing a 4-valued field collection creating the very same context value for deltas 1, 2, 3 (no value set on those) as for delta 0 (with a value set) before I applied the patch. Once I applied it, the duplicated contexts didn't show up anymore and the notices were fixed. I tested on 7.x-1.0-beta7, but I think it holds true for the current dev version.
As for the code itself, I think it can be optimized a bit (not adding an extra line to create an empty context), but that's very minor so I think it looks good. Please note I have very basic experience with ctools plugins, so my opinion is qualified mostly from the Drupal point of view.
Setting to RTBC.
Comment #5
maximpodorov commentedThis fix is worth the new release also.
Comment #6
jmuzz commentedThe assigned variable wasn't used for anything so I removed it. This is simpler and should do the same thing. Please let me know if I am missing something.
Comment #7
chris matthews commentedThe patch in #6 is 3 years old, but still applied cleanly to the latest 7.x-1.x-dev snapshot and after reviewing/testing it does indeed do the same thing so I'm changing the status to RTBC.
Comment #8
renatog commented+1 to it
Comment #10
renatog commentedCommitted to the dev branch.
Thank you very much for the contribution.
Best,