Problem/Motivation

1. Do a clean Drupal install.
2. Add a term to taxonomy "Tags".
3. Change content type Article, Manage Display, and set the Tags field to Hidden.
4. Go to create an Article node, set the Tag to the term you added in step 2, do not save but click on Preview.

The following errors will show:

Proposed resolution

Remaining tasks

Check for the bug in 8.x
Determine the cause of the error.
Write a patch.

User interface changes

API changes

Original report by @psheiman

When node has some term_reference fields filled, for some reason 'taxonomy_term' item not being loaded in taxonomy_field_formatter_view().

Occurs when the term field is set to hidden, and a node is previewed prior to creating it.

CommentFileSizeAuthor
#4 before.png11.36 KBdcam
fixed__undefined_index__taxonomy_term_in_taxonomy_field_formatter_view()_.patch507 bytesAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

naxoc’s picture

Status: Active » Postponed (maintainer needs more info)

What are the steps to reproduce this?

neRok’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No steps to reproduce posted, so I think this is safe to close.

Bagz’s picture

Version: 7.12 » 7.28
Issue summary: View changes
Status: Closed (cannot reproduce) » Active

This is still a bug and is very easily reproduced:

1. Do a clean Drupal install.
2. Add a term to taxonomy "Tags".
3. Change content type Article, Manage Display, and set the Tags field to Hidden.
4. Go to create an Article node, set the Tag to the term you added in step 2, do not save but click on Preview.

The following errors will show:

Notice: Undefined index: taxonomy_term in taxonomy_field_formatter_view() (line 1601 of /var/www/html/test/modules/taxonomy/taxonomy.module).

EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7734 of /var/www/html/test/includes/common.inc).

dcam’s picture

Version: 7.28 » 7.x-dev
Assigned: » Unassigned
Issue summary: View changes
Status: Active » Needs review
FileSize
11.36 KB

I can confirm the bug for 7.x. I can't check for the bug 8.x right now due to #2276705: Cannot create image styles on Wamp server (Apache/windows).

Setting Needs Review to test the patch in the issue summary.

dcam’s picture

Issue summary: View changes
Status: Needs review » Needs work

Meh. Testbot doesn't seem to want to test the patch. It needs work anyway because we'll need a test for this.

hwasem’s picture

I'm also getting this error when previewing one of my content types, branch. Interesting, it is not all content types that use that vocabulary/term combination (for instance Events are fine). I don't understand that.

I'm using core 7.28. I'll be updating on Monday to see if it is happening in 7.31.

Error
Warning message
Notice: Undefined index: taxonomy_term in taxonomy_field_formatter_view() (line 1601 of .../modules/taxonomy/taxonomy.module). =>

Error message
EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7734 of .../includes/common.inc).

hwasem’s picture

I upgraded to 7.31 today and I still get the error as outlined above, with a line change on the second error:

EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7729 of .../includes/common.inc).

I tried the patch in #1 above and received a different set of error in entity_translation. Not sure if they are worth mentioning since the lines I applied the patch to were not 1440 as indicated in the patch, but 1601 where my errors were. And that patch is 2 years old.

I'm just sure where to go since I'm not great at understanding PHP. Any ideas or things to try would be very helpful.

Thanks,
Heidi

David_Rothstein’s picture