Select initial workflow state

Created on 21 February 2023, almost 2 years ago
Updated 4 April 2023, over 1 year ago

HI,

For a content type using registration I'd like to be able to set the initial workflow state to one of two options, say "in Stock" or "On Order", on the node creation page. I don't see a way to do that, so am I missing something?

Thanks,
Eric

πŸ’¬ Support request
Status

Closed: works as designed

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States aitala

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

Comments & Activities

  • Issue created by @aitala
  • πŸ‡ΊπŸ‡ΈUnited States john.oltman

    Hi Eric, the default is controlled by editing the "Default state" field on the Registration Type. To control which states are shown on the registration form, edit the workflow states (/admin/config/workflow/workflows/manage/registration) and check the "Show on Form" field for those states you want to appear in the select box. In many cases regular end users should not be able to pick a state - you control who sees the State field via permissions. If not need more control than this, you will need to do a hook_form_alter in a custom module and do your logic via PHP code.

    John

  • πŸ‡ΊπŸ‡ΈUnited States aitala

    HI,

    Yes, I'm getting that on the node display page to do a registration but I'm trying to create the node in one of two possible initial states, "In Stock" or "On Order". If the default state is "In Stock" I have the workflow set so the editor can change it after creating the node to "On Order" but I'm pretty sure they will find this confusing.

    The end user won't be be able to register nodes "On Order" only "In Stock" - basically this is being used as a placeholder for items that have been requested for a specific user which might never be added. Once they do come in, they'd be moved into an "Ordered" state by the editor for that specific user, skipping "In Stock" altogether.

    Thanks,
    Eric

  • πŸ‡ΊπŸ‡ΈUnited States john.oltman

    Interesting - almost seems like the node needs workflow of its own. You might consider the Content Moderation module which provides different states for nodes. There is also Drupal Commerce which uses products instead of nodes, and has a Commerce Stock module as a contrib.

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States john.oltman
Production build 0.71.5 2024