Scheduling an Open webform to Close is confusing

Created on 3 March 2025, 2 months ago

Problem/Motivation & Steps To Reproduce

If a webform is in Open form status, and along the way you want to schedule a Close date...
on the Settings->Form screen, under "Form general settings", if you then enter a Close date & time, then click Save at the bottom of the page, then go back and view the Close date you just entered, it is empty...

I found this is due to these lines in src/Entity/Webform.php:

// Clear open and close if status is not scheduled.
    if ($this->status !== WebformInterface::STATUS_SCHEDULED) {
      $this->open = NULL;
      $this->close = NULL;
    }

This is present on both 6.3.x-dev and 6.2.9 branches.
Whereas evidently if the form status is not Scheduled, and anything is entered into the Open or Close date&time fields, then those fields will just be wiped empty. The user likely will not catch that their Close date&time was wiped; no message is displayed to inform the user that they entered data into a field that was not being honored.

The only way I see to schedule an Open form to close, is to change the Form status to Scheduled, then put some past date into the Open date&time field, and then set the Close date&time.

Proposed resolution

Perhaps at least the Open and Close date&time fields should be hidden if the form status is not Scheduled?

πŸ› Bug report
Status

Active

Version

6.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States fizcs3 Omaha, Nebraska; USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024