Fix tests

This commit is contained in:
Nicolas Le Goff
2014-11-19 12:39:42 +01:00
parent 7d44a356e3
commit 2000f4116f
4 changed files with 15 additions and 11 deletions

View File

@@ -672,6 +672,8 @@ class databox extends base
*/
public function get_meta_structure()
{
$metaStructData = array();
if ($this->meta_struct) {
return $this->meta_struct;
}
@@ -685,13 +687,15 @@ class databox extends base
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$metaStructData = $rs;
$this->set_data_to_cache($metaStructData, self::CACHE_META_STRUCT);
if ($rs) {
$metaStructData = $rs;
$this->set_data_to_cache($metaStructData, self::CACHE_META_STRUCT);
}
}
$this->meta_struct = new databox_descriptionStructure();
foreach ($metaStructData as $row) {
foreach ((array) $metaStructData as $row) {
$this->meta_struct->add_element(databox_field::get_instance($this->app, $this, $row['id']));
}