diff --git a/core/modules/file/tests/src/Functional/Hal/FileHalJsonAnonTest.php b/core/modules/file/tests/src/Functional/Hal/FileHalJsonAnonTest.php index ca4fcf551af..f90b57ecbe5 100644 --- a/core/modules/file/tests/src/Functional/Hal/FileHalJsonAnonTest.php +++ b/core/modules/file/tests/src/Functional/Hal/FileHalJsonAnonTest.php @@ -119,6 +119,9 @@ class FileHalJsonAnonTest extends FileResourceTestBase { /** * @see hal_update_8501() + * + * @group legacy + * @expectedDeprecation Replacing the file uri with the URL is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the provided url property instead and disable hal.settings:bc_file_uri_as_url_normalizer. See https://www.drupal.org/node/2925783 */ public function testGetBcUriField() { $this->config('hal.settings')->set('bc_file_uri_as_url_normalizer', TRUE)->save(TRUE); diff --git a/core/modules/hal/hal.services.yml b/core/modules/hal/hal.services.yml index d4e90ccef30..34aaf6581c0 100644 --- a/core/modules/hal/hal.services.yml +++ b/core/modules/hal/hal.services.yml @@ -14,7 +14,6 @@ services: - { name: normalizer, priority: 10 } serializer.normalizer.file_entity.hal: class: Drupal\hal\Normalizer\FileEntityNormalizer - deprecated: 'The "%service_id%" normalizer service is deprecated: it is obsolete, it only remains available for backwards compatibility.' arguments: ['@entity_type.manager', '@hal.link_manager', '@module_handler', '@config.factory', '@entity_type.repository', '@entity_field.manager'] tags: - { name: normalizer, priority: 20 } diff --git a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php index ac219015f8b..94e1e0bc813 100644 --- a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php +++ b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php @@ -14,7 +14,7 @@ use Drupal\hal\LinkManager\LinkManagerInterface; /** * Converts the Drupal entity object structure to a HAL array structure. * - * @deprecated in drupal:8.5.0 and is removed from drupal:9.0.0. + * @internal */ class FileEntityNormalizer extends ContentEntityNormalizer { @@ -61,6 +61,8 @@ class FileEntityNormalizer extends ContentEntityNormalizer { /** * {@inheritdoc} + * + * @deprecated in drupal:8.5.0 and is removed from drupal:9.0.0. */ public function normalize($entity, $format = NULL, array $context = []) { $data = parent::normalize($entity, $format, $context); @@ -70,6 +72,7 @@ class FileEntityNormalizer extends ContentEntityNormalizer { if ($this->halSettings->get('bc_file_uri_as_url_normalizer')) { // Replace the file url with a full url for the file. $data['uri'][0]['value'] = $this->getEntityUri($entity); + @trigger_error("Replacing the file uri with the URL is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the provided url property instead and disable hal.settings:bc_file_uri_as_url_normalizer. See https://www.drupal.org/node/2925783", E_USER_DEPRECATED); } return $data; diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php index a046cebb708..1870d05ebe9 100644 --- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php @@ -141,7 +141,6 @@ trait DeprecationListenerTrait { public static function getSkippedDeprecations() { return [ 'Passing in arguments the legacy way is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Provide the right parameter names in the method, similar to controllers. See https://www.drupal.org/node/2894819', - 'The "serializer.normalizer.file_entity.hal" normalizer service is deprecated: it is obsolete, it only remains available for backwards compatibility.', 'The Symfony\Component\ClassLoader\ApcClassLoader class is deprecated since Symfony 3.3 and will be removed in 4.0. Use `composer install --apcu-autoloader` instead.', // The following deprecation is not triggered by DrupalCI testing since it // is a Windows only deprecation. Remove when core no longer uses