diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php | 4 | ||||
-rw-r--r-- | framework/Data/ActiveRecord/TActiveRecordGateway.php | 19 |
2 files changed, 13 insertions, 10 deletions
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php index 34f8a592..e47670ca 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php @@ -77,8 +77,8 @@ class TScaffoldListView extends TScaffoldBase public function onPreRender($param)
{
parent::onPreRender($param);
- if(!$this->getPage()->getIsPostBack())
- $this->initializeSort();
+ //if(!$this->getPage()->getIsPostBack())
+ $this->initializeSort();
$this->loadRecordData();
}
diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php index 80ce40c0..e081e19c 100644 --- a/framework/Data/ActiveRecord/TActiveRecordGateway.php +++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php @@ -93,21 +93,24 @@ class TActiveRecordGateway extends TComponent $key = $connStr.$tableName;
if(!isset($this->_tables[$key]))
{
+ //call this first to ensure that unserializing the cache
+ //will find the correct driver dependent classes.
+ if(!isset($this->_meta[$connStr]))
+ {
+ Prado::using('System.Data.Common.TDbMetaData');
+ $this->_meta[$connStr] = TDbMetaData::getInstance($connection);
+ }
+
$tableInfo = null;
if(($cache=$this->getManager()->getCache())!==null)
$tableInfo = $cache->get($key);
- if($tableInfo===null)
+ if(empty($tableInfo))
{
- if(!isset($this->_meta[$connStr]))
- {
- Prado::using('System.Data.Common.TDbMetaData');
- $this->_meta[$connStr] = TDbMetaData::getInstance($connection);
- }
$tableInfo = $this->_meta[$connStr]->getTableInfo($tableName);
+ if($cache!==null)
+ $cache->set($key, $tableInfo);
}
$this->_tables[$key] = $tableInfo;
- if($cache!==null)
- $cache->set($key, $tableInfo);
}
return $this->_tables[$key];
}
|