Problem/Motivation

In #3037136-3: Make Workspaces and Content Moderation work together, @plach brought up a review point:

+++ b/core/modules/workspaces/src/EntityTypeInfo.php
@@ -77,6 +77,24 @@ public function entityTypeBuild(array &$entity_types) {
+  public function entityTypeAlter(array &$entity_types) {

As mentioned above: could we move this to CM? I'm wondering whether we could even change the logic in LatestRevisionCheck::access() code to further/only check that the latest revision is not also the default revision, regardless of it being pending. This would address WS implicitly without having to do a module exist or check that the entity type is handled by WS.

And @amateescu's reply:

We could, but it's harder to do it in CM for two reasons:

I'm wondering whether we could even change the logic in LatestRevisionCheck::access() code to further/only check that the latest revision is not also the default revision, regardless of it being pending.

The problem with doing it only in the access check is that the latest-revision link template would still be registered, and there's a lot of code in CM that's doing stuff conditionally based on the existence of that link template, so it's better to not have it in the first place.

This would address WS implicitly without having to do a module exist or check that the entity type is handled by WS.

If we want to do the module exists and workspace-supported check in CM, it means that we'd need to inject the workspace manager conditionally somehow into \Drupal\content_moderation\EntityTypeInfo.

Based on the two points above, I think it's easier to leave that conditional logic in Workspaces.

Proposed resolution

Discuss whether we want to move the current logic from \Drupal\workspaces\EntityTypeInfo::entityTypeAlter() into Content Moderation.

Remaining tasks

TBD.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.

Release notes snippet

Nope.

Comments

amateescu created an issue. See original summary.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.