Closed (fixed)
Project:
Hotel Booking System for Ubercart
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2011 at 11:05 UTC
Updated:
19 Dec 2012 at 15:29 UTC
Jump to comment: Most recent file
Comments
Comment #1
larowlanHi
Is the calendar showing the room as available?
Do you have a rate set for those dates?
The date module is changing about so rapidly and dramatically that it is possible that something has moved upstream...
Lee
Comment #2
gkazhus commentedHi,
Yes calendar shows rooms available and also I have set rates for those dates. But I have one more problem that I cant edit availability in calendar too. It left default.
Comment #3
gkazhus commentedIs here any news in this problem how to solve?
Comment #4
larowlanHi
I've not had time to try and replicate this on my install yet.
Will keep you posted.
Any more debugging info you can provide would be great.
Lee
Comment #5
j1mb0b commentedIf I leave check-in date as defaulted value and make sure there is availability and a rate for that date it adds the room to the cart. If I replicate this for a date In the future I receive this message: The room is not available for this date. Even though on the calendar it is set to available with the rate. It is very annoying this issue as it seems it would be an easy fix if only I new!!
Comment #6
larowlanI think something has changed in the date module. In my test an attempt to book one night ended up booking 366!
Comment #7
j1mb0b commentedThank you larowlan I suspected that was the case, I just rolled back the date module to the april release and it works!
Comment #8
manicato commentedIn the file hotel_booking.util.inc in line 483 :
$last_dt = new DateObject($check_in, date_default_timezone(), DATE_FORMAT_ISO);
This returns not the check-In date but today's date! $check_in has the correct date. So it's 100% because of the date module.
But I can't find in which file DateObject is declared.
Comment #9
larowlanHi
The format of the arguments must have changed...
Comment #10
manicato commentedInto what?
Comment #11
larowlanwhat format is $check_in?
They've changed DATE_ISO to DATE_FORMAT_ISO before, maybe they've gone back again - or maybe I've missed somewhere in the file and still have DATE_ISO.
Looking at the date project page, it looks like we're doing it right so $check_in must be in the wrong format, in which case it might be the format of the 'date_popup' field defined on the checkout form in hotel_booking_search_form.
Lee
Comment #12
dazrour commentedI am having the same issue. I get the same issue whichever version of Date I use. Could the date format setting in drupal affect this?
Some more info:
I have been playing around with different versions of both Date and uc_hotel. Using the latest dev version of date 7.2 and the alpha version of uc_hotel I can set room availabilities and the calendars update to show the available rooms, however the date picker does not. Also if i select a date which is available it responds saying not available, but leaving it on tomorrows date (default date when page loads) it lets me add it cart but adds 366 nights.
I have looked at the hotel_booking.module and the hotel_booking.util.inc files and it would seem all of the date_format_iso v date_iso seem correct. Have you had chance to have a look at this?
I did try to get the version of date which the docs suggest but past dev versions are not available for download.
Thanks
Darren
Comment #13
sylvainblot commentedaccording to the date module code:
define('DATE_ISO', 'date');
define('DATE_UNIX', 'datestamp');
define('DATE_DATETIME', 'datetime');
define('DATE_ARRAY', 'array');
define('DATE_OBJECT', 'object');
define('DATE_ICAL', 'ical');
define('DATE_FORMAT_ISO', "Y-m-d\TH:i:s");
define('DATE_FORMAT_UNIX', "U");
define('DATE_FORMAT_DATETIME', "Y-m-d H:i:s");
define('DATE_FORMAT_ICAL', "Ymd\THis");
define('DATE_FORMAT_ICAL_DATE', "Ymd");
define('DATE_FORMAT_DATE', 'Y-m-d');
define('DATE_REGEX_ISO', '/(\d{4})?(-(\d{2}))?(-(\d{2}))?([T\s](\d{2}))?(:(\d{2}))?(:(\d{2}))?/');
define('DATE_REGEX_DATETIME', '/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):?(\d{2})?/');
define('DATE_REGEX_LOOSE', '/(\d{4})-?(\d{1,2})-?(\d{1,2})([T\s]?(\d{2}):?(\d{2}):?(\d{2})?(\.\d+)?(Z|[\+\-]\d{2}:?\d{2})?)?/');
define('DATE_REGEX_ICAL_DATE', '/(\d{4})(\d{2})(\d{2})/');
define('DATE_REGEX_ICAL_DATETIME', '/(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?/');
So for that line it should be DATE_FORMAT_DATE anyway I found this problem in lot of DateObject usage, I fixed most of them but I still have the issue. Any help ?
Comment #14
sylvainblot commentedThere is also
hotel_booking.util.inc
422: $start_date = new DateObject($check_in, date_default_timezone(), DATE_FORMAT_DATE);
423: $end_date = new DateObject($check_out, date_default_timezone(), DATE_FORMAT_DATETIME);
and a couple more, I will prepare a patch.
Comment #15
sylvainblot commentedworking in my install
Comment #16
larowlan@manicato, @dazrour, @kingmackenzie, @gkazhus - does this patch sort the issues for you?
Please report testing results here and if all good I'll commit and re-roll a beta2
Comment #17
sylvainblot commentedIve found a couple more argument errors
Here is a better patch.
Comment #18
_boban commentedIt solve the issue with date-7.x-2.0-alpha4.
Comment #19
requiem08 commentedsylvainblot .. How will I use the patch? newbie here!
Comment #20
larowlan@requiem08 http://drupal.org/patch
Will try and roll a new version some time between now and weekend.
Comment #21
phuongnam3k commentedhi,
I'm using Date 7.x-2.0-alpha4 but still get the issue like always show 366 nights at shopping cart. which patch fixed it already? and how to apply a patch? (im using window not linux)
Please help me.
Best regards,
PS: Sorry my bad english
Comment #22
sylvainblot commented@phuongnam3k use the latest patch #17
to patch on windows: http://drupal.org/node/60179
Comment #23
phuongnam3k commentedthanks so much sylvainblot,
it works! you save my life. :)
Comment #24
phuongnam3k commentedhi,
the patch work fine but there is 1 problem:
-First, I book 1 room
-Then add 1 product (such as: wifi)
-If I remove room first then product then it works fine but I remove product first then it raise an error.
Notice: Undefined index: qty in uc_cart_update_item_object() (line 1555 of F:\wamp\www\WBE\sites\all\modules\ubercart\uc_cart\uc_cart.module)...
What can be done to solve this?
PS:sorry my bad English
Comment #25
sylvainblot commented@phuongnam3k Comment this:
# else {
# db_update("uc_cart_products")
# ->fields(array(
# 'qty' => $qty,
# 'changed' => REQUEST_TIME
# ))
# ->condition('nid', $nid)
# ->condition('cart_id', $cid)
# ->condition('data', serialize($data))
# ->execute();
# }
in hotel_booking.ubercart.inc in the hotel_booking_uc_update_cart_item function
Comment #26
sylvainblot commentedThere is some other date issues in the hotel_booking_availability_calendars iSO => DATETIME
Comment #27
requiem08 commentedHi!! I just have a problem on adding base rate and adding hotel room type.. I added a base rate 1500.00 in the whole month of November, then I created a hotel room type, and apply my base rate.. when I hit save.. I get an error stating:
PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'from_rate' at row 1: UPDATE {hotel_booking_room_types} SET from_rate=:db_update_placeholder_0 WHERE (nid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => 1500.000 [:db_condition_placeholder_0] => 23 ) in hotel_booking_set_room_from_rate() (line 545 of C:\wamp\www\Balai Gloria\sites\all\modules\uc_hotel\hotel_booking\hotel_booking.util.inc).
..
how will I resolve this.. ?? I'm using Drupal 8 anyway Help me please..
Comment #28
gkazhus commentedI have the same issue what mentioned in #24, even when I commented your mentioned #25 lines error still appears, and can remove unwanted items from chart.
Comment #29
larowlanCan I get an update on the status of this patch?
Anyone using it successfully?
Comment #30
larowlanFixed in dev release
Comment #32
JAScarb commentedHi
I have this bug today (but I didn't have it a couple of days ago and I haven't changed anything).
Should I move to the dev version, I was hoping to use this 'live'?
Either that or .. what do I do to implement the patch (on Linux)?
All the best
J
PS. I also have the 365 day booking problem, but maybe that's for another day.
Comment #33
JAScarb commentedSorry, I meant to give the versions: Drupal 7.15, Ubercart 7.x-3.1, Hotel Booking 7.x-1.0-beta1
Comment #34
larowlanThis is fixed in the -dev version.
Comment #36
giupenni commentedWill be fixed in beta version?