Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
In a fresh install I created some Bookable Unit Types and afterwards I went to /booking page (without adding any Bookable Unit) and I saw the bellow Notices:
Notice: Undefined index: Standard Single Room in _rooms_booking_manager_get_unit_type_labels() (line 286 ...sites/all/modules/rooms/modules/rooms_booking_manager/rooms_booking_manager.availability_search.inc).
Notice: Trying to get property of non-object in _rooms_booking_manager_get_unit_type_labels() (line 286 ...sites/all/modules/rooms/modules/rooms_booking_manager/rooms_booking_manager.availability_search.inc).
I don't know if this is has to do with my setup or a general bug.
A possible solution might be changing the lines 285-287 in _rooms_booking_manager_get_unit_type_labels() function:
foreach ($unit_type_ids as $label) {
$unit_type_labels[$label] = $unit_types[$label]->label;
}
with this
foreach ($unit_type_ids as $key => $label) {
$unit_type_labels[$key] = $unit_types[$key]->label;
}
P.S. The $unit_type_ids variable has already the information the function returns...?
Comments
Comment #1
ashopin CreditAttribution: ashopin commentedAlso experiencing this and the suggestion above fixed the error.
Comment #2
stefanpetrov CreditAttribution: stefanpetrov commentedSame problem, applied fix from OP and it is ok.
Thank you, @chrbak!
Comment #3
scalas89 CreditAttribution: scalas89 commentedHello everyone! I tried to reproduce the issue without fortune. With last dev it seems to work fine....can you confirm that?
Thank you for support!
Comment #4
petar_b CreditAttribution: petar_b commentedHello, i an having this related issue/error:
Notice: Trying to get property of non-object in rooms_unit_handler_unit_type_field->render() (line 17 of C:\xampp\htdocs\...\sites\all\modules\rooms\modules\rooms_unit\views\rooms_unit_handler_unit_type_field.inc).
The thing is I cannot connect bookable unit with unit types. I have bookable units listed but the admin table leaves blank areas where should be types listed. I tried deleting them all and then creating new types and adding new units to these but no success. Any ideas?