While trying to create new Drupal Commerce product entities with the Inline entity form module I started receiving the following AJAX error:
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7501 of /home/xxx/websites/xxx/includes/common.inc)
![]()
I also ran into the same error after importing an older dump of the database. In that case I was unable to edit a view. Instead on loading the view settings I got the same error message.
The issue http://drupal.org/node/1277376 suggest that it is a contrib module bug causing this error. In my case the module causing the error seems to be Title. Uninstalling Title and clearing caches makes the error go away.
The reason for the error is quite vague for me so I might be mistaking and Title could not be the culprit at all...
EDIT:
Tried with a clean install. Enabled "Title", "Inline Entity Form". Also had to enable "drupal Commerce" to get a product reference where I could use the "inline entity form". Had exactly the same error. Uninstalling "title" made the error go away.
| Comment | File | Size | Author |
|---|---|---|---|
| bundle.png | 17.74 KB | ranx |
Comments
Comment #1
garrettc commentedTo confirm that I'm seeing this too. Using a combination of
when trying to create new commerce products from the display node edit screen.
Disabling Title stops the error happening.
I'm going to try and dig through the module and see what might be tripping the error.
Comment #2
crizI can confirm this issue using latest title and inline_entity_form.
Comment #3
estepix commentedSame problem here, using:
Drupal 7.14
Title 7.x-1.0-alpha
Inline Entity Form 7.x-1.0-beta1
Commerce 7.x-1.3
Comment #4
dimitriseng commentedSame problem here with modules as in #1 , would be great to get it fixed as it prevents new Commerce products to be created using the Inline Entity Form module, thank you.
Comment #5
estepix commentedI just enabled krumo backtrace and got a hell of an output, can't make much sense of it right now but I leave it here in case it is of any use:
Comment #6
estepix commentedThe error shown in my previous comment:
ResponseText: Notice: Undefined property: stdClass::$language in getLanguage() (line 33 of /var/www/example.com/sites/all/modules/contrib/commerce/modules/product/includes/commerce_product.translation_handler.inc). =>Seems to come from:
title.module line 462
using: Title 7.x-1.0-alpha
line 462:
Doesn't retrieve the language code and throws the error shown above. However this error doesn't seem to be fatal, so the code keeps running.
Line 473:
return !empty($langcode) ? $langcode : LANGUAGE_NONE;Returns either a retrieved language code or none, represented in Drupal as "und" (undefined).
Just to give it a try, since line 462 will always return "und" as the product variation hasn't been created yet, I have changed this line to:
Which throws a new error:
This error comes from Inline Entity Form and it seems that this module does not take into account the modifications the Title module implements in the title field to work its magic.
If we check line 280 in sites/all/modules/contrib/inline_entity_form/includes/commerce_product.type.inc
It checks whether the title exists or it must be autogenerated with the form values, however it assumes a default title ($form_state['values']['title'];) is in use but does not take into consideration an altered title which behaves more like a field: $form_state['values']['title_field']['und'][0]['value'];
Now if we change line 280 with:
And try to save the product variation again, we get yet another error:
And this is as far as I can go for I had to change code from the Drupal core.
I have been checking what the undefined index: path should look like and it seems to be an array along the lines of:
Comment #7
estepix commentedAccording to this post:
http://drupal.org/node/1277376#comment-5010896
These errors are normal behaviour since Drupal Core 7.8 when the error validation became more strict. However there must be a way to fix Title and Inline Entity Form to work together and pass this new validation standard.
Comment #8
dreizwo commentedI got the same error but I think this is not a title bug.
The CommerceProductEntityController should create a default property for language
@see commerce_product.controller.inc
additional the property should be defined in commerce_product.info.inc
@see http://drupal.org/node/1021466 for further information
This should provide default setter and getter methods through entity_metadata_wrapper for the language column.
Comment #9
ymakux commentedfaced the same trouble
My error is a bit different:
Comment #10
ymakux commentedA weird problem. Title+Inline Entity Form used in Commerce Kickstart 2 and seems work fine. I took Title 7.x-1.0-alpha4+6-dev from the Commerce Kickstart - nothing has changed. Also I tried to disable the Inline Entity Form - error remains
Comment #11
chromix commentedI'm seeing the same error as ymakux, but only when Title is enabled. Stranger still, this happens only on the edit form for Basic Page, which coincidentally doesn't have Title enabled, but DOES include Taxonomy reference fields.
Comment #12
plachI think this might be related to #1851118: Incorrect ET Handler set in node/add form when inserting new taxonomy term. Please let me know whether the patch over there fixes this issue.
Comment #13
jpsolero commentedIf using module term_reference_tree also related to:
http://drupal.org/node/1595358#comment-6905240
Patch in #9 solved my problem.
Comment #14
ymakux commented@plach: latest dev (2013-Jan-04 ) of Entity Translation which contains that patch didn't solve my problem
Comment #15
ymakux commentedsolved!
My own module caused that error :) the "vocabulary_machine_name" property was missed in term object
Comment #16
plachSince this was originally about IEF integration and that should be solved now on the IEF side, I'll close this. AAMOF other apparently unrelated bug reports (although the error is the same) have been posted here, which is making this issue hard to follow. Please open new ones if you can track down your problem and find that Title is responsible for it.
Comment #16.0
plachTested with clean install
Comment #17
mattew commentedI encounter the same issue.
As you could have test it on a fresh install and successfully reproduce the bug, maybe it's time to re-open this issue and try to fix it...?
Title module usage is mandatory for a multi-lingual website with ET, this error is Major for users who would like to use Title with Inline Entity Form.
N.B.: I get the error even if the title is not "replaced" by the translatable field_title for a content type inserted using IEF. And most of my content types that I would like to use with IEF do not use ET at all, but I need Title module and ET for other content types.