Active
Project:
Drupal core
Version:
main
Component:
workflows.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Aug 2017 at 14:38 UTC
Updated:
16 Sep 2026 at 20:29 UTC
Jump to comment: Most recent
Comments
Comment #2
sam152 commentedIf there are two implementations, the interface is required. So perhaps the issue should clarify the terminology around "value objects" in the comments?
Comment #3
sam152 commentedGiven we have methods like
WorkflowTypeInterface::getTransitionswhich are@apithat return an array of objects that implement an@internalinterface, this should probably be resolved for 8.5.Additionally I missed that #2896724: Create constants for transition directions. introduced a constant on an
@internalinterface, to be used as an argument for an@apimethod. I suspect the outcome of this will be, those interfaces will become@api, so hopefully not an actual problem?Adding some context to the IS which will help us decide what to do with these.
Comment #5
nigelcunningham commentedI have a further argument for treating Transitions as entities in their own right: I'm preparing a quote for a client that wants transitions to require approval from multiple users. To my mind, it makes most sense to implement this by having transitions be entities supporting the implementation of the rules that are required.
If this quote goes further, I'll do more work but happy to participate in further discussion.
Comment #17
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #18
amateescu commentedI think this still needs to be settled, and the answer for the decision part is "yes" from my POV.
Both Content Moderation in core and other projects in contrib provide their own value objects for states and transition, and it would be nice to have at least the common methods on an interface.
Comment #19
mile23Coming at this because I needed to understand workflow/content moderation stuff for a project, and I encountered the @todo in
Drupal\workflows\StateInterface...Drupal\content_moderation\ContentModerationStateis a decorator for an arbitraryDrupal\workflows\StateInterfaceobject, so it needs to implement all the methods ofStateInterface.Therefore,
ContentModerationStateshould identify itself as implementingDrupal\workflows\StateInterface, which it currently does.If we need an interface which extends
StateInterfaceto include the extra decorations fromContentModerationState, then we should add that incontent_moderationmodule. It could be named something likeContentModerationStateInterface.I'm finding it hard to figure out what the actual proposed change in this issues is, so I'm not sure if I agree or disagree with it. :-)
Change I propose:
StateInterfaceshould not be @internal, and should have the @todo removed.