From eaac48a6cdccde8d3a19ef3a171ff586b65a40d0 Mon Sep 17 00:00:00 2001 From: Alexander Shumenko <lexander.shumenko@gmail.com> Date: Thu, 15 Aug 2024 15:38:17 +0200 Subject: [PATCH] Issue #3410206 by rowen92, zoltanb: Calling undefined method AjaxResponse::create() on edit --- .../src/Controller/WidgetEntityBrowserController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/widget_engine_entity_form/src/Controller/WidgetEntityBrowserController.php b/modules/widget_engine_entity_form/src/Controller/WidgetEntityBrowserController.php index 62e8549..8ad7451 100644 --- a/modules/widget_engine_entity_form/src/Controller/WidgetEntityBrowserController.php +++ b/modules/widget_engine_entity_form/src/Controller/WidgetEntityBrowserController.php @@ -92,7 +92,7 @@ class WidgetEntityBrowserController extends ControllerBase { 'resizable' => 0, ]; } - $response = AjaxResponse::create()->addCommand(new OpenDialogCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog', $title, $form, $options)); + $response = (new AjaxResponse())->addCommand(new OpenDialogCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog', $title, $form, $options)); if ($form_state->getErrors()) { $response->addCommand( new PrependCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog', StatusMessages::renderMessages('error')) @@ -102,7 +102,7 @@ class WidgetEntityBrowserController extends ControllerBase { } else { // Return command for closing the modal. - $response = AjaxResponse::create()->addCommand(new CloseDialogCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog')); + $response = (new AjaxResponse())->addCommand(new CloseDialogCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog')); // Also refresh the widget if "details_id" is provided. $details_id = $request->query->get('details_id'); if (!empty($details_id)) { -- GitLab