Webform open/close schedule - use fixed timezone

Created on 26 August 2024, 4 months ago
Updated 11 September 2024, 3 months ago

Problem/Motivation

When a webform has an open or close schedule, that schedule is enforced relative to each user's local timezone, not the site timezone.

As a result:

  1. The form opens & closes at different times for different people
  2. Users can circumvent a deadline by changing their personal timezone
  3. Users can get a headstart on a scheduled opening by changing their personal timezone

For our purposes, this makes the scheduling useless. We need the forms to open and close at the same time for everyone.

This seems to be a duplicate of this issue:
https://www.drupal.org/project/webform/issues/3258050 πŸ› Scheduled webform dates not converted to UTC Closed: won't fix

This is important. Can we reopen that ticket and figure out a solution?

πŸ› Bug report
Status

Active

Version

6.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States BerkeleyJon

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

Comments & Activities

  • Issue created by @BerkeleyJon
  • Does the diff from the current merge request work for you?

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

    @cilefen β€” I'm running Webform 6.2.7 , and for some reason, I couldn't get composer to to install the patch from this merge request:
    https://git.drupalcode.org/project/webform/-/merge_requests/365/diffs

  • I would need technical information on what happened to comment meaningfully.

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

    Update: This patch here β€” https://www.drupal.org/project/webform/issues/3258050#comment-14363737 πŸ› Scheduled webform dates not converted to UTC Closed: won't fix β€” does install against webform 6.2.x-dev, and it partly solves the issue:

    • On the node-edit or webform-edit screen, it successfully takes an input datetime in the user's timezone and saves it to the DB in UTC.
    • When rendering the node-edit or webform-edit screen, it successfully displays the previously entered date in the user's timezone.

    BUT:

    • When figuring out whether the webform is currently open or closed, it's all screwed up. The patched code takes the DB value, which it should interpret as being in UTC, and instead interprets it as if it were in the user's timezone.
    • The patch also does nothing about previously entered open & close datetimes; they end up off by the difference between UTC & the site's timezone.
  • πŸ‡ΊπŸ‡ΈUnited States BerkeleyJon

    Here is a slightly updated version of the patch. It now achieves three of the four goals:

    1. On the node-edit or webform-edit screen, it successfully takes an input datetime in the user's timezone and saves it to the DB in UTC.
    2. When rendering the node-edit or webform-edit screen, it successfully displays the previously entered date in the user's timezone.
    3. It correctly figures out whether the webform is currently open or closed.

    BUT:

    • The patch still does nothing about previously entered open & close datetimes; they end up off by the difference between UTC & the site's timezone.
Production build 0.71.5 2024