From: Jason S. <jsw...@ya...> - 2003-01-13 04:43:39
|
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 |