I'm getting a 500 server error I noticed first while using webmaster tools. I started getting a significant amount of crawl errors after updating from beta3 to beta4.

In the report log the error shows: EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7633 of /var/www/example.com/includes/common.inc)

I'm using Views 7.x-3.5 and using the taxonomy view with the path taxonomy/term/% -- the one that comes disabled with views.

If I go to these types of url's I get the 500 Server error:
http://www.example.com/taxonomy/term/all/
http://www.example.com/taxonomy/term/all/page/
http://www.example.com/taxonomy/term/all/page/65/0?page=35

Disabling metatag fixes the server error.

Any help would be greatly appreciated.

Files: 
CommentFileSizeAuthor
#11 Using_Views_taxonomy_term_causing_EntityMalformedException_5-1852600-11.patch671 byteshelmo
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch Using_Views_taxonomy_term_causing_EntityMalformedException_5-1852600-11.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#5 metatag-n1852600-5.patch1.93 KBDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Comments

William Aubert’s picture

Hello Lance,

I have the same message on the /taxonomy/term/all page :
EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7562 of /var/www/xxxxxxx/includes/common.inc).

- My Drupal core version is 7.16 and Metatag version 7.x-1.0-beta2
- On my site there's just one vocabulary, but the terms use an image field (a logotype image).
- the error is visible for anonymous users

I am looking for a solution for 2 weeks, here is the summary of my failed attempts:
- I disabled metatag module,-edit - YES it fixe the problem, but it is not a real solution !
- I tried the Taxonomy Orphanage Module and the field_reference_delete Module... but it doesn't solve the problem.
- I looked into taxonomy_term_ tables and saw nothing suspicious, all columns/fields are nicely filled up.

-edit- My actual solution is to uninstall the 7.x-1.0-beta2 version of metatag and re-install the 7.x-1.0-alpha8. It looks working !

rw1007’s picture

William,

Thanks for the response! I'll try the 7.x-1.0-alpha8. Another solution I found last night was using the Metatags Quick module for the meta tags.

Thanks,

Lance

DamienMcKenna’s picture

@William: Pardon me for asking, but where are you getting the taxonomy/term/all page from? That isn't a valid page in Drupal core, nor will the normal Views taxonomy term page provide it either. Also, please don't revert to a previous version :)

William Aubert’s picture

The error is easy to reproduce on a new installation.
- Install drupal
- install & enable chaos tools, views and token
- create an article with a term (add a term to the 'Tags' vocabulary)
- enable and edit the default "Taxonomy term (Content)" views
- go to the 'Contextual filters' section and edit the first filter 'Content: Has taxonomy term ID (with depth) '
- enable 'Display all results for the specified field' in the 'When the filter value is NOT in the URL' section
- save the views
- go to www.example.com/taxonomy/term/all. -> All is OK
- install and enable the Meta tag 7.x-1.0-beta2 version
- go to www.example.com/taxonomy/term/all. -> You can see the error message.

I don't know, if it is a token issue or a Meta Tag issue.

DamienMcKenna’s picture

Status:Active» Needs review
StatusFileSize
new1.93 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Ahhhh. Ok, now I understand.

This patch will only run the Views and Panels integration if the first argument is numeric.

DamienMcKenna’s picture

Status:Needs review» Fixed

Committed.

William Aubert’s picture

Status:Fixed» Needs review

Thank you @Damien !
it works perfectly now.

DamienMcKenna’s picture

Status:Needs review» Fixed
William Aubert’s picture

sorry

DamienMcKenna’s picture

@William: no problem, thanks for helping me identify the bug.

helmo’s picture

Status:Fixed» Needs review
StatusFileSize
new671 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch Using_Views_taxonomy_term_causing_EntityMalformedException_5-1852600-11.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Sorry to re-open this, but the patch from #5 has a flaw. It tests $args where it should be $view->args

I'm debugging a similar issue. I'm also not sure this solves my issue.
The exception is gone after applying the patch from this issue.
But the effect looks the same as disabling the "Taxonomy term (Content)" view.

Status:Needs review» Needs work
DamienMcKenna’s picture

Status:Needs work» Fixed

@helmo: I rerolled and committed your patch, sorry for leaving in the typo.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Closed (fixed)» Needs review

Status:Needs review» Needs work
DamienMcKenna’s picture

Issue summary:View changes
Status:Needs work» Closed (fixed)

This specific issue was fixed two years ago.

arneunruh’s picture

I had the same issue on metatag 7.x-1.4 and drupal 7.33. After same backtracing i add on line 2127

if (!empty($first_context->data) && !is_string($first_context->data)) {

Some times i get a string instead an object.

bserem’s picture

Status:Closed (fixed)» Active

The problem seems to have resurrected with v7.34 (or maybe 7.33, I skipped that one).

EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids()
(line 7766 of /.../d734/includes/common.inc)
DamienMcKenna’s picture

Status:Active» Closed (fixed)

I've opened a new issue for the new bug: #2396161: Error on taxonomy/term/% pages managed by Views

Lets leave this one closed.