Closed (fixed)
Project:
DART
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2011 at 14:45 UTC
Updated:
17 Mar 2012 at 04:30 UTC
Jump to comment: Most recent file
There is slight issue that generates a php notice. If a taxonomy term has been deleted, there is still a reference to its tid in the fields of a node, This means that when the term is loaded, it returns false resulting in notices when the loaded term is expected to be a term object.
Here's a simple patch that checks the term is an object before treating it as one.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1355836-deleted-tax-terms.patch | 1.5 KB | bleen |
| #2 | 1355836-deleted-tax-terms.patch | 1.46 KB | bleen |
| dart_taxonomy_check_term_is_object.patch | 550 bytes | theapi |
Comments
Comment #1
jamiecuthill commentedThe alternative here is to call array_filter() on the array in the foreach. I would like to see a fix for this committed.
Comment #2
bleen commentedI'd rather cut this off at the source and not put deleted tax terms in that array in the first place. This patch should do it, but I havent had much time to actually test it ... can one of you give this a try.
Comment #3
jamiecuthill commentedYour patch is logical but you need to actually assign the $term on line 232.
Comment #4
bleen commentedblarrg ... of course. This should do it (and simplify some code a bit). Note that taxonomy_term_load is ultimately cached statically so this change should not affect performance.
Comment #5
bleen commentedcommitted this to 7.x-2.x