Commit ad6eb723 authored by catch's avatar catch
Browse files

fix: #3557531...

fix: #3557531 \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::setUp() can trigger deprecations on PHP 8.5

By: @alexpott
By: @andypost
(cherry picked from commit 25d7a54c)
parent 53e4eb66
Loading
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -227,10 +227,12 @@ protected function setUp(): void {
        ->setTranslatable(FALSE)
        ->save();

      $entity_id = $this->entity->id();
      // Some entity types have no ID, hence they cannot be reloaded.
      if ($entity_id !== NULL) {
        // Reload entity so that it has the new field.
      $reloaded_entity = $this->entityStorage->loadUnchanged($this->entity->id());
      // Some entity types are not stored, hence they cannot be reloaded.
      if ($reloaded_entity !== NULL) {
        $reloaded_entity = $this->entityStorage->loadUnchanged($entity_id);

        $this->entity = $reloaded_entity;

        // Set a default value on the fields.