diff --cc core/modules/shortcut/shortcut.module index 601a149,51a6f4b..0000000 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@@ -297,8 -297,11 +297,8 @@@ function shortcut_preprocess_page(&$var // we do not want to display it on "access denied" or "page not found" // pages). if (shortcut_set_edit_access()->isAllowed() && !\Drupal::request()->attributes->has('exception')) { - $link = current_path(); + $link = \Drupal::routeMatch()->getUrl()->toString(); - if (!($url = \Drupal::pathValidator()->getUrlIfValid($link))) { - // Bail out early if we couldn't find a matching route. - return; - } + $route_match = \Drupal::routeMatch(); $query = array( 'link' => $link, diff --git a/core/lib/Drupal/Core/Render/Element/RenderElement.php b/core/lib/Drupal/Core/Render/Element/RenderElement.php index a621234..bd30b47 100644 --- a/core/lib/Drupal/Core/Render/Element/RenderElement.php +++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php @@ -249,10 +249,12 @@ public static function preRenderAjaxForm($element) { } // Change path to URL. - $settings['url'] = NULL; if (isset($settings['url']) && $settings['url'] instanceof Url) { $settings['url'] = $settings['url']->setOptions($settings['options'])->toString(); } + else { + $settings['url'] = NULL; + } unset($settings['options']); // Add special data to $settings['submit'] so that when this element diff --git a/core/modules/file/src/Element/ManagedFile.php b/core/modules/file/src/Element/ManagedFile.php index 75bd1a4..34c20e8 100644 --- a/core/modules/file/src/Element/ManagedFile.php +++ b/core/modules/file/src/Element/ManagedFile.php @@ -145,7 +145,7 @@ public static function processManagedFile(&$element, FormStateInterface $form_st $element['#tree'] = TRUE; $ajax_settings = [ - 'path' => 'file/ajax', + 'url' => Url::fromRoute('file.ajax_upload'), 'options' => [ 'query' => [ 'element_parents' => implode('/', $element['#array_parents']), diff --git a/core/modules/system/system.module b/core/modules/system/system.module index cb9aa7f..5b8c4ba 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -240,7 +240,12 @@ function system_hook_info() { * Implements hook_theme_suggestions_HOOK(). */ function system_theme_suggestions_html(array $variables) { - $path_args = explode('/', Url::fromRoute('')->getInternalPath()); + if (\Drupal::service('path.matcher')->isFrontPage()) { + $path_args = ['']; + } + else { + $path_args = explode('/', Url::fromRoute('')->getInternalPath()); + } return theme_get_suggestions($path_args, 'html'); } @@ -248,7 +253,12 @@ function system_theme_suggestions_html(array $variables) { * Implements hook_theme_suggestions_HOOK(). */ function system_theme_suggestions_page(array $variables) { - $path_args = explode('/', Url::fromRoute('')->getInternalPath()); + if (\Drupal::service('path.matcher')->isFrontPage()) { + $path_args = ['']; + } + else { + $path_args = explode('/', Url::fromRoute('')->getInternalPath()); + } return theme_get_suggestions($path_args, 'page'); } diff --git a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php index 6883d16..9f4558b 100644 --- a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php @@ -8,7 +8,6 @@ namespace Drupal\views_ui\Form\Ajax; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Routing\RouteMatch; use Drupal\Core\Url; use Drupal\views\ViewStorageInterface; use Drupal\views\ViewExecutable;