From 6773dfe453682d2b39a26fbabef8e706bf6bb412 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 26 Nov 2006 14:59:51 +0000 Subject: Merge from 3.0 branch till 1513. --- HISTORY | 5 ++++- framework/TApplication.php | 9 ++++++--- framework/Web/TUrlMapping.php | 2 +- framework/Web/UI/WebControls/TBaseValidator.php | 24 +++++++++++++----------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/HISTORY b/HISTORY index 0f07bb13..b66712cc 100644 --- a/HISTORY +++ b/HISTORY @@ -18,10 +18,13 @@ CHG: All validators ClientSide.OnError becomes ClientSide.OnValidationError, and Version 3.0.6 December 4, 2006 ============================== BUG: Ticket#442 - TPageService getBasePath in namespace form (Qiang) +BUG: Ticket#467 - typo in TUrlMapping.php (Qiang) BUG: TTableCell should render   only when Text is not set and there's no child (Qiang) +BUG: global state was not saved when redirect() is invoked (Qiang) ENH: Ticket#446 - Added TMetaTagCollection.getMetaTagByID method (Qiang) CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) -CHG: Ticket#454 - Redundant PHP Version Check +CHG: Ticket#454 - Redundant PHP Version Check (Qiang) +CHG: Ticket#460 - Validators will not perform validation if parents are disabled (Qiang) CHG: TRepeater does not render anymore for empty item template (Qiang) CHG: THttpRequest.constructUrl() now encodes ampersand by default (Qiang) diff --git a/framework/TApplication.php b/framework/TApplication.php index 974f0ec4..ce05893b 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -437,9 +437,11 @@ class TApplication extends TComponent */ protected function saveGlobals() { - if(!$this->_stateChanged) - return; - $this->getApplicationStatePersister()->save($this->_globals); + if($this->_stateChanged) + { + $this->_stateChanged=false; + $this->getApplicationStatePersister()->save($this->_globals); + } } /** @@ -1035,6 +1037,7 @@ class TApplication extends TComponent */ public function onEndRequest() { + $this->saveGlobals(); // save global state $this->raiseEvent('OnEndRequest',$this,null); } } diff --git a/framework/Web/TUrlMapping.php b/framework/Web/TUrlMapping.php index a4c662a9..5bfd8a42 100644 --- a/framework/Web/TUrlMapping.php +++ b/framework/Web/TUrlMapping.php @@ -334,7 +334,7 @@ class TUrlMappingPattern extends TComponent */ public function setRegularExpression($value) { - $this->_regexp; + $this->_regexp=$value; } /** diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index 626bf13e..785282da 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -482,20 +482,22 @@ abstract class TBaseValidator extends TLabel implements IValidator */ public function validate() { - if($visible=$this->getVisible(true)) - $this->onValidate(); $this->setIsValid(true); - if($this->getValidationTarget() && $visible && $this->getEnabled()) + if($this->getVisible(true) && $this->getEnabled(true)) { - if($this->evaluateIsValid()) - { - $this->setIsValid(true); - $this->onValidationSuccess(); - } - else + $this->onValidate(); + if($this->getValidationTarget()) { - $this->setIsValid(false); - $this->onValidationError(); + if($this->evaluateIsValid()) + { + $this->setIsValid(true); + $this->onValidationSuccess(); + } + else + { + $this->setIsValid(false); + $this->onValidationError(); + } } } return $this->getIsValid(); -- cgit v1.2.3