Fix latest merge

This commit is contained in:
Nicolas Le Goff
2014-07-17 15:11:26 +02:00
parent 3565d1c795
commit fcdc10c554
14 changed files with 100 additions and 26 deletions

View File

@@ -664,20 +664,24 @@ class databox extends base
try {
$metaStructData = $this->get_data_from_cache(self::CACHE_META_STRUCT);
} catch (\Exception $e) {
$sql = 'SELECT id, name FROM metadatas_structure ORDER BY sorter ASC';
$sql = 'SELECT id, `name` FROM metadatas_structure ORDER BY sorter ASC';
$stmt = $this->get_connection()->prepare($sql);
$stmt->execute();
$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) {
$this->meta_struct->add_element(databox_field::get_instance($this->app, $this, $row['id']));
if ($metaStructData) {
foreach ($metaStructData as $row) {
$this->meta_struct->add_element(databox_field::get_instance($this->app, $this, $row['id']));
}
}
return $this->meta_struct;