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.

CommentFileSizeAuthor
undefined-index-und.patch1.91 KBfietserwin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fietserwin’s picture

Issue summary: View changes
ronald_istos’s picture

Status: Needs review » Fixed

Awesome - thanks - added to head.

  • Commit 332e058 on master, 7.x-1.x by ronald.ashri:
    Issue #2239327 by fietserwin: Notice: Undefined index: und in...

  • Commit 332e058 on master, 7.x-1.x by ronald.ashri:
    Issue #2239327 by fietserwin: Notice: Undefined index: und in...
ronald_istos’s picture

Status: Fixed » Closed (fixed)