Closed (cannot reproduce)
Project:
Content Type: Extras
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2012 at 20:53 UTC
Updated:
24 Dec 2012 at 10:39 UTC
Preview button throws error when trying to preview after adding a new tag to a node.
How to reproduce this:
(1) Create content type with a taxonomy terms field
(2) Create a new node of the content type (1) /node/1/edit
(3) Add a taxonomy term to the relevant field
(4) Click on Preview button
Notice: Undefined index: taxonomy_term in taxonomy_field_formatter_view() (line 1443 of /***/taxonomy/taxonomy.module).
EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7501 of /***/includes/common.inc).Drupal 7.12
Comments
Comment #1
bocaj commentedHey @refineo!
I followed your steps to reproduce this, but the preview works for me each time. I set taxonomies up to be free-tagging as well as a preset list and the preview option works both ways. I'm assuming that you are getting this issue after we resolved #1517864: Preview throws error The requested page "/node//edit" could not be found, is that correct?
Any other steps or information you could give me would be helpful since I'm not able to reproduce this issue.
Thanks!
Comment #2
Refineo commentedYes, I am getting this issue on the same system after resolving the previous Preview issue.
Hmm... I will first try to reduce this issue scenario by disabling other contributed modules.
Until now I tested and I get these error messages with following modules and widget types (enabled and disabled):
Contributed Modules
Community Tags 7.x-1.x-dev
Drupal Wiki tagging suggestions (drupalwiki_tagging_suggest) 7.x-3.3
Hierarchical Select
Content Taxonomy Autocomplete
7.x-1.0-beta1+1-dev
Hierarchical Select Taxonomy Views 7.x-3.x-dev
Tagging (tagging) 7.x-3.3
Content Taxonomy 7.x-1.0-beta1+1-dev
Widget types:
Tagging module autocomplete javascript UI widget
Autocomplete term widget (tagging)
Select list
Hierarchical Select
I don't get these error messages only when selecting "None" (no tags) ,using for example Select list,
and then pressing the Preview button.
Comment #3
Refineo commentedThis issue is similar to http://drupal.org/node/1280884#comment-5825988.
Comment #4
Refineo commentedI debug the first notice message line 1443 of /***/modules/taxonomy/taxonomy.module :
the $display array:
In taxonomy.module in $display for a taxonomy_term_reference_link my system throws the notice message because there is no expected $item['tid'] defined nor $item['taxonomy_term'] in the $display array.
Comment #5
Refineo commentedFor the purpose of debugging this issue I commented out the line 7501 of common.inc causing the error message:
EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7501 of /***/includes/common.inc).I get following messages instead but at least the Preview page shows up :)
Note: I got these notices 3 times because I had 3 tags in my node.
When I test a node with 1 tag assigned I get these notices only once:
The missing bundle property exception is thrown when there is no $entity->{$info['entity keys']['bundle']} set (or there is no value in the bundle key at all).
I debugged dpm($info['entity keys']['bundle']) and in my case it is the missing bundle: 'vocabulary_machine_name'.
Then I found a D8 core issue that is potentially related here: #1054162: Taxonomy bundles not supported by EntityFieldQuery (followup).
This requires further investigation.
Comment #6
Refineo commented@bocaj , I would suggest to move this issue to Drupal Core 7.x for further investigation as I cannot find any root cause within the Content Type: Extras module.
Note to myself: here are (potentially related issues worth to investigate:
#1054162: Taxonomy bundles not supported by EntityFieldQuery (followup)
#938462: Fix EntityFieldQuery fatal error in certain cases and document bundle limitations
#1281114: Database records not deleted for Term Reference Fields after Term is Deleted
Comment #7
Refineo commentedHere are all contributed modules I used in this system
where I can find references to EntityFieldQuery (grep -r EntityFieldQuery) :
og
location_feeds
field_collection
entity_translation
entitycache
xmlsitemap
field_validation
entityreference
entity
media
cnr
migrate
maestro
I will now try to disable them one by one to find the module causing the issue.
Comment #8
Refineo commentedContributed modules I used in the systme where I can find references to EntityFieldQuery (grep -r EntityFieldQuery) :
I disabled each module , cleared all cache and tested the Preview mode:
module module status test result after clearing cache
og disabled ERROR
location_feeds disabled ERROR
field_collection disabled ERROR
entity_translation disabled ERROR
entitycache disabled ERROR
xmlsitemap disabled ERROR
field_validation disabled ERROR
entityreference disabled ERROR
media disabled ERROR
cnr (corresponding node references) disabled ERROR
migrate disabled ERROR
maestro disabled ERROR
entity (Entity API) enabled ERROR
I didn't disable Entity API until now as it has many dependencies.
For the moment I would assume the issue is either in Entity API or in Drupal Core.
Comment #9
Refineo commentedI retested with the latest Entity API 7.x-1.0-rc1+46-dev and the error persists:
Steps to reproduce:
In my setup the following error message appears:
Environment
Drupal 7.12
I reassign this to Entity API issue queue as I found issues related to EntityMalformedException there.
Maybe you can help to solve this issue ? Thanks for any feedback!
Comment #10
Refineo commentedHmm... I tested again on a fresh D7.12 install and I don't experience this issue.
I need to find out what is the issue cause anyway.
Comment #11
Refineo commentedOn the system affected I created a completely new test dataset:
ZZ_Issue_1526298_Content_Type (includes terms reference)
ZZ_Issue_1526298_Node
and I cannot reproduce the issue there.
It seems the cause for the issue is in my content type set up.
I cannot reproduce this issue for any other content type.
The affected content type has following fields:
Comment #12
Refineo commentedOK I temporarly solved this issue by deleting the field from the content type and adding the same field once again.
I could do this because I was on development environment.
However I still don't know how I would handle this if it occured on production system.
One thing I didn't think about is that the content type was migrated from another website using Features module.
I will further investigate if the content type migration could be the reason.
Comment #13
fagoThis exception is part of core, not the entity api module. Anyway, it's mostly thrown because of invalid entities being passed around. Also, I see no patch here.
Comment #14
omaster commentedAny update on this?
Comment #15
Refineo commentedI suggest to close this issue as I cannot reproduce the error anymore.
Feel free to reopen if the error still exists and you can provide steps to reproduce it.
Comment #16
pacufist commentedI faced this issue while was trying to create taxonomy term using Autocomplete term widget (tagging).
Drupal 7.18
I think we should set propertie $type somewhere in the function: taxonomy_term_save()
Because now it`s doesn`t exists.
Object $term info:
But in function entity_extract_ids() system requires type of entity.
Comment #17
pacufist commentedSorry, it`s issue not about Content Type: Extras module.
It`s but in Content Type: entity_translation_language language.
Comment #18
pacufist commented