diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 3919ec2..b699af9 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -25,7 +25,6 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Render\Element; use Drupal\Core\Url; -use Drupal\Core\Utility\Error; use Symfony\Component\HttpFoundation\Request; /** @@ -1037,9 +1036,6 @@ function template_preprocess_links(&$variables) { $item['link'] = $link_element; } - if (isset($link['href'])) { - throw new \Exception('href: ' . $link['href'] . "\n" . Error::formatBacktrace(debug_backtrace())); - } // Handle title-only text items. $text = (!empty($link['html']) ? $link['title'] : String::checkPlain($link['title'])); diff --git a/core/lib/Drupal/Core/Render/Element/Link.php b/core/lib/Drupal/Core/Render/Element/Link.php index c3d58b6..198c34d 100644 --- a/core/lib/Drupal/Core/Render/Element/Link.php +++ b/core/lib/Drupal/Core/Render/Element/Link.php @@ -8,9 +8,7 @@ namespace Drupal\Core\Render\Element; use Drupal\Component\Utility\NestedArray; -use Drupal\Component\Utility\String; use Drupal\Core\Url as UrlObject; -use Drupal\Core\Utility\Error; /** * Provides a link render element. @@ -89,12 +87,6 @@ public static function preRenderLink($element) { $element['#route_parameters'] = empty($element['#route_parameters']) ? array() : $element['#route_parameters']; $element['#markup'] = \Drupal::l($element['#title'], new UrlObject($element['#route_name'], $element['#route_parameters'], $element['#options'])); } - elseif (isset($element['#href'])) { - throw new \Exception('#href: ' . $element['#href'] . "\n" . Error::formatBacktrace(debug_backtrace())); - } - else { - throw new \InvalidArgumentException(String::format('Missing #url, #route_name, or #href for @title', ['@title' => $element['#title']])); - } return $element; }