Allow same From/To state

Created on 1 June 2019, about 5 years ago
Updated 16 May 2023, about 1 year ago

This is a follwow up from https://www.drupal.org/node/2951243 →
I would like a bit of an insight on this decision. Why is it that a transition to the current state is not allowed? The original scope of the ticket was to fix the case where an event was not fired when the from and to states were the same. Instead, a validation exception was added that removes the ability to have this.
First of all, with the module being in beta before the rc1, this breaks BC (our site is breaking after the update) which is really not good. Why not simply set it in the configuration?
Secondly, about #3 → there, still, why is it considered a bug to transit to the same state? I understand that the word transition is designating that the state changes but in the world of content moderation, a "transition" from one state to the same state (an update mainly) can have meaning.

Here are some examples:
Use case 1: Using simple content moderation, with states "Draft" and "Published", the moderator wants to be informed when a content is published and when a published content is updated so that he can check the changes. Without the from/to same state transition, there would have to be 2 different cases of notifications, one being in an update hook, the other one being in the transition control.
Use case 2: Having an order with multiple states in a big company, a different sector needs to be informed for any changes in any state. An update to the order by an employee needs to have the manager of the department notified. Even if the state does not changes. I have received notifications from an order being updated and still remaining in the same state.
Use case 3: A paper management system is in place where revisions are calculated according to specific updates. In this system, a content is increasing its version (revision) when the published version is updated. That means that the content can constantly be updated as a draft updating the same revision, but when publishing a draft version, the revision increases. However, the revision also increases every time a published version is updated directly as well.
Use case 4: A transition controlled system has been assigned to some content where, depending on the changes, certain data are populated (doesn't matter what data). Any user changing something in the content, triggers specific cases.
Using the state machine button formatter, buttons are populating the form action area per transition allowed. However, in certain cases, a moderator or an administrator needs to update data without firing any event. In this case, the default "Save" button is shown to users with specific permissions. The default "Save" button is not part of the workflow so it does not fire any events when normally, updating a content to the same state, would.

Or even a combination of all the above. And I understand that a duo draft-published state is not something of a big deal to have also an update hook, but if you try to think of a multi-state case where all the above are amplified to match multiple notification and actions, having to maintain two ways of firing events can be quite hard.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇷Greece idimopoulos

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024