- Issue created by @hewi1345
- 🇩🇪Germany Sajara
This feature is of very high importancy for me, too (busyness use). please put an eye on it.
- 🇩🇰Denmark ressa Copenhagen
@Sajara: Remember that Drupal is open source, and run by volunteers, offering their time and services for free.
You and @hewi1345 could consider sponsoring @rfmarcelino to build this feature?
- 🇵🇹Portugal rfmarcelino
Dear @hewi1345 @Sajara
Thank you for your feedback.
There are several implications to consider.
The email content usually needs to be customised and a generic solution may not work well for most use cases.
The simplest approach, since Webform already allows to configure emails, would be to provide a token for the cancellation URL.
That would allow to embed inside a custom confirmation email.
A controller would get that cancellation request and remove the value from the submission.
Currently, the cancellation is deleting the field content. In terms of auditing, it's not great. It would be probably better to have a hidden 'Canceled' status.As @ressa just mentioned, we are volunteering our time. We have a set of weekly contribution hours. If you need a specific feature within a specific timeframe, feel free to reach us.
- 🇦🇹Austria electric.larry Vienna
Now, as we introduced tokens in webform_booking 1.1.4 and submission objects can already create hashes (?token=****) that allow for viewing/updating/deleting submissions, we basically have all we need for the cancellation feature.
@rfmarcelino: In #4, you said: "Currently, the cancellation is deleting the field content.
Is there some cancellation feature in webform_booking already, or are you referring to the built-in functions for editing/updating submissions (webform_submission:token-delete-url, webform_submission:token-update-url)?Also, in #4, you said: "In terms of auditing, it's not great. It would be probably better to have a hidden 'Canceled' status."
I'm wondering how you'd prefer approaching this. In webform_submission_data, we're saving a value like "2025-01-07 09:00|1" for one booked slot on the 7th. Would you rather just update the value to "2025-01-07 09:00|0" when a user clicks the cancel link, or do you think it would be better to change the value to something like "2025-01-07 09:00|1|cancelled"? Or did you have something completely different in mind for the hidden canceled status? - 🇦🇹Austria electric.larry Vienna
This patch adds the requested cancellation feature.
A new token is available
[webform_submission:booking:element_key:cancel_link]
that can be placed on the confirmation page or popup. Replaceelement_key
with the machine name of the Webform Booking field. In this example my form has two Webform Booking fields namedappointment_booking
andappointment_2
.Confirmation page source
Confirmation page display
If you have more than one Webform Booking fields on your form, only place one cancel link on the cofirmation page. Opening the link displays a list of all Webform Booking fields in that submission and allows the user to select the bookings he wants to cancel.
- 🇦🇹Austria electric.larry Vienna
The patch in #9 also fixes another issue with creation of tokens if multiple Webform Booking fields are placed on a form and one of them is submitted empty.
-
rfmarcelino →
committed b4fb5183 on 1.1.x
#3450608 - Booking cancellations
-
rfmarcelino →
committed b4fb5183 on 1.1.x
- 🇵🇹Portugal rfmarcelino
Thank you @electric.larry, for your contributions!
Committed! Automatically closed - issue fixed for 2 weeks with no activity.