Skip to content
Snippets Groups Projects
Commit eaac48a6 authored by Alexander Shumenko's avatar Alexander Shumenko
Browse files

Issue #3410206 by rowen92, zoltanb: Calling undefined method AjaxResponse::create() on edit

parent 37b08981
Branches 8.x-1.x
No related tags found
No related merge requests found
...@@ -92,7 +92,7 @@ class WidgetEntityBrowserController extends ControllerBase { ...@@ -92,7 +92,7 @@ class WidgetEntityBrowserController extends ControllerBase {
'resizable' => 0, '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()) { if ($form_state->getErrors()) {
$response->addCommand( $response->addCommand(
new PrependCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog', StatusMessages::renderMessages('error')) new PrependCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog', StatusMessages::renderMessages('error'))
...@@ -102,7 +102,7 @@ class WidgetEntityBrowserController extends ControllerBase { ...@@ -102,7 +102,7 @@ class WidgetEntityBrowserController extends ControllerBase {
} }
else { else {
// Return command for closing the modal. // 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. // Also refresh the widget if "details_id" is provided.
$details_id = $request->query->get('details_id'); $details_id = $request->query->get('details_id');
if (!empty($details_id)) { if (!empty($details_id)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment