Hi,

I'm using this nice module with Webform 7.x-4.0-beta1 and everything works well except that if Clean URLs are not enabled, submiting the Booking formlet does not redirect to the specified page (webform).

Everything's fine with Clean URL Enabled, but I need to build a test site without Clean URL's...

Thanks

Comments

fietserwin’s picture

Not sure that this is an error in this module. I use the url() function (in common.inc) and its help says that non-clean URLs are supported:

 *   - 'script': The script filename in Drupal's root directory to use when
 *     clean URLs are disabled, such as 'index.php'. Defaults to an empty
 *     string, as most modern web servers automatically find 'index.php'. If
 *     clean URLs are disabled, the value of $path is appended as query
 *     parameter 'q' to $options['script'] in the returned URL. When deploying
 *     Drupal on a web server that cannot be configured to automatically find
 *     index.php, then hook_url_outbound_alter() can be implemented to force
 *     this value to 'index.php'.

How did you specify the "URL to continue the booking" and what does your form tag (in the rendered html) look like? (more specifically, the action and method attributes)

drupix’s picture

Hi,

Thanks for the quick reply.

Effectivelly, I'm not sure that this is an error of your module, but...

I have tried to find the problem by myself, and I saw that the module use the url() function. When the form is displayed, the action looks correct but...

I repeat that with Clean URL's enabled all works fine. Nothing seems strange if I inspect the form with firebug

My site is multi language (en-fr).
I have a Content type "Availability calendar page" with both "Availability Calendar" and "Availability Calendar Booking formlet" fields.
The "URL to continue the booking" is specified as follow (links to capture_1.png)

I have a Webform with neutral language (if possible I don't want a form for each language) and a path set to "booking" and available for All language.

What else...?

You can see this in action here: http://la-pineta.drupal-solutions.ch/?q=en/availability

Thank for the help.

fietserwin’s picture

If I change the GET to a POST (in the browser's developer tools), it works. Apparently, the query part is stripped off when a form action is executed via a GET??! (Chrome, FF and IE do so)

If so, I'm afraid I can't do anything to prevent that. You could try adding the q as a form field... (that would be 1 of the better hacks I've seen lately :)

The http spec does not specifically mention this case but says:

If the method is "get" and the action is an HTTP URI, the user agent takes the value of action, appends a `?' to it, then appends the form data set, encoded using the "application/x-www-form-urlencoded" content type. The user agent then traverses the link to this URI. In this scenario, form data are restricted to ASCII codes.

Adding another ? is not correct, so this spec does not describe what to do in your case.

drupix’s picture

Ok, I haded q as a form field and it works.

Thanks for the help and information.

drupix’s picture

Status: Active » Closed (fixed)
fietserwin’s picture

I love it when a plan comes together :)