Problem/Motivation

Moderation states and moderation state transitions manually declare their routes instead of using the default route provider. This leads to code duplication and divergence.

Proposed resolution

Use the default route provider for moderation states and moderation state transitions.

As part of this, the following things are fixed, as well:

  1. Fixes case of local actions from Add Moderation state(| transition) to Add moderation state(| transition). This is to make it consistent with the page titles of the resulting pages after clicking the action links.
  2. Adds an administrative permission to moderation states. This allows the collection route to be auto-generated.
  3. Adds an add-form link to moderation states and moderation state transitions. This allows the add form route to be auto-generated.
  4. Updates the edit-form link for moderation states and moderation state transitions to match the path used previously in the route.
  5. Updates the moderation state access control handler to make use of its parent class. The introduction of an administrative permission (see above) makes some of the code redundant, so that is fixed.

Remaining tasks

Review patch.

User interface changes

The page title of the workflow state collection and workflow state transition collection are changed to Workflow state entities and Workflow state transition entities, respectively. While being a regression in clarity (and, thus, usability) this will be fixed by #2767025: Add entity type label for a collection of entities. Our current entity API is not capable of providing a better label for this, yet. Since this is an experimental module, that is an acceptable trade-off. If this ends up hindering the removal of the module's experimental state we can always extend the default route provider to provide a better label.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler created an issue. See original summary.

tstoeckler’s picture

Status: Active » Needs review
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Super nice improvement!

tstoeckler’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review
tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Oops, didn't mean to do that.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, d8-content-mod-route-provider.patch, failed testing.

tstoeckler’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
3.79 KB
9.97 KB

This should be green.

The edit-form link template was incorrect, so the UI worked, but with a different path...

timmillwood’s picture

Status: Needs review » Reviewed & tested by the community

Moving back to RTBC

amateescu’s picture

Looks great!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +rc eligible

Committed and pushed aef08f5 to 8.3.x and 4f69503 to 8.2.x. Thanks!

RC eligible because this is for an experimental module.

  • alexpott committed aef08f5 on 8.3.x
    Issue #2802301 by tstoeckler: Use route providers for ModerationState(|...

Status: Fixed » Closed (fixed)

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