Problem/Motivation

Currently when loading revisions in SqlContentEntityStorage::loadRevision() we do not statically cache the instantiated objects. Aside from the performance implications, this has the major drawback of instantiating a new entity object every time. If the same entity is loaded twice and two entity objects are instantiated, we will end-up having broken internal translation objects references. This means changes to field data will not be propagated to the various translations, which in turn means that if the two objects are saved, the latter will override the former, and a data loss will result. The mitigating factor is that we normally do not save revision objects, however the entity objects could marked as the default revision and then saved.

Proposed resolution

Add static caching support also for entity revision loading in ContentEntityStorageBase, so that all storage backends can automatically leverage it.

Remaining tasks

  • Validate the proposed solution
  • Write a patch
  • Review it

User interface changes

None

API changes

Probably only additions.

CommentFileSizeAuthor
#1 2503025-1.patch1.41 KBjoshi.rohit100
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joshi.rohit100’s picture

Status: Active » Needs review
FileSize
1.41 KB

FIrst try for SqlContentEntityStorage (if i got it right ).

Status: Needs review » Needs work

The last submitted patch, 1: 2503025-1.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Berdir’s picture