diff --git a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php index b4d51cf617..c2d65bfdbc 100644 --- a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php +++ b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php @@ -82,9 +82,9 @@ public function normalize($field_item, $format = NULL, array $context = []) { // Normalize the target entity. $embedded = $this->serializer->normalize($target_entity, $format, $context); - // @todo $embedded can be NULL - this breaks PHP 7.4 testing. Using the null - // coalescence operator fixes - // Drupal\Tests\node\Functional\Hal\NodeHalJsonAnonTest for example. + // @todo https://www.drupal.org/project/drupal/issues/3110815 $embedded will + // be NULL if the target entity does not exist. Use null coalescence + // operator to preserve behaviour in PHP 7.4. $link = $embedded['_links']['self'] ?? NULL; // If the field is translatable, add the langcode to the link relation // object. This does not indicate the language of the target entity. diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php index 75e38fe35a..07e3ea64b4 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php @@ -61,11 +61,7 @@ public function testArgumentValidatorTerm() { $view->initHandlers(); // Test the single validator for term IDs. - // @todo $view->argument['tid']->validator should be defined, but it's not - // here and that's leading to test failures in PHP 7.4. Figure out a more - // robust solution rather than creating the stdClass object in the test. - $view->argument['tid']->validator = new \stdClass(); - $view->argument['tid']->validator->options['type'] = 'tid'; + $view->argument['tid']->options['validate_options']['multiple'] = 0; // Pass in a single valid term. foreach ($this->terms as $term) { @@ -82,7 +78,7 @@ public function testArgumentValidatorTerm() { $view->argument['tid']->argument_validated = NULL; // Test the multiple validator for term IDs. - $view->argument['tid']->validator->options['type'] = 'tids'; + $view->argument['tid']->options['validate_options']['multiple'] = 1; $view->argument['tid']->options['break_phrase'] = TRUE; // Pass in a single term.