Glad I found this module, saved me a mess of css :-)
I have terms and nodes. At some point, I assigned tid=10 to nid=5 (for example). Later, I deleted tid=10 from the vocabulary.
Next, I installed taxonomy_formatter and it worked great until I hit a view showing nid=5 where I got these errors:
Notice: Undefined index: 10 in taxonomy_formatter_field_formatter_view() (line 151 of /var/aegir/platforms/commerce_kickstart-1.3/sites/all/modules/taxonomy_formatter/taxonomy_formatter.module).
EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7501 of /var/aegir/platforms/commerce_kickstart-1.3/includes/common.inc).
Instead of digging in the code, I just fixed my problem with this SQL:
delete from field_data_field_tags where field_tags_tid = 10;
Don't try the fix just mentionned - it worked on my data, it won't work on yours!
I presume the bug lies deeper in the Fields API, but I wanted to note it here since it's the first time I encountered the problem. Found it: #1075998: Notice: Undefined index: taxonomy_term after re-using term reference fields
Comment | File | Size | Author |
---|---|---|---|
#3 | taxonomy_formatter-malformed-entity-1449858-1.patch | 890 bytes | Robin Millette |
#1 | taxonomy_formatter_term_check.patch | 1.15 KB | mh86 |
Comments
Comment #0.0
Robin Millette CreditAttribution: Robin Millette commentedUpdated issue summary.
Comment #1
mh86 CreditAttribution: mh86 commentedI had the same problem on my website and the attached patch makes the code in the formatter more robust.
Comment #2
azinck CreditAttribution: azinck commentedCan confirm the patch in #1 has fixed it for me. Thanks!
Comment #3
Robin Millette CreditAttribution: Robin Millette commentedThat works, but I prefer the shorter
option. I've provided a patch as well. They are functionnally equivalent.
Comment #4
mh86 CreditAttribution: mh86 commentedI don't think that conforms to the Drupal coding standards and in my opinion the other one is easier to understand.
Comment #5
Robin Millette CreditAttribution: Robin Millette commentedYou're right. Without braces, my patch doesn't confirm to our coding standards. I alyways forget those for single line code-blocks.
As for easier to unsterstand, I generally prefer to keep level nesting smaller but that's not something to debate here :-)
Comment #6
dkingofpa CreditAttribution: dkingofpa commentedCould we get this committed please?
Comment #7
dkingofpa CreditAttribution: dkingofpa commentedIt appears this is a duplicate of #934726: Undefined index: taxonomy_term in taxonomy_field_formatter_view(). The patch listed in #1 was applied for that issue. http://drupalcode.org/project/taxonomy_formatter.git/commit/64e6ec7d9824...
Fix is available in 7.x-1.4
Comment #7.0
dkingofpa CreditAttribution: dkingofpa commentedUpdated issue summary.