- Issue created by @hazuzoo
- Status changed to Needs review
over 1 year ago 7:35am 25 August 2023 - 🇺🇸United States nsciacca
I got a similar error with Views Bulk Operations:
Error: Call to undefined method Drupal\views_bulk_operations\Form\ConfigureAction::getEntity() in Drupal\rabbit_hole\Plugin\Field\FieldWidget\RabbitHoleDefaultWidget->formElement() (line 168 of modules/contrib/rabbit_hole/src/Plugin/Field/FieldWidget/RabbitHoleDefaultWidget.php).
Adding the below check to the top of the formElement function works for my instance.
if (!method_exists($form_state->getFormObject(), 'getEntity')) { return; }
- 🇮🇳India ayush.pandey
Hi, the issue seems to not reproducible. I tried the module version 2.0.0-alpha5 with drupal 10.1 and the node gets saved successfully with the media entity. Please check once, and add complete steps if its still reproducible .
- 🇫🇷France karimbou
Having this issue on production Drupal 9.5.x and rabbit_hole 2.0.0-alpha5
Creating a new article and trying to open entity browser through a paragraph (popup entity browser show the error)The website encountered an unexpected error. Please try again later. Error: Call to undefined method Drupal\entity_browser\Form\EntityBrowserForm::getEntity() in Drupal\rabbit_hole\Plugin\Field\FieldWidget\RabbitHoleDefaultWidget->formElement() (line 151 of modules/contrib/rabbit_hole/src/Plugin/Field/FieldWidget/RabbitHoleDefaultWidget.php). Drupal\rabbit_hole\Plugin\Field\FieldWidget\RabbitHoleDefaultWidget->formElement(Object, 0, Array, Array, Object) (Line: 353) Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 220) Drupal\Core\Field\WidgetBase->formMultipleElements(Object, Array, Object) (Line: 111) Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 183) Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 190) Drupal\inline_entity_form\Form\EntityInlineForm->entityForm(Array, Object) (Line: 152) Drupal\inline_entity_form\Element\InlineEntityForm::processEntityForm(Array, Object, Array) call_user_func_array(Array, Array) (Line: 1012) Drupal\Core\Form\FormBuilder->doBuildForm('entity_browser_entity_browser_images_form', Array, Object) (Line: 1075) Drupal\Core\Form\FormBuilder->doBuildForm('entity_browser_entity_browser_images_form', Array, Object) (Line: 1075) Drupal\Core\Form\FormBuilder->doBuildForm('entity_browser_entity_browser_images_form', Array, Object) (Line: 579) Drupal\Core\Form\FormBuilder->processForm('entity_browser_entity_browser_images_form', Array, Object) (Line: 325) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580) 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}() (Line: 169) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- last update
over 1 year ago 24 pass - 🇫🇷France karimbou
To avoid some warnings on $form['#type'] array key, that might not exist i've added an isset to the patch.
- last update
over 1 year ago 24 pass - last update
over 1 year ago 24 pass - last update
over 1 year ago 24 pass - 🇧🇾Belarus alexdoma
patch #6 now working for me
i have get code from https://www.drupal.org/project/hide_revision_field → module and its helps for me
drupal 10.1.3 - last update
over 1 year ago 24 pass - 🇪🇸Spain JulianVJ
Not able to reproduce this issue on Drupal 10.1.9 with RabiitHole 2.0.0-alpha5 and Entity Browser 2.10.
This seems to be a very special use case or applicable onty to Drupal 9 - 🇺🇸United States philip_stier Denver, Colorado
I was also getting this exact same error with Entity Browser. #6 worked for me. Drupal 10.1.7
- Status changed to RTBC
5 months ago 8:01am 20 August 2024 - 🇧🇪Belgium andreasderijcke Antwerpen / Gent
Still a problem for 2.0.0-alpha5 in combination with
- core 10.3.x
- views_bulk_operations → 4.2.7 (i know it's not the recommended version anymore)
- 🇺🇸United States Greg Boggs Portland Oregon
After applying #6 in Drupal 10.3, I get a new error when applying a modify data VBO action.
Error: Call to a member function getEntityTypeId() on null in Drupal\rabbit_hole\Plugin\Field\FieldWidget\RabbitHoleDefaultWidget->formElement() (line 166 of modules/contrib/rabbit_hole/src/Plugin/Field/FieldWidget/RabbitHoleDefaultWidget.php).