Unable to change state on Webform Submission view form

Created on 17 February 2025, 4 months ago

Problem/Motivation

I'm unable to update the state on a Webform Submission view form.

Have tried the various Advanced and Access options and makes no difference. I've also tried using Stark as Admin theme and still not visible.

So my questions are:

  • is this a config error (if so, what is the solution?) or a misunderstanding (the module cannot do this)
  • or is this a bug (missing a submit button for example?)

Steps to reproduce

Set up a vanilla D11 site with Webform and Webform Workflows Element. Just using default Olivero theme and Claro admin theme. Log in as User 1 so shouldn't be any permission issues.

Create a Workflow with Workflow Type of Webform workflow called 'Approve or reject', with the following 3 states:

  1. Submitted
  2. Approved
  3. Rejected

And 2 transitions

  1. Approve (Submitted > Approved)
  2. Reject (Submitted > Rejected)

With an initial state of 'Submitted'

Then create a Webform (call it "Basic Text Field Form"), adding 2 elements

  1. Text field
  2. Webform workflows element (using 'Approve or reject' workflow)
    1. Tick the 'Allow changing the workflow state from the "view submission" page' checkbox (so this is set)
    2. Select an appropriate UI (radio buttons or select)
    3. Save element
  3. Save Webform

Then create a test submission at /webform/basic_text_field_form/test

Go to results /admin/structure/webform/manage/basic_text_field_form/results/submissions and select a result (eg, /admin/structure/webform/manage/basic_text_field_form/submission/1). Select a transition within the 'State' details section... can't save it? ( see attached screenshot )

💬 Support request
Status

Active

Version

2.0

Component

User interface

Created by

🇬🇧United Kingdom robcarr Perthshire, Scotland

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

Merge Requests

