QFC Action_Display - oldPage check
| From: | Jeroen Houben | Date: | Mon, 08 Nov 2004 14:04:28 +0000 |
| Subject: | QFC Action_Display - oldPage check | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-34262@lists.php.net to get a copy of this message | ||
Hi,
In Action/Display.php there's the following line bit of code:
$pageName = $page->getAttribute('id');
// If the original action was 'display' and we have values in container then we load them
// BTW, if the page was invalid, we should later call validate() to get the errors
list(, $oldName) = $page->controller->getActionName();
if ('display' == $oldName) {
// If the controller is "modal" we should not allow direct access to a page
// unless all previous pages are valid (see also bug #2323)
if ($page->controller->isModal() && !$page->controller->isValid($page->getAttribute('id'))) {
$target =& $page->controller->getPage($page->controller->findInvalid());
$target->handle('jump');
}
$data =& $page->controller->container();
if (!empty($data['values'][$pageName])) {
$page->loadValues($data['values'][$pageName]);
$validate = false === $data['valid'][$pageName];
}
}
Why should we *only* load the container values if the original action was 'display' ? In some cases this extra IF block prevents me from doing what I want to do. An example:
I have a multipage form wizard. When something specfic goes wrong during the the final form processing I would like to display a particular page (not using Jump!). I can do this using $page->handle('display'), but then all the form data has disappeared because of this IF block.
I hope this makes sense. Any chance of getting rid of this IF block, or will this result on unwanted behaviour?
TIA
Jeroen