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

When creating a new revision, the new revision is always made the default revision if the previous default revision is unpublished

$
0
0

Problem/Motivation

New revisions that follow a previous unpublished default revision are always made the new default revision regardless of any workflow settings to the contrary. This is in contrast to the behavior experienced for revisions following a published default revision.

As a result, "forward drafts" can not be "set as current revision" prior to a state change (to a state that makes it "Published" for example). This behavior is possible when "forward drafts" are created while the current default revision is published.

I believe that this can be traced back to an issue before the workbench_moderation module was copied to core (Latest revision should become default revision when entity has never been published). It appears that the original intent was to make each new revision of an entity that was not yet published the new default revision as it is created.

This is supported in the issue description:

Given I create a moderatable entity in a non-published state (e.g., draft)
And I transition the entity to another non-published state (e.g., review)
Then the latest revision should become the default revision

However, if an entity has been previously published, and then unpublished, it doesn't seem to make sense to continue to make each subsequent revision the default revision any longer.

Steps to reproduce

  1. Create a revisionable entity with the default workflow assigned.
  2. Create a new revision with a moderation state that is "published."
  3. Create a new revision with a moderation state that is "unpublished."
  4. Create a new revision with a moderation state that does not have the "Default Revision" checkbox checked.
  5. Observe that the new revision is the default revision.

Proposed resolution

Adjust the technique used to determine if an entity revision should be set to "default revision".
See Drupal\content_moderation\EntityOperations::entityPresave()


Viewing all articles
Browse latest Browse all 293211

Trending Articles



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