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
No related branches found
No related tags found
No related merge requests found
......@@ -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)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment