Admin edit alert message

Created on 17 June 2024, 6 months ago

I check on my new Drupal installation and added webform booking to it. And the UI to customer booking is working fine but when on admin side webform result page I try to edit the submissions it gives the alert for "Please select a slot" but the value is selected by the customer I change the value of the other text filed "Name". Is there any option so the customer selected booking value show on the calendar for admin result page so the alert not show while editing the webform submission.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇮🇳India 21kPiyush

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

Comments & Activities

  • Issue created by @21kPiyush
  • 🇮🇳India supriyak

    Hi @21kPiyush,

    I have tried to reproduce the alert message on my local setup, but I am not getting it.
    As you said when I am editing the webform submission the selected Date and time slot is coming in webform_booking element but it is not selected on calendar.

    So we can create the task to do this functionality. Please let me know still you getting same alert message? And if yes let me know steps to reproduce it.

    Thanks!

  • 🇮🇳India 21kPiyush

    I am using 1.0.11 version of module.

    Step to reproduce the alert message

    1) Create a webform with a multipage option.
    1) Create a submission with the booking field marked required.
    2) Login as admin and edit the submission do change on any other field and try to save the submission. You see an alert message.

  • Status changed to Closed: cannot reproduce 6 months ago
  • 🇵🇹Portugal rfmarcelino

    @21kPiyush, the new release has a new validation.
    I wasn't abale to replicate your issue, but should no happen in the latest version.

  • 🇧🇪Belgium laysiv

    I keep getting the error.
    - Format date is set as 18/11/2024 in the configuration section (Regions & languages > Date & time formats)
    - Tried different formats in the text field (18/11/2024 09:00, 18-11-2024 09:00, 2024-11-18 09:00, 2024/11/18 09:00)
    - Installed your latest version (1.1.0)

    Any suggestion what to try more or/and how to fix it?

  • 🇧🇪Belgium laysiv

    It seems like the issue is caused by enabling the required field.

  • 🇦🇺Australia zimny

    I'm facing exactly the same issue here as #7. Starting from the version 1.1.0 and including the latest dev (dev-1.0.x 1314827), when making the webform booking field mandatory, validation is not letting it through.

    My temporary quick/dirty fix was to edit webform_booking/src/Plugin/WebformElement/WebformBooking.php and change line 539 from

    if (!empty($element['#required']) && (empty($value) || empty($value['slot']))) {
    to
    if (!empty($element['#required']) && (empty($value))) {

    It results in omitting the slot validation in that field and only validating the date/time part. As I mentioned above, I'm considering it a dirty hack as it doesn't solve the issue in a long-term and how the date/time/slot is saved.

    The old (prior to 1.1.0) date/time format was YYYY-MM-DD HH:MM (regardless of the US/Rest of the world issue), and it gave us a lot of flexibility. Despite not being a dedicated date field, I could easily prepopulate a dedicated date field with its value to further use it in views and apply sorting by date, datepicker, etc.

    The new format is YYYY-MM-DD HH:MM | X, where X is the slot quantity. This approach changes a lot negatively, at least for me and takes away that flexibility.

    @rfmarcelino, could you reconsider removing the slot value from that field and place it in a dedicated field? Is there any practical or technical meaning that stays behind that change?

  • 🇵🇹Portugal rfmarcelino

    Thank you @laysiv and @zimny.
    Just removed the verification for the slot.

    @zimny, moving the slot into a new field would have backward compatilities issues (we would need to change how we're quering existing bookings).
    If we would reconsider the way date is stores, we would probably consider using Datetime range allong with a couple more:
    - Quantity (seats)
    - Transaction data (paypal integration)

    This kind of change would likelly should be a 2.x branch.

Production build 0.71.5 2024