Closed (fixed)
Project:
Field collection
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Dec 2012 at 19:03 UTC
Updated:
25 Apr 2019 at 08:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nancydruComment #2
catchPlease post a backtrace.
Comment #3
nancydruI told Devel to create a backtrace, but none came out.
Comment #4
nancydruMaybe this will help
# Time Memory Function Location
1 0.0003 680536 {main}( ) ..\index.php:0
2 0.2535 49730512 menu_execute_active_handler( ) ..\index.php:21
3 0.2566 50495696 call_user_func_array ( ) ..\menu.inc:517
4 0.2566 50496096 drupal_get_form( ) ..\menu.inc:517
5 0.2566 50498432 drupal_build_form( ) ..\form.inc:131
6 0.2576 50524096 drupal_process_form( ) ..\form.inc:374
7 0.2593 50574840 form_execute_handlers( ) ..\form.inc:860
8 0.2593 50578248 field_ui_field_delete_form_submit( ) ..\form.inc:1464
9 0.4757 53836264 field_purge_batch( ) ..\field_ui.admin.inc:1791
10 0.5390 56186072 field_purge_data( ) ..\field.crud.inc:870
11 0.5390 56186632 _field_invoke( ) ..\field.crud.inc:910
12 0.5398 56195328 field_collection_field_delete( ) ..\field.attach.inc:209
13 0.5399 56199624 EntityFieldQuery->fieldCondition( ) ..\field_collection.module:633
14 0.5399 56199976 EntityFieldQuery->addFieldCondition( ) ..\entity.inc:663
Comment #5
catchYes that helps. Moving to field_collection.
Comment #6
DrupalDan commentedI got the same problem. I tried the dev version but the problem persists. Please let me know if you need anything. Thanks!
Comment #7
klausiHere is a patch that only executes the EFQ if the actual field info still exists, because otherwise that causes the EFQ exception.
Comment #8
andypostMakes sense.
Should exclude deleted collection fields. But introduces performance regression while #1040790: _field_info_collate_fields() memory usage not commited
Comment #9
likewhoa commentedWFM thanks!
Comment #10
andypost+1 to RTBC, no regression!
Comment #11
mo3.mo3 commentedi get the same error. i see the patch in the previous post, how do i apply it?
Comment #12
andypost@nUCLEArcENTURy http://drupal.org/patch/apply
Comment #13
nasia123 commentedI confirm that this works...
Deleted fields values however exist in the database (I checked field_config and field_config_instance tables) but now those fileds are not referenced, so the error is removed.
Maybe it should be mentioned somewhere in the fields_collection module , tha fields collection should be first removed one by one from the Fields Collections Structure Menu, before deleting a field collection from a content type... or maybe a field collection should not be allowed to be removed from a content type before deleting all items them first ...
Comment #14
klausiThis has not been committed yet?
Comment #15
henrijs.seso commentedFixes ugly bug. Thank you, klausi.
Comment #16
fagoI'm not sure how this can happen. Why should core invoke hook_field_delete() on a not more existing field? Sounds like a bug elsewhere to me.
Comment #17
Josh Benner commentedFrom what I can tell, when core "deletes" a field, it is still present waiting to be purged from the DB. When this occurs (field_purge_batch), field_purge_data() is called for the deleted field to get rid of any lingering data, which in turn explicitly invokes hook_field_delete(). I don't think this is a bug elsewhere.
The patch in #7 works for me.
Comment #18
haphvn commented#7: fieldcol-1866032-7.patch queued for re-testing.
Comment #19
haphvn commentedthat's nice
#7 it works for me
many thanks
Comment #20
roderikRTBC +1.
I see what Josh Benner sees. hook_field_delete gets explicitly invoked by field_purge_data().
Also, when googling some, I found BulkDeleteTest for D8 -- the comments in the test imply that this is intended behavior.
@fago I'm nowhere near as qualified to judge this as you / don't know the code -- but would this be a core documentation issue, then? (It should be explicitly mentioned that hook_field_delete gets called for already deleted fields, to prevent future people from encountering this?)
Anyway, it seems Field Collection should be fixed as per this issue.
Comment #21
jherencia commentedSame problem here.
Comment #22
kscheirerSame problem as described above. Here's a backtrace as requested in #2.
Patch in #7 fixed the problem for me. Using 7.x-1.0-beta5.
Comment #23
jschrab commentedI also have found that the patch in #7 helps. But even if one clears out child fields before deleting a field collection, tables "field_collection_item" and "field_collection_item_revision" may still have references in them that, in the best of all worlds, should be cleared out too - maybe this patch needs work?
Finally, having cron run so that fields marked for deletion DO get deleted is something to be expected to TOTALLY clear this up #1400478: Cannot disable module - required by Drupal, fields pending deletion
AFAIK :)
Comment #24
fago#7: fieldcol-1866032-7.patch queued for re-testing.
Comment #25
fagoCommitted, thanks.
Comment #27
hollyfox commentedJust for anyone coming into this for the same problem. This issue can also result when you delete a field that is tied to another node referrer in another content type via corresponding node references. *Even if the patch above is installed. I was able to fix it by deleting the compliment node referrer field in the other content type.
I added this to the corresponding node references project issue queue just so there is no confusion. https://www.drupal.org/node/2663548
Comment #28
marleo commentedAlso for searchers: despite the patch in #7 apparently being committed about 4 years ago, it still hasn't made its way into the stable release, so you'll need to apply it manually. For 7.x-1.0-beta12, you're looking around line 630 of field_collection.module. And it does fix the problem.
Comment #29
berenddeboer commentedThanks @marleo! I was getting exactly the same error, just applying the patch worked. This bug has not been fixed.
Comment #30
kscheirerComments on a closed ticket are unlikely to get much attention. I'd suggest opening a new issue.
Comment #31
joegraduateI created a new issue regarding the absence of the fix for this issue in recent releases here: #3029628: Re-apply fix from #1866032 (EntityFieldQueryException: Unknown field)
Comment #32
aswathyajish commented#7 worked for me. Thanks a lot.