Add a 'description' field to the schema for states and transitions

Created on 25 May 2022, over 2 years ago
Updated 29 July 2024, 4 months ago

In order to provide more information to end users about what a state means or what the implications of a transition are, it would be nice to have a 'description' field defined directly in the workflow. (Only other option is to define some other file or user interface for adding descriptions and selecting the state / transition they apply to.)

I don't think these need to be used out of the box, but if they were, you could easily see the description of a state being used as the title of a cell in a View:

Or the description of a transition being included in the transition confirmation form:

Feature request
Status

RTBC

Version

1.0

Component

Code

Created by

🇺🇸United States rszrama

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • 🇺🇸United States karlshea Minneapolis 🇺🇸

    This would be very helpful, I needed to add a custom transition to our commerce orders so shipping emails didn't get sent and it would be very helpful to have some description text to remind the users which transition sends the emails and which doesn't.

  • Merge request !21Add transition descriptions → (Open) created by karlshea
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 10 months ago
    20 pass, 1 fail
  • Pipeline finished with Failed
    10 months ago
    Total: 181s
    #76469
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 10 months ago
    27 pass
  • Pipeline finished with Success
    10 months ago
    Total: 152s
    #76480
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 10 months ago
    27 pass
  • Pipeline finished with Success
    10 months ago
    Total: 152s
    #76484
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 10 months ago
    27 pass
  • Pipeline finished with Success
    10 months ago
    Total: 337s
    #76486
  • Status changed to Needs review 10 months ago
  • 🇺🇸United States karlshea Minneapolis 🇺🇸

    Two issues I can see:

    1. Constructor signature changes for WorkflowState and WorkflowTransition.
    2. I'm not sure whether/how to surface the state description anywhere, OrderListBuilder doesn't really seem to be used since that's normally a view so there would have to be something done to add a title attribute to that cell.
  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 7 months ago
    27 pass
  • Pipeline finished with Failed
    7 months ago
    Total: 218s
    #161510
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 7 months ago
    Not currently mergeable.
  • Pipeline finished with Success
    7 months ago
    Total: 145s
    #161528
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 7 months ago
    Not currently mergeable.
  • Status changed to RTBC 7 months ago
  • 🇩🇪Germany gogowitsch

    I have tested the feature: very useful for my situation.

    I have read the diff (code changes): looks good to me.

  • Pipeline finished with Success
    7 months ago
    #161529
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 7 months ago
    27 pass
  • Pipeline finished with Success
    7 months ago
    #161532
  • 🇮🇱Israel jsacksick

    Not against the idea, but the problem is the signature change especially for the WorkflowTransition... The description should be added last, and should default to an empty string so we don't break any code instantiating workflow transition objects.

  • 🇨🇦Canada redsky

    Thought I'd mention issue #3382018 Add a field to the schema for transitions to support #button_type Active . It's a different need but it might be good to know there's another idea related to adding an optional field.

    Also I wanted to add my support for the great idea being discussed here!

  • Pipeline finished with Success
    4 months ago
    Total: 214s
    #237632
  • 🇩🇪Germany gogowitsch

    I improved the code based on @jsacksick's feedback in Comment #7 Add a 'description' field to the schema for states and transitions RTBC .

  • Pipeline finished with Canceled
    4 months ago
    Total: 486s
    #237662
  • Pipeline finished with Success
    4 months ago
    Total: 403s
    #237668
Production build 0.71.5 2024