Problem/Motivation

Using Preserve changed timestamp in combination with non-revisionable entities results in:

Error: Call to a member function hasTranslation() on null

Steps to reproduce

Call ::save() on a File entity

Proposed resolution

Copy the existing logic in \Drupal\Core\Field\Plugin\Field\FieldType\ChangedItem to prevent this error

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#2 3222827-2.patch818 bytesidebr
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review
StatusFileSize
new818 bytes

Attached patch copies the existing logic in \Drupal\Core\Field\Plugin\Field\FieldType\ChangedItem to prevent this error

tomefa’s picture

Status: Needs review » Reviewed & tested by the community

Patch work on 1.x and 2.0 version of the module and this correct the error on Null also when deleting an entity.

claudiu.cristea made their first commit to this issue’s fork.

claudiu.cristea’s picture

Version: 2.0.0-alpha1 » 2.x-dev

  • claudiu.cristea committed 226c9c2 on 2.x
    Issue #3222827 by claudiu.cristea, idebr, Tomefa: Error: Call to a...
claudiu.cristea’s picture

Status: Reviewed & tested by the community » Fixed

Thank you

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.