Custom action openurl for stateless form fails if date field is empty

Custom action openurl for stateless form fails if date field is empty

Good evening,

I have a stateless form that students use to submit registrations for classes and accommodation. On click, the data is inserted into a temporary registration form.

In the view for this temporary registration form I created a custom action with an openurl for another stateless form called accept_registration_temp. This opens the student registration in order to allow admin to perform certain tasks before it is accepted (and loaded into other permanent forms before being deleted from the temporary registration form).

I have 4 date fields in the temporary registration form and its corresponding stateless form: start_date, end_date, arrival_date and departure_date

If any of the date fields are empty, the custom action to open the stateless accept_registration_temp form fails. The date information is collected from students over a period of time, so I need to be able to allow empty date fields.

Does anyone have any ideas about how to handle empty date fields so the openurl task doesn’t fail?

The openurl custom action also fails if a single apostrophe is included in a surname, for example: O’Reilly

I’m not sure how to handle this either.

Any help would be much appreciated.

Many thanks,

Lara