Closed (fixed)
Project:
Field collection
Version:
7.x-1.0-beta1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Feb 2011 at 09:20 UTC
Updated:
27 Apr 2011 at 16:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
p.brouwers commentedI had the same issue and made a patch for it based on the 7.x-1.x-dev-17-01 version.
The problem was that the language isn't set for the entities.
I'll attach the patch here, but I need to update it to the latest version AND fix 1 line that set's the language fixed to 'nl' instead of using the current langcode.
Comment #2
R.Muilwijk commentedComment #4
R.Muilwijk commentedMarking this critical because it will not allow you to delete nodes anymore.
Comment #5
fagothis should be fixed with the latest entity API dev version, please test.
Comment #6
rp7 commentedTested (Entity API 7.x-1.x-dev 2011-Feb-28) > as far as I can tell, unfortunately, still the same.
Comment #7
cfennell commentedIt looks like _field_invoke() (called by field_attach_delete() in field.attach.inc) invokes field_collection_field_delete() with empty $item arrays when field_collection_items are empty. A couple of the other modules that implement hook_field_delete() that I looked at (file_field, media_field) iterate over the $items array directly in their hook_field_delete() implementations, which means they'll just ignore empty arrays.
In the attached patch, I added small sanity check to field_collection_field_delete() and added a test to field_collection.test to ensure nodes with empty collection fields are deleted.
@fago any reason why this approach should not work?
Thanks.
Comment #8
fagohm, still I think the latest enttiy API should just skip that. Anyway, it won't harm to check it here too + improved test coverage is always good. I fixed the coding syle + committed it.
Comment #9
cfennell commentedSweet, thanks @fago.
Comment #10
p.brouwers commentedCool. Your fix seems to be a better approach than mine cfennel.
Comment #12
xsyn commentedLast patch failed testing.
Bump.
Comment #13
servantleader commentedI think this has already been corrected and committed(#8). If something is wrong, we should create a new issue.