From: Arcady G. <age...@th...> - 2004-05-25 22:48:34
|
Greetings: I am having problems with validating a form by the Controller. I have the following mappings defined: $mb = new UserMappingBuilder(); ... # The login form for the login action. $mb->addForm( 'login', 'LoginForm' ); # Login action takes a 'login' form, which is validated by the # Controller (redirect to login.php on validation failures). $mb->addAction( 'login', 'LoginAction', 'login', true, 'login.php' ); ... If the LoginForm::validate() method returns false, the controller redirects to "login.php&" instead of "login.php", which results in a 404 (File not found) error. I traced this to the following code in Phrame (file /local/packages/phrame/ActionController.php, in function _processValidate()): if (!$actionForm->validate()) { $input = $actionMapping->getInput(); //forward errors back to view header("Location: $input&".SID); $this->destroy(); $isValid = FALSE; } I see several problems with this: 1. Controller assumes that the redirection is always done to a path with some GET data already defined (i.e. that there is already a "?" in the redirection path). 2. The controller appends the SID even if the SID is passed in by other methods (i.e. in cookies). 3. I did not find the SID constant to be defined anywhere inside the Phrame's code. Is it expecting the constant to be defined elsewhere? Am I missing something? Many thanks, -- Arcady Genkin Culture saves nothing and nobody; nor does it justify. But it is a product of man: he projects himself onto it and recognises himself in it; this critical mirror alone shows him his image. Jean-Paul Sartre, ``Words'' |