Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have installed this module today and whenever I try to save a content type which contains an entityreference I receive the following error.
Does anyone know how I can solve this?
EntityMalformedException: Permission to create a node was requested but no node type was given. in entity_metadata_no_hook_node_access() (line 665 of /sites/all/modules/entity/modules/callbacks.inc).
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedI think I already found the problem.
My entity reference field doesn't use the Simple mode, but the Views mode. It does work when Simple mode is selected.
Is there a workaround to make this work?
Comment #2
devtherock CreditAttribution: devtherock commentedI am too getting this error, its not only while creating content but this error also comes up when one try to edit fields. Anyone solved this issue, please share here.
Comment #3
highkb CreditAttribution: highkb commentedI found the patch #319 to solve the problem on my page
https://drupal.org/node/1780646?page=1
Hope this helps.
Comment #4
devtherock CreditAttribution: devtherock commentedThanks for the URL, checked #315 and made changes in "references_dialog.dialog_widgets.inc" in line number 225 because this line was fetching error, $bundle as string was passed in entity_access instead of object in. Below is the quick snippet of my code.
Now node edit/create and field edit working without any error.
Comment #5
JvE CreditAttribution: JvE commentedDuplicate of #1780626: Entity Reference incorrectly calls entity_access() which is already solved.
Update to the latest dev version or wait for a new stable release.
Do not follow highkb's advice, that will introduce silent access check failures.