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.
When uninstalling my module with a custom entity I receive the following error:
Notice: Undefined index: image_moderate in dynamic_entity_reference_entity_bundle_delete() (line 39 of modules/contrib/dynamic_entity_reference/dynamic_entity_reference.module).
dynamic_entity_reference_entity_bundle_delete('image_moderate', 'image_moderate')
call_user_func_array('dynamic_entity_reference_entity_bundle_delete', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_bundle_delete', Array) (Line: 84)
Drupal\Core\Entity\EntityBundleListener->onBundleDelete('image_moderate', 'image_moderate') (Line: 625)
Drupal\Core\Entity\EntityManager->onBundleDelete('image_moderate', 'image_moderate') (Line: 389)
Drupal\Core\Extension\ModuleInstaller->uninstall(Array, 1) (Line: 91)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall(Array) (Line: 160)
Drupal\system\Form\ModulesUninstallConfirmForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 585)
Drupal\Core\Form\FormBuilder->processForm('system_modules_uninstall_confirm_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm('system_modules_uninstall_confirm_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
But I do not use Dynamic Entity Reference for this module / entity.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2938075-7.patch | 849 bytes | jibran |
| |||
#7 | 2914503-8.patch | 676 bytes | jibran |
Comments
Comment #2
jibranThanks for creating the issue. Can you please try this patch?
Comment #3
jibranComment #5
jibranIgnore 2.x fails. HEAD is failing.
Comment #6
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedIs
$ids
really empty in the buggy code path? It enters forforeach
which implies there are some values to me. The issue as I'm reading it is, there are no handler settings inside the loaded field for that entity type. If we're already checking if the handler settings exist, simply shuffling this around should work too, no?Comment #7
jibranNice catch! I always confuse NULL with an empty array with these loadMultiple. I totally misread the logic and backtrace. Here is the updated patch.
Comment #9
jibranArghhh!
Comment #10
acbramley CreditAttribution: acbramley at PreviousNext commentedLGTM!
Comment #13
jibranThanks, for the review c/p to 1.x and 2.x.