From dfe7a795b9037d9e5c8d1fb2cbf35a855c884d47 Mon Sep 17 00:00:00 2001 From: varun kewlani Date: Tue, 7 Apr 2026 17:26:12 +0530 Subject: [PATCH] further changes to avoid installation error --- .../classes/HotelHelper.php | 13 ------- .../classes/HotelReservationSystemDb.php | 35 ------------------- .../hotelreservationsystem.php | 1 - 3 files changed, 49 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 1484cefa4..28126125b 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -1776,7 +1776,6 @@ class HotelHelper $roomTypeDemoDataLang = array( array( 'price' => 1000, - 'id_bed_types' => array(4), 'en' => array( 'name' => 'General Rooms', 'description_short' => 'Our General Rooms offer space and comfort with multiple bedrooms and a cozy living area. Enjoy flat-screen TVs, complimentary Wi-Fi, and a kitchenette for a perfect family getaway.', @@ -1810,7 +1809,6 @@ class HotelHelper ), array( 'price' => 1500, - 'id_bed_types' => array(4, 5), 'en' => array( 'name' => 'Delux Rooms', 'description_short' => 'Enjoy lake views from our Deluxe Rooms with a king-sized bed, elegant furnishings, and a spacious sitting area. Perfect for guests seeking comfort, luxury, and modern amenities.', @@ -1844,7 +1842,6 @@ class HotelHelper ), array( 'price' => 2000, - 'id_bed_types' => array(5, 6), 'en' => array( 'name' => 'Executive Rooms', 'description_short' => 'Indulge in our Executive Rooms, featuring separate living and sleeping areas, a luxurious bathroom, and exclusive lounge access. Ideal for business travelers seeking privacy', @@ -1878,7 +1875,6 @@ class HotelHelper ), array( 'price' => 2500, - 'id_bed_types' => array(6, 8), 'en' => array( 'name' => 'Luxury Rooms', 'description_short' => 'Retreat to tranquility in our Luxury Rooms with expansive views. Featuring a queen-sized bed, workspace, and serene decor, perfect for business and leisure travelers alike.', @@ -1912,7 +1908,6 @@ class HotelHelper ), ); - $objHotelRoomTypeBedType = new HotelRoomTypeBedType(); $languages = Language::getLanguages(true); foreach ($roomTypeDemoDataLang as $key => $roomTypeData) { // Add Product @@ -2033,16 +2028,8 @@ class HotelHelper $htl_rm_type->save(); - // Add features to the product - $ftr_arr = array(0 => 1, 1 => 2, 2 => 3, 3 => 4); - $ftr_val_arr = array(0 => 1, 1 => 2, 2 => 3, 3 => 4); - foreach ($ftr_arr as $key_htl_ftr => $val_htl_ftr) { - $product->addFeaturesToDB($val_htl_ftr, $ftr_val_arr[$key_htl_ftr]); - } - // save advance payment information $this->saveAdvancedPaymentInfo($product_id); - $objHotelRoomTypeBedType->updateRoomTypeBedTypes($roomTypeData['id_bed_types'], $product_id); } } diff --git a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php index ea81fa565..a42075115 100644 --- a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php +++ b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php @@ -561,41 +561,6 @@ class HotelReservationSystemDb return true; } - /** - * Applies the schema changes required for the dynamic room feature migration. - * - * @return bool - */ - public function migrateToDynamicRoomFeatureSchema() - { - $sql = array( - 'UPDATE `'._DB_PREFIX_.'htl_branch_features` SET `feature_id` = NULL WHERE `feature_id` = ""', - 'ALTER TABLE `'._DB_PREFIX_.'htl_branch_features` - MODIFY `feature_id` int(10) unsigned DEFAULT NULL', - 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'htl_room_type_features` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `id_product` int(10) unsigned NOT NULL, - `feature_id` int(10) unsigned NOT NULL, - `date_add` datetime NOT NULL, - `date_upd` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `id_product` (`id_product`), - KEY `feature_id` (`feature_id`) - ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1', - 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'htl_room_type_bed_type`', - 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'htl_bed_type_lang`', - 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'htl_bed_type`', - ); - - foreach ($sql as $query) { - if (!Db::getInstance()->execute($query)) { - return false; - } - } - - return true; - } - public function dropTables() { return Db::getInstance()->execute( diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index 35f1bdfe2..e93e65719 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -603,7 +603,6 @@ class HotelReservationSystem extends Module $objHtlHelper = new HotelHelper(); if (!parent::install() || !$objModuleDb->createTables() - || !$objModuleDb->migrateToDynamicRoomFeatureSchema() || !$this->registerModuleHooks() || !$this->callInstallTab() || !$objHtlHelper->insertDefaultHotelEntries()