Comments & Activities

  • Issue created by @robcarr
  • 🇬🇧United Kingdom robcarr Perthshire, Scotland

    If a Submit button were to be inserted into the webform_workflows_element (/src/Element/WebformWorkflowsElement.php) what handler would be called? Any 'Update state' button should only be rendered on the 'View' display (to render in the submission Edit display would be very confusing)

  • 🇫🇷France mably

    Save button seems to display just fine here:

  • 🇬🇧United Kingdom robcarr Perthshire, Scotland

    I still have the same screen and missing 'Save' button despite updating to 2.0alpha3 release,

    So I'm clearly making a config error somewhere:

  • 🇲🇾Malaysia elaine.ong

    Same here. On Submission View page, workflow does not provide a save button.

  • 🇱🇧Lebanon jana_najdi01

    I have the same problem
    I cannot edit the workflow on the view page and i don't have a submit button I only have next and preview
    is there any solution for this?

  • 🇫🇷France mably

    Just re-tested the issue's scenario again on a fresh Drupal 11.1.7 and I definitely have the "Save" button showing:

    And I can definitely save it:

    Don't know what we are missing here.

  • 🇱🇧Lebanon jana_najdi01

    This in the edit section
    It should also appear in the view section since we enabled: Allow changing the workflow state from the "view submission" page
    which is not working, I can see the field but it is not editable

  • 🇫🇷France mably

    Oups, missed that, thanks.

    Will have another look at it.

  • 🇱🇧Lebanon jana_najdi01

    In my case also it is not editable

  • 🇫🇷France mably

    Does it work with the 1.0.x version of the module?

  • 🇫🇷France mably

    Hi all, could you give a try to this issue's MR?

  • 🇬🇧United Kingdom robcarr Perthshire, Scotland

    I've applied the MR - thanks so much @mably

    The submit button is now rendered on the Webform View display. I've done a few manual tests and all seems to work fine, but would be good if someone else could test before RTBC

    It might make the form more intuitive by altering the default "Save workflow" button (line 311) to either "Save state change", "Save transition" or make the button text configurable. Using either the word 'State' or 'Transition' makes it consistent with the terminology in the Webform > Build > Webform workflows element config.

  • 🇫🇷France mably

    @robcarr thanks for your feedback.

    May be you can create a new issue for the button wording.

    I'll merge this issue as soon as we get another positive review.

  • 🇫🇷France mably

    @jana_najdi01 looks like a different problem as the workflow fields are not displayed at all on your screenshot.

  • 🇱🇧Lebanon jana_najdi01

    There is availble transition and as i mentioned before that it is not displayed as dropdown and i cannot modify it or save it

  • 🇫🇷France mably

    @jana_najdi01 could you post a screenshot of the same submission in edit mode?

  • 🇱🇧Lebanon jana_najdi01

    yes here you go

  • 🇬🇧United Kingdom robcarr Perthshire, Scotland

    @jana_najdi01 check your config in Webform > Build > Webform workflows element and make sure the Allow changing the workflow state from the "view submission" page toggle is set.

    Sample screenshot of 'View submission" display

    Note that the 'Save workflow' button [using the MR] is only visible on the View display of the submission. It's not rendered on the Edit display of the submission - which is expected behaviour.

  • 🇫🇷France mably

    @jana_najdi01 I don't see the "Save" button on your edit submission screenshot, it should be present.

    It would also be interesting to see if you have some transitions available in that select control.

  • 🇱🇧Lebanon jana_najdi01

    It is enabled and there is a submit button in the webform

  • 🇫🇷France mably

    @jana_najdi01 could you provide a full repeatable scenario from a fresh Drupal 11 install ?

    Otherwise we won't be able to help much.

    Your problem is most probably not related to this current issue.

  • 🇱🇧Lebanon jana_najdi01

    Okay so I removed the workflow from the wizard page and I put it on the level of the submit button
    Now i can edit it but there's no save button only next and previous
    any idea?

  • 🇱🇧Lebanon jana_najdi01

    is there any update on this? I am able now to edit the worklfow but there's no save button

  • 🇫🇷France mably

    @jana_najdi01 no update because we cannot reproduce the problem your are facing.

    Please provide the detailed steps to reproduce your bug from a fresh Drupal 11 instance.

  • 🇱🇧Lebanon jana_najdi01

    I am on drupal 10 might this be the problem?

    Enable Modules:
    Webform
    Webform UI
    Webform Node
    Workflow
    Webform Workflow

    Create a Webform:
    Add fields split across multiple wizard pages:
    Page 1: Student Info
    Page 2: Uploaded Documents
    Page 3: Signature
    Workflow State
    Submit

    Attach Workflow:
    Create a workflow: e.g., DSE Workflow with states: delivered, assigned, under review, completed
    Configure transitions and assign it to Webform submissions
    Submit the Form as a normal user.

    View/Edit the Submission:
    Go to Webform Results > Submissions
    Click on View the submission

    Bug Behavior

    While viewing a submission:
    You can navigate pages using Next and Previous (but the whole webform is displayed as a view in one page so these next and previous are useless)
    You can update the workflow
    But you do NOT see a Save or Submit button on the final page

  • 🇫🇷France mably

    Ok, it just look like it's currently not compatible with multipage webforms.

    Will have to investigate further.

  • 🇫🇷France mably

    Hi @jana_najdi01, could you give another try to this issue's MR?

  • 🇫🇷France mably

    @jana_najdi01, the multipage bug should be fixed, could you give it a try?

    @robcarr would you mind verifying that the fix doesn't introduce any regression on your side?

  • 🇱🇧Lebanon jana_najdi01

    @mably this merge request is causing a problem on the view submission. It is taking an eternity to load and ending up causing a 504 error

  • 🇫🇷France mably

    Any control hierarchy in your webform that could create a loop when we are recursively searching for worflow elements inside the webform?

    Any other special complex elements?

    By reading the MR's code, do you see any part of the code that could cause that timeout?

    My test form has only two pages, will try to add a third one see if it makes any difference.

  • 🇱🇧Lebanon jana_najdi01

    My webform is almost 11 pages and it contains lots of conditional fields depending one on another
    and i guess loading the whole edit form in the view is heavy

  • 🇫🇷France mably

    I have added a functional test checking that the "Save workflow" button is properly displayed on a multipage webform view:

    @jana_najdi01 more info is needed if you want me to investigate further.

    Your bug is probably related to something specific to your webform.

  • 🇱🇧Lebanon jana_najdi01

    let me know what info can help you so we can debug further
    thank you

  • 🇫🇷France mably

    As always: the simplest test scenario from a fresh Drupal instance allowing to reproduce the bug.

    It there is nothing confidential, you can post the yaml configuration file of your webform eventually.

  • 🇱🇧Lebanon jana_najdi01

    here is the yaml code for the webform

  • 🇫🇷France mably

    Try to rebuild your webform from scratch to identify the page or element that causes the problem.

    • mably committed 493208ac on 2.0.x
      Issue #3507158 by mably, robcarr, jana_najdi01, elaine.ong: Unable to...
Production build 0.71.5 2024