Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
On saving a new booking, I get the following messages:
Notice: Undefined index: und in rooms_booking_create_order() (line 1212 of modules\rooms_booking\rooms_booking.admin.inc).
Warning: Invalid argument supplied for foreach() in rooms_booking_create_order() (line 1212 of modules\rooms_booking\rooms_booking.admin.inc).
Looking at the code, I see an unconditional access to the rooms_booking_unit_options field. Whereas, directly after load (function rooms_booking_edit_form_submit(), around line 1113, file rooms_booking.admin.inc, code = $unit_object = rooms_unit_load($unit);) there is a check on the field not being empty. In fact, ALL other occurrences of the line "foreach ($unit->rooms_booking_unit_options[LANGUAGE_NONE] as $option)" are preceded by a line with "isset(...)".
The attached patch adds a check around this last unconditional usage as well.
Comment | File | Size | Author |
---|---|---|---|
undefined-index-und.patch | 1.91 KB | fietserwin |
Comments
Comment #1
fietserwinComment #2
ronald_istos CreditAttribution: ronald_istos commentedAwesome - thanks - added to head.
Comment #5
ronald_istos CreditAttribution: ronald_istos commented