Commit 5e774aa7 authored by manuel.adan's avatar manuel.adan Committed by joelpittet

Issue #3033651 by manuel.adan: AJAX forms broken after URL refactoring, string...

Issue #3033651 by manuel.adan: AJAX forms broken after URL refactoring, string expected instead of object
parent aa1ada84
......@@ -133,7 +133,7 @@ abstract class ConditionConfigure extends FormBase {
$cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name);
list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values);
$url = Url::fromRoute($route_name, $route_parameters);
$response->addCommand(new RedirectCommand($url));
$response->addCommand(new RedirectCommand($url->toString()));
$response->addCommand(new CloseModalDialogCommand());
return $response;
}
......
......@@ -113,7 +113,7 @@ abstract class ManageConditions extends FormBase {
],
];
$url = Url::fromRoute($route_name, $route_parameters, $route_options);
$content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url;
$content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url->toString();
$response = new AjaxResponse();
$response->addCommand(new OpenModalDialogCommand($this->t('Configure Required Context'), $content, array('width' => '700')));
return $response;
......
......@@ -181,7 +181,7 @@ abstract class ManageContext extends FormBase {
],
];
$url = Url::fromRoute($route_name, $route_parameters, $route_options);
$content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url;
$content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url->toString();
$response = new AjaxResponse();
$response->addCommand(new OpenModalDialogCommand($this->t('Add new context'), $content, array('width' => '700')));
return $response;
......@@ -200,7 +200,7 @@ abstract class ManageContext extends FormBase {
],
];
$url = Url::fromRoute($route_name, $route_parameters, $route_options);
$content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url;
$content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url->toString();
$response = new AjaxResponse();
$response->addCommand(new OpenModalDialogCommand($this->t('Configure Relationship'), $content, array('width' => '700')));
return $response;
......
......@@ -130,7 +130,7 @@ abstract class ManageResolverRelationships extends FormBase {
],
];
$url = Url::fromRoute($route_name, $route_parameters, $route_options);
$content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url;
$content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url->toString();
$response = new AjaxResponse();
$response->addCommand(new OpenModalDialogCommand($this->t('Configure Relationship'), $content, array('width' => '700')));
return $response;
......
......@@ -113,7 +113,7 @@ abstract class RelationshipConfigure extends FormBase {
list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values);
$response = new AjaxResponse();
$url = Url::fromRoute($route_name, $route_parameters);
$response->addCommand(new RedirectCommand($url));
$response->addCommand(new RedirectCommand($url->toString()));
$response->addCommand(new CloseModalDialogCommand());
return $response;
}
......
......@@ -142,7 +142,7 @@ abstract class ResolverRelationshipConfigure extends FormBase {
$cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name);
list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values);
$url = Url::fromRoute($route_name, $route_parameters);
$response->addCommand(new RedirectCommand($url));
$response->addCommand(new RedirectCommand($url->toString()));
$response->addCommand(new CloseModalDialogCommand());
return $response;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment