Problem/Motivation

Sometimes, the original entity is not available in entity update hooks. This is because in EntityStorageBase::doPostSave, unset($entity->original); is called.

Steps to reproduce

I haven't been able to reproduce this consistently, but it has happened more than once already on a production website.

Proposed resolution

Make the getter nullable, just like EntityPresaveEvent::getOriginalEntity is nullable.

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

DieterHolvoet created an issue. See original summary.

dieterholvoet’s picture

Status: Active » Needs review
dieterholvoet’s picture

Any chance this can get merged? We keep hitting this problem on different projects, requiring us to add patches.

dieterholvoet’s picture

Version: 8.x-2.x-dev » 3.x-dev
el7cosmos’s picture

Version: 3.x-dev » 3.2.0
Status: Needs review » Fixed

el7cosmos’s picture

released in 3.3.0

Status: Fixed » Closed (fixed)

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