Events Made Easy › Forums › Generic › Bookings are not accepted with emmpty message
- This topic has 7 replies, 2 voices, and was last updated 7 years ago by Franky.
-
AuthorPosts
-
Mon 13 Nov 2017 at 13:36 #56962AnonymousInactive
Hi,
On my site bookings are not being accepted. An empty orange box is being shown.
Request looks like this:
email: bob@example.com eme_ajax_action: add_bookings eme_event_ids[]: 5 eme_is_multibooking: 0 eme_multibooking_tpl_id: 0 eme_register_empty_seats: 0 eme_rsvp_nonce: d86ee5bbdd eme_rsvpcomment: FIELD3 https://example.com honeypot_check: lastname: wp-user only_if_not_registered: 1 phone:
Reply form server is the following:
{"result":"NOK","htmlmessage":""}
I tried to trace the issue. I ended up inside of
eme_multibook_seats
function. There’s a look over all events (only one in this case) and the event processing being skipped because the following check fails:!isset($_POST['bookings'][$event_id])
.I’m not sure what the logic is behind this. The
bookings
is clearly not sent in the request.Please advice.
Mon 13 Nov 2017 at 13:49 #56964FrankyKeymasterWell, an empty htmlmessage is weird … I’ll check
For the rest, the for-loop it skips is indeed the one for multibookings, so that part is ok.Mon 13 Nov 2017 at 13:58 #56965FrankyKeymasterHmm …. well, my comment might be wrong. I’ll test first.
Mon 13 Nov 2017 at 14:18 #56966FrankyKeymasterWell, I just checked the code, and the bookings-array should always be there.
Is this a special type of event? Or empty seats booked? Can you check the html via firefox debugger to see if in the received html the following field is defined:
bookings[5][‘bookedSeats’]
?
And/or a public example I can check?Mon 13 Nov 2017 at 14:40 #56967AnonymousInactiveI think I’ve found the issue. In my form seats field was conditionally included. Like this:
[eme_if tag='#_IS_MULTISEAT' value='1']<label><span>Seats</span> #_SPACES</label>[/eme_if]
I thought it was not required for single-seat bookings. Apparently, I still have to include it to have
bookings[]
in my request.Consider this a viable workaround. Still consider adding extra form validation or default value for single-seat bookings.
Mon 13 Nov 2017 at 15:16 #56968FrankyKeymasterEME does validation that #_SEATS (or #_SPACES) is present in your template, but before doing eme_if-validations.
Now: EME can also hide this for you: just set the min seats to book to 1 and mark it as an attendance event. Maybe I’ll expand that logic in the future even: if min and max are equal, it can also be hidden …Tue 14 Nov 2017 at 08:53 #56975AnonymousInactiveIt does hide the field itself but the associated markup (e.g.
label
) is not hidden so form doesn’t look right for single-seat bookings. That’s why I used conditional.Tue 14 Nov 2017 at 21:09 #56978FrankyKeymasterWhy not just use a separate rsvp template for that event? That way you can just put #_SEATS somewhere (without label), indicate “attendance” for the event and be done with it 🙂
-
AuthorPosts
- The forum ‘Generic’ is closed to new topics and replies.