Loading core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php +5 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,11 @@ protected function applyLibrariesExtend($extension, $library_name, $library_defi $libraries_extend = $this->themeManager->getActiveTheme()->getLibrariesExtend(); if (!empty($libraries_extend["$extension/$library_name"])) { foreach ($libraries_extend["$extension/$library_name"] as $library_extend_name) { if (isset($library_definition['deprecated'])) { $extend_message = sprintf('Theme "%s" is extending a deprecated library.', $extension); $library_deprecation = str_replace('%library_id%', "$extension/$library_name", $library_definition['deprecated']); @trigger_error("$extend_message $library_deprecation", E_USER_DEPRECATED); } if (!is_string($library_extend_name)) { // Only string library names are allowed. throw new InvalidLibrariesExtendSpecificationException('The libraries-extend specification for each library must be a list of strings.'); Loading core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php +5 −0 Original line number Diff line number Diff line Loading @@ -382,6 +382,11 @@ protected function applyLibrariesOverride($libraries, $extension) { foreach ($libraries as $library_name => $library) { // Process libraries overrides. if (isset($libraries_overrides["$extension/$library_name"])) { if (isset($library['deprecated'])) { $override_message = sprintf('Theme "%s" is overriding a deprecated library.', $extension); $library_deprecation = str_replace('%library_id%', "$extension/$library_name", $library['deprecated']); @trigger_error("$override_message $library_deprecation", E_USER_DEPRECATED); } // Active theme defines an override for this library. $override_definition = $libraries_overrides["$extension/$library_name"]; if (is_string($override_definition) || $override_definition === FALSE) { Loading core/modules/system/tests/modules/theme_test/theme_test.libraries.yml +14 −0 Original line number Diff line number Diff line Loading @@ -5,3 +5,17 @@ theme_stylesheets_override_and_remove_test: css/base-remove.css: {} css/sub-override.css: {} css/sub-remove.css: {} deprecated_library: version: VERSION css: base: css/foo.css: {} deprecated: 'The "%library_id%" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com' another_deprecated_library: version: VERSION css: base: css/bar.css: {} deprecated: 'The "%library_id%" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com' core/modules/system/tests/themes/test_legacy_theme/test_legacy_theme.info.yml +10 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,13 @@ description: 'Test theme to test deprecated functionality.' version: VERSION package: Testing base theme: test_theme libraries-override: theme_test/deprecated_library: css: base: css/foo.css: css/bar.css libraries-extend: theme_test/another_deprecated_library: - test_legacy_theme/library core/modules/system/tests/themes/test_legacy_theme/test_legacy_theme.libraries.yml 0 → 100644 +4 −0 Original line number Diff line number Diff line library: css: base: css/baz.css: {} Loading
core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php +5 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,11 @@ protected function applyLibrariesExtend($extension, $library_name, $library_defi $libraries_extend = $this->themeManager->getActiveTheme()->getLibrariesExtend(); if (!empty($libraries_extend["$extension/$library_name"])) { foreach ($libraries_extend["$extension/$library_name"] as $library_extend_name) { if (isset($library_definition['deprecated'])) { $extend_message = sprintf('Theme "%s" is extending a deprecated library.', $extension); $library_deprecation = str_replace('%library_id%', "$extension/$library_name", $library_definition['deprecated']); @trigger_error("$extend_message $library_deprecation", E_USER_DEPRECATED); } if (!is_string($library_extend_name)) { // Only string library names are allowed. throw new InvalidLibrariesExtendSpecificationException('The libraries-extend specification for each library must be a list of strings.'); Loading
core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php +5 −0 Original line number Diff line number Diff line Loading @@ -382,6 +382,11 @@ protected function applyLibrariesOverride($libraries, $extension) { foreach ($libraries as $library_name => $library) { // Process libraries overrides. if (isset($libraries_overrides["$extension/$library_name"])) { if (isset($library['deprecated'])) { $override_message = sprintf('Theme "%s" is overriding a deprecated library.', $extension); $library_deprecation = str_replace('%library_id%', "$extension/$library_name", $library['deprecated']); @trigger_error("$override_message $library_deprecation", E_USER_DEPRECATED); } // Active theme defines an override for this library. $override_definition = $libraries_overrides["$extension/$library_name"]; if (is_string($override_definition) || $override_definition === FALSE) { Loading
core/modules/system/tests/modules/theme_test/theme_test.libraries.yml +14 −0 Original line number Diff line number Diff line Loading @@ -5,3 +5,17 @@ theme_stylesheets_override_and_remove_test: css/base-remove.css: {} css/sub-override.css: {} css/sub-remove.css: {} deprecated_library: version: VERSION css: base: css/foo.css: {} deprecated: 'The "%library_id%" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com' another_deprecated_library: version: VERSION css: base: css/bar.css: {} deprecated: 'The "%library_id%" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com'
core/modules/system/tests/themes/test_legacy_theme/test_legacy_theme.info.yml +10 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,13 @@ description: 'Test theme to test deprecated functionality.' version: VERSION package: Testing base theme: test_theme libraries-override: theme_test/deprecated_library: css: base: css/foo.css: css/bar.css libraries-extend: theme_test/another_deprecated_library: - test_legacy_theme/library
core/modules/system/tests/themes/test_legacy_theme/test_legacy_theme.libraries.yml 0 → 100644 +4 −0 Original line number Diff line number Diff line library: css: base: css/baz.css: {}