- ๐ต๐น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.
- ๐ฆ๐บ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?
- ๐ง๐ชBelgium laysiv
It seems like the issue is caused by enabling the required field.
- ๐ง๐ช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?