Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299077

ContentEntityBase::setNewRevision(FALSE) is broken if ::setNewRevision(TRUE) was called previously

$
0
0

Problem/Motivation

Create an entity and save it. Now call setNewRevision(TRUE) on the entity and before saving call setNewRevision(FALSE). The first call to setNewRevision removes the revision_id so trying to stop the creation of a new revision is not possible by calling setNewRevision a second time. Saving the entity now results in a new revision.

Proposed resolution

Make the function setNewRevision remember the changes it made and revert them if called again with TRUE.

Remaining tasks

review.

User interface changes

none

API changes

none

Data model changes

none


Viewing all articles
Browse latest Browse all 299077

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>