Fixed: Extra Information field value not saved while adding a room in room type in back office.

This commit is contained in:
Rohit Jain
2025-03-27 12:41:55 +05:30
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -409,7 +409,7 @@
html += '</select>';
html += '</td>';
html += '<td class="col-sm-3 center">';
html += '<input class="form-control" type="text" name="'+prefix+'[floor]">';
html += '<input class="form-control" type="text" name="'+prefix+'[comment]">';
html += '</td>';
html += '<td class="center col-sm-2">';
html += '<a class="btn btn-default deactiveDatesModal disabled" data-toggle="modal" data-target="#deactiveDatesModal">';

View File

@@ -3497,10 +3497,10 @@ class AdminProductsControllerCore extends AdminController
}
$objHotelRoomInfo->id_product = $id_product;
$objHotelRoomInfo->id_hotel = $id_hotel;
$objHotelRoomInfo->room_num = $roomInfo['room_num'];
$objHotelRoomInfo->room_num = trim($roomInfo['room_num']);
$objHotelRoomInfo->id_status = $roomInfo['id_status'];
$objHotelRoomInfo->floor = $roomInfo['floor'];
$objHotelRoomInfo->comment = $roomInfo['comment'];
$objHotelRoomInfo->floor = trim($roomInfo['floor']);
$objHotelRoomInfo->comment = trim($roomInfo['comment']);
if ($objHotelRoomInfo->save()
&& $objHotelRoomInfo->id_status != HotelRoomInformation::STATUS_TEMPORARY_INACTIVE
) {
@@ -3536,7 +3536,7 @@ class AdminProductsControllerCore extends AdminController
}
}
if ($roomInfo['room_num'] && !Validate::isGenericName($roomInfo['room_num'])) {
if (empty(trim($roomInfo['room_num'])) || !Validate::isGenericName($roomInfo['room_num'])) {
$this->errors[] = sprintf(Tools::displayError('Invalid room number for room %s.'), $roomIndex);
}