Make action buttons more unique

Created on 4 August 2015, almost 9 years ago
Updated 1 May 2024, 2 months ago

Please make action buttons more unique.

Use case 1 (OP):
When two or more state transition buttons have the same label, all buttons with the same label will cause a transition to the state of the last button to be created.

For example, lets say there are three states available: A, B, and C. Some node is in the "A" state and displays two workflow transition buttons with the same label "D". Inspecting the button HTML shows that each button has a different ID: "edit-workflow-2" (B) and "edit-workflow-3" (C), but both have the label "D". Clicking on the button with the ID "edit-workflow-2" should move the node to state B, but it actually moves the node to state C. Clicking on the button with the ID "edit-workflow-3" correctly moves the node to state C as expected.

I understand that it may not be a common occurrence to have multiple buttons with the same label, but I think this should still be fixed. Either prevent multiple button labels in the same state from having the same name, or correct the code to not rely on button labels to know which state to move to.

Use case 2(#2):
it would be helpful if the buttons had a unique identifier other than the label for the purpose of finding them on the workflow form (e.g., in a form_alter). Currently the buttons are keyed by the state they transition to, so finding them in the form means my code needs to hard-code transition sequence logic. The alternative is finding them using the label, which is worse.

πŸ› Bug report
Status

Fixed

Version

2.5

Component

User interface

Created by

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.

No activities found.

Production build 0.69.0 2024