From: Arnold C. <arn...@ya...> - 2003-01-13 16:06:16
|
The original hello example application would set the $_SESSION[_ERRORS] = NULL in the index.php file. The only other thing it might be is that currently Phrame only stores the errors from the last view processed. My development version of Phrame has support for multiple sets of errors indexed by property. I will also be adding my development version of Phrame into the sourceforge cvs. Does anyone have any ideas on a structure for the cvs tree? I am by no means a cvs guru so any input would be appreciated. Arnold --- Jason Sweat <jsw...@ya...> wrote: > I am having a problem with the applicaiton I coded > using phrame. I was working > fine, with 4 model classes, 4 form classes, 7 > actions and 5 view. I am in the > process of: > a) adding two new views and assosiated actions and > b) changing over to our PHP coding conventions (for > my applicaiton, not for the > libraries - but it does involve changing things like > the names of global > variables in my application like the $mappings > array). > > Suddenly, the application started clearing the > _ERRORS session object. It was > not undefined or missing, but rather a Stack object > with 0 items in the > _elements array. > > During debugging, I put the following code into the > ActionController::_processForward method: > > $redirect = $actionForward->getRedirect(); > $path = $actionForward->getPath(); > //debug code starts here > $err = &$_SESSION[_ERRORS]; > $s=urlencode($err->Peek()); > $err->Push('this is a test from inside > ActionController::_processForward'); > $_SESSION['errors2'] = &$err; > if (!$redirect) { > header("Location: $path&redir=$s"); > ... > > the redirect ends up going to a url that looks like: > admaint.php?view=usr&redir=Please+add+a+comment+to+at+least+one+user. > > Note the redir parameter indicated there was > something to Peek at in the $err > to begin with, even prior to adding the additional > item. > > I placed the following code at the top of the > redirected script, before > anything is even included in the script: > if (array_key_exists('redir',$_GET)) { > //include enough classes to make the error object > valid in the session > require_once('../phrame/util/Object.php'); > require_once('../phrame/util/ArrayList.php'); > require_once('../phrame/util/Stack.php'); > session_start(); > print "<pre>appl errors:\n"; > var_dump($_SESSION['_errors']); > print "copied errors:\n"; > var_dump($_SESSION['errors2']); > print"</pre>"; > } > > The resulting output from this script is: > appl errors: > object(stack)(1) { > ["_elements"]=> > array(0) { > } > } > copied errors: > object(stack)(1) { > ["_elements"]=> > array(2) { > [0]=> > string(42) "Please add a comment to at least one > user." > [1]=> > string(60) "this is a test from inside > ActionController::_processForward" > } > } > > > How can the original application errors vanish from > the session during the > redirect?!? > > Any insight would be much appreciated. > > Thanks. > > Jason > > > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up > now. > http://mailplus.yahoo.com > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = > Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Phrame-devel mailing list > Phr...@li... > https://lists.sourceforge.net/lists/listinfo/phrame-devel __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |