diff --git a/core/lib/Drupal/Core/Render/Element/RenderElement.php b/core/lib/Drupal/Core/Render/Element/RenderElement.php index a257ea4..6bb9206 100644 --- a/core/lib/Drupal/Core/Render/Element/RenderElement.php +++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php @@ -237,8 +237,9 @@ public static function preRenderAjaxForm($element) { // One such substantial difference is form elements that use // #ajax['callback'] for determining which part of the form needs // re-rendering. For that, we have a special 'system/ajax' route. + $route_match = \Drupal::routeMatch(); $settings += array( - 'url' => isset($settings['callback']) ? Url::fromRoute('system.ajax') : NULL, + 'url' => isset($settings['callback']) ? Url::fromRoute($route_match->getRouteName(), $route_match->getRawParameters()->all()) : NULL, 'options' => array(), 'dialogType' => 'ajax', );