1792 Posts in 588 Topics by 560 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1430 Views |
-
Did something change in form action execution ?

5 July 2009 at 12:58am
Hi,
I see in the wiki that action methods looked like this:
function doform($data, $form) {
// ... you already made this ...
}but in 2.3.2 they seam to be executed like this:
function doform($httpRequest) {
// ... you already made this ...
}is this the new default behavior or em I missing something?
-
Re: Did something change in form action execution ?

5 July 2009 at 11:00am
No this hasn't changed. You should still use doForm($data, $form) for 2.3 sites. If some has updated the documentation with that change then it is wrong. A major API change like this would not be part of a point release like 2.3.2.
-
Re: Did something change in form action execution ?

5 July 2009 at 12:45pm Last edited: 5 July 2009 12:45pm
Hmmm then I don't understand something.
My action methods seam to be called with only the HttpRequest argument.
I look in the the Controller.php to check this and I also see:function handleAction($request) {
//...
// run & init are manually disabled, because they create infinite loops and other dodgy situations
if($this->checkAccessAction($this->action) && !in_array(strtolower($this->action), array('run', 'init'))) {
if($this->hasMethod($methodName)) {
$result = $this->$methodName($re;'quest);
//...shouldn't the line
$result = $this->$methodName($request);
look somewhat like this
$result = $this->$methodName($data, $form);
or em I looking in the wrong place ?
-
Re: Did something change in form action execution ?

7 July 2009 at 11:21am
Just found what caused my problem
I don't know why but I added my doform method to the $allowed_actions variable. Sorry for the false alarm.
Meanwhile while doing my first bigger form I stumbled for a few hours with another mistake of mine. I didn't make the form name the same as the name of the controller method that generates it. Could you add a remark on the wiki about this like:
function Form() {
return new Form($this,
// the name of the form MUST be the same
// as the name of the method that generates it
"Form",
new FieldSet(
//...otherwise the $form argument won't get initialized properly in the doform method.
| 1430 Views | ||
|
Page:
1
|
Go to Top |


