.../serialization/src/Normalizer/NormalizerBase.php | 15 ++++++++++----- .../tests/src/Kernel/NoFieldTypeNormalizersTest.php | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/modules/serialization/src/Normalizer/NormalizerBase.php b/core/modules/serialization/src/Normalizer/NormalizerBase.php index 12e79b0..3f4e482 100644 --- a/core/modules/serialization/src/Normalizer/NormalizerBase.php +++ b/core/modules/serialization/src/Normalizer/NormalizerBase.php @@ -5,6 +5,11 @@ use Drupal\Core\Cache\CacheableDependencyInterface; use Drupal\Core\Field\FieldItemInterface; use Drupal\Core\Field\FieldItemListInterface; +use Drupal\field_normalization_test\Normalization\TextItemSillyNormalizer; +use Drupal\hal\Normalizer\FieldNormalizer as HalFieldNormalizer; +use Drupal\hal\Normalizer\FieldItemNormalizer as HalFieldItemNormalizer; +use Drupal\hal\Normalizer\EntityReferenceItemNormalizer as HalEntityReferenceItemNormalizer; +use Drupal\hal\Normalizer\TimestampItemNormalizer as HalTimestampItemNormalizer; use Drupal\rest\EventSubscriber\ResourceResponseSubscriber; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Normalizer\SerializerAwareNormalizer; @@ -116,20 +121,20 @@ protected static function disallowFieldLevelNormalizers(array $supported, $norma // Generic field normalizers for both (default and 'hal') normalizations. FieldNormalizer::class, FieldItemNormalizer::class, - \Drupal\hal\Normalizer\FieldNormalizer::class, - \Drupal\hal\Normalizer\FieldItemNormalizer::class, + HalFieldNormalizer::class, + HalFieldItemNormalizer::class, // Entity reference field normalizers for both normalizations. EntityReferenceFieldItemNormalizer::class, - \Drupal\hal\Normalizer\EntityReferenceItemNormalizer::class, + HalEntityReferenceItemNormalizer::class, // The NULL normalizer allows one to prevent listed classes from ever // being normalized. By default, this is applied only tothe 'password' // field type. NullNormalizer::class, // TextItemSillyNormalizer is a test-only normalizer. - \Drupal\field_normalization_test\Normalization\TextItemSillyNormalizer::class, + TextItemSillyNormalizer::class, // TimestampItemNormalizer is being deprecated in https://www.drupal.org/project/drupal/issues/2926508. TimestampItemNormalizer::class, - \Drupal\hal\Normalizer\TimestampItemNormalizer::class, + HalTimestampItemNormalizer::class, ]; $is_disallowed = function ($name) { diff --git a/core/modules/serialization/tests/src/Kernel/NoFieldTypeNormalizersTest.php b/core/modules/serialization/tests/src/Kernel/NoFieldTypeNormalizersTest.php index 8358837..e65a841 100644 --- a/core/modules/serialization/tests/src/Kernel/NoFieldTypeNormalizersTest.php +++ b/core/modules/serialization/tests/src/Kernel/NoFieldTypeNormalizersTest.php @@ -1,6 +1,6 @@