Closed (fixed)
Project:
Webform
Version:
6.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2009 at 21:37 UTC
Updated:
9 Feb 2010 at 04:00 UTC
Jump to comment: Most recent file
In a custom module of my own, I modify the menu structure extensively. As a result, code which relies on the arg() function can sometimes break.
There is technically nothing wrong with using arg(), but I wonder if, in the interest of improving compatibility and consistency in the webform code, an instance of arg() in webform could be replaced?
In this case, it's in webform_client_form(), where this sequence:
// Set the form action to the node ID in case this is being displayed on the
// teaser, subsequent pages should be on the node page directly.
if (arg(2) != 'submission') {
$form['#action'] = url('node/'. $node->nid);
}
can easily be changed to:
if (!$submission) {
...
Not only will this work equally as well, it is also more consistent with the rest of the function, which relies on the presence/absence of $submission to make decisions about what to display.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | webform_remove_arg_check.patch | 631 bytes | quicksketch |
| webform_client_form_arg.patch | 441 bytes | gribnif |
Comments
Comment #1
quicksketchMakes sense to me. This might have some negative effects on the 3.x version when placing a Webform in a block, but we can work those out in the 3.x branch. Committed attached patch to 2.x and 3.x.