- Issue created by @hannakras
- π©πͺGermany lmoeni
I'm having the same issue that you described but for me it's when I reference a paragraph.
I'm using the Paragraphs module and changed the entity reference form display to "Inline entity form - Complex".When I edit the entity reference field I get a AJAX error and this is what appears in the log:
TypeError: menu_ui_node_builder(): Argument #2 ($entity) must be of type Drupal\\node\\NodeInterface, Drupal\\paragraphs\\Entity\\Paragraph given in menu_ui_node_builder() (line 311 of core/modules/menu_ui/menu_ui.module). call_user_func_array('menu_ui_node_builder', Array) (Line: 307)\nDrupal\\Core\\Entity\\EntityForm->buildEntity(Array, Object) (Line: 155)\nDrupal\\Core\\Entity\\ContentEntityForm->buildEntity(Array, Object) (Line: 186)\nDrupal\\Core\\Entity\\ContentEntityForm->validateForm(Array, Object)\ncall_user_func_array(Array, Array) (Line: 82)\nDrupal\\Core\\Form\\FormValidator->executeValidateHandlers(Array, Object) (Line: 275)\nDrupal\\Core\\Form\\FormValidator->doValidateForm(Array, Object, 'node_normal_page_edit_form') (Line: 118)\nDrupal\\Core\\Form\\FormValidator->validateForm('node_normal_page_edit_form', Array, Object) (Line: 593)\nDrupal\\Core\\Form\\FormBuilder->processForm('node_normal_page_edit_form', Array, Object) (Line: 325)\nDrupal\\Core\\Form\\FormBuilder->buildForm(Object, Object) (Line: 73)\nDrupal\\Core\\Controller\\FormController->getContentResult(Object, Object)\ncall_user_func_array(Array, Array) (Line: 123)\nDrupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}() (Line: 583)\nDrupal\\Core\\Render\\Renderer->executeInRenderContext(Object, Object) (Line: 124)\nDrupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)\nDrupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}() (Line: 166)\nSymfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object, 1) (Line: 74)\nSymfony\\Component\\HttpKernel\\HttpKernel->handle(Object, 1, 1) (Line: 58)\nDrupal\\Core\\StackMiddleware\\Session->handle(Object, 1, 1) (Line: 48)\nDrupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object, 1, 1) (Line: 106)\nDrupal\\page_cache\\StackMiddleware\\PageCache->pass(Object, 1, 1) (Line: 85)\nDrupal\\page_cache\\StackMiddleware\\PageCache->handle(Object, 1, 1) (Line: 48)\nDrupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)\nDrupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)\nDrupal\\Core\\StackMiddleware\\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)\nDrupal\\Core\\DrupalKernel->handle(Object) (Line: 19)\n", name: "AjaxError", stack: "@https://nrwgov.ddev.site/core/misc/ajax.js?v=10.1.2:196:32\n@https://nrwgov.ddev.site/core/misc/ajax.js?v=10.1.2:1889:3\n" } ajax.js:196:32
This is not occuring when I create the entity reference.
I can also confirm that this did not occur in 2.0.0-rc6 and seems to be releated to the changes in: https://www.drupal.org/project/inline_entity_form/issues/3375555 β¨ Add a FieldFormatter to display rendered menu Postponed
- π³πΏNew Zealand john pitcairn
It's likely this is due to IEF now calling
hook_entity_prepare_form()
. There are a couple of other related issues:
π Parent form entity builders run on IEF resulting in fatal errors Active
π Error when referencing a non-revisioned entity in IEF on a revisioned edit form Active