In some case original is not set and should be checked

Created on 15 November 2021, almost 3 years ago
Updated 19 July 2023, about 1 year ago

Problem/Motivation

When saving programmatically a node containing file fields, I some occasion, I got a WSOD due to the following code in FileFieldItemList.php::postSave()

      $original = $entity->original;
      if ($original->hasTranslation($langcode)) {
        ...
        }
      }

Steps to reproduce

Difficult to say... maybe linked to the revision feature

Proposed resolution

Check if $original is set

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
File systemΒ  β†’

Last updated about 6 hours ago

Created by

πŸ‡§πŸ‡ͺBelgium DuneBL

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024