Fix #1007 : Upgrade from 3.5 may lose metadatas

This commit is contained in:
Romain Neutron
2012-12-13 17:38:19 +01:00
parent 35afdf40e2
commit 5b22c82baa

View File

@@ -192,14 +192,14 @@ class Step35 implements DatasUpgraderInterface
foreach ($datas as $meta_struct_id => $values) { foreach ($datas as $meta_struct_id => $values) {
if (is_array($values)) { if (is_array($values)) {
foreach ($values as $value) { foreach ($values as $value) {
$metadatas[$meta_struct_id] = array( $metadatas[] = array(
'meta_struct_id' => $meta_struct_id 'meta_struct_id' => $meta_struct_id
, 'meta_id' => null , 'meta_id' => null
, 'value' => $value , 'value' => $value
); );
} }
} else { } else {
$metadatas[$meta_struct_id] = array( $metadatas[] = array(
'meta_struct_id' => $meta_struct_id 'meta_struct_id' => $meta_struct_id
, 'meta_id' => null , 'meta_id' => null
, 'value' => $values , 'value' => $values