Hi,

Upgraded from 7.x-4.x to 7.x-5.x and being able to pass the departure date to the booking formlet as a GET or POST variable seems to have stopped working. I had to disable javascript to get the settings button to show the settings on the Manage Display page. Source for Begin Date works fine. For Source for the End Date I see 'GET value as departure date' but doesn't seem to set the value correctly

Thanks as always for this great module!

Comments

codesmith’s picture

Component: Code » Booking formlet

Part of the issue with the Display preferences is that this line (around 402) in availability_calendar_booking_formlet.module

$source = substr($settings['preset_end_date_source'], 0, strpos($settings['preset_end_date_source'], '_'));

I think should be

$source = substr($settings['preset_end_date_source'], 0, strpos($settings['preset_end_date_source'], '1'));

Still sleuthing why the form doesn't seem to be picking up the passed in departure date correctly...

codesmith’s picture

The issue in #1 is a bug but minor -- just the display settings. I found my problem. When passing in dates to the booking formlet and even when going back to the formlet from the web form booking page I get a javascript error in availability_calendar_booking_formlet.js around line 247.

while (date <= to && calendarView.isSelectable(date)) {

This is throwing a javascript error

Uncaught TypeError: Cannot call method 'isSelectable' of undefined

So I think this might be because calendarView hasn't fully initialized when it gets to this part of the code.

codesmith’s picture

Any thoughts? Thanks.

fietserwin’s picture

Version: 7.x-5.x-dev » 7.x-4.x-dev
Status: Active » Fixed

Thanks for reporting and debugging and sorry for not reacting earlier, time did not permit me having a look at this earlier. I solved both errors, the minor in the summary theme and the error in js.

Please note:
- I solved the bugs in 7.x-4.x-dev first.
- Today I will release 7.x-4.2 containing this bug fix.
- This will be the last version in the 7.x-4.x branch.
- From now on I will continue to work in the 7.x-5.x branch, which, btw, contains all changes (mainly bug fixes) from the 7.x-4.x branch since its original creation,
- So I will also release a 7.x-5.1 version shortly.

  • Commit 1438e44 on 7.x-4.x by fietserwin:
    [#2226929]: Can't set Default departure date in booking formlet display...

  • Commit 1438e44 on 7.x-4.x, 7.x-5.x by fietserwin:
    [#2226929]: Can't set Default departure date in booking formlet display...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.