Hope this helps
Notice: Trying to get property of non-object in entity_extract_ids() (line 6439 of C:\xampp\htdocs\includes\common.inc).
Notice: Undefined index: field_name in _field_invoke() (line 198 of C:\xampp\htdocs\modules\field\field.attach.inc).
Notice: Undefined index: field_name in _field_invoke() (line 198 of C:\xampp\htdocs\modules\field\field.attach.inc).
Notice: Undefined index: field_name in _field_invoke() (line 198 of C:\xampp\htdocs\modules\field\field.attach.inc).
Notice: Undefined index: field_name in _field_invoke() (line 198 of C:\xampp\htdocs\modules\field\field.attach.inc).
Notice: Trying to get property of non-object in entity_extract_ids() (line 6439 of C:\xampp\htdocs\includes\common.inc).
Notice: Undefined index: field_id in field_attach_delete() (line 995 of C:\xampp\htdocs\modules\field\field.attach.inc).
Notice: Undefined index: field_id in field_attach_delete() (line 995 of C:\xampp\htdocs\modules\field\field.attach.inc).
Notice: Undefined index: field_id in field_attach_delete() (line 995 of C:\xampp\htdocs\modules\field\field.attach.inc).
Notice: Undefined index: field_id in field_attach_delete() (line 995 of C:\xampp\htdocs\modules\field\field.attach.inc).
Notice: Undefined index: module in field_attach_delete() (line 1003 of C:\xampp\htdocs\modules\field\field.attach.inc).
Notice: Trying to get property of non-object in path_taxonomy_term_delete() (line 307 of C:\xampp\htdocs\modules\path\path.module).
Notice: Trying to get property of non-object in taxonomy_taxonomy_term_delete() (line 1543 of C:\xampp\htdocs\modules\taxonomy\taxonomy.module).
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 841798-term-delete.patch | 1.83 KB | klausi |
| #5 | 841798-term-delete.patch | 1.75 KB | klausi |
| #1 | 841798-taxo-delete.patch | 1022 bytes | klausi |
Comments
Comment #1
klausiThat's because taxonomy_vocabulary_delete() deletes single terms in a loop and if a term is a parent its children get deleted in the same call. Then a delete may be issued more than once for a term which causes confusion. This patch fixes taxonomy_term_delete().
Comment #2
fagoPatch looks good to me. Imo this could need a test that makes sure this doesn't break again.
Comment #3
sp_key commentedMany thanks for your response and for fixing this.
Unfortunately I can't test because I don't know hot to run the patch (failed in previous attempts) but I'm more than happy to wait for next release.
Comment #4
craigmc commentedApplied patch locally. Deleted term with child terms successfully.
Works fine locally. Looks like a go to me. Tested taxonomy_delete_term with child items, and taxonomy_delete_vocabulary with multi-level vocabularies.
Comment #5
klausiHm, my analysis from #1 is a bit wrong, as taxonomy_vocabulary_delete() works as expected. The problem is taxonomy_term_delete(), where invalid term IDs are not checked. I ran into this when deleting all terms from a vocabulary in a loop, where I wanted to keep the vocabulary with its fields.
Now with a test. Not sure what I should use as invalid term ID. 42 seems a nice number though :-)
Comment #6
klausiComment #7
klausi#5: 841798-term-delete.patch queued for re-testing.
Comment #9
klausireroll.
Comment #10
sp_key commentedIsn't 42 the answer to life the universe and everything?
Comment #11
ramlev commentedI have tested it on my local environment, the code looks fine to me, and the test was all ok.
Comment #12
dries commentedOne could argue we should throw an exception but taxonomy module does not throw any exceptions so this actually looks pretty consistent.
Committed to CVS HEAD.