Commit 53e4eb66 authored by catch's avatar catch
Browse files

fix: #3557584...

fix: #3557584 \Drupal\Tests\jsonapi\Functional\ResourceTestBase::resaveEntity() can trigger deprecations on PHP 8.5

By: @alexpott
By: @andypost
(cherry picked from commit 6d7864ef)
parent f9408cef
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -333,9 +333,10 @@ protected function setUpFields(EntityInterface $entity, UserInterface $account):
   */
  protected function resaveEntity(EntityInterface $entity, AccountInterface $account): EntityInterface {
    // Reload entity so that it has the new field.
    $reloaded_entity = $this->entityLoadUnchanged($entity->id());
    $entity_id = $entity->id();
    // Some entity types are not stored, hence they cannot be reloaded.
    if ($reloaded_entity !== NULL) {
    if ($entity_id !== NULL) {
      $reloaded_entity = $this->entityLoadUnchanged($entity_id);
      $entity = $reloaded_entity;
      // Set a default value on the fields.
      $entity->set('field_rest_test', ['value' => 'All the faith he had had had had no effect on the outcome of his life.']);