Commit 0621d3cc authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(management) Support array value for attributes in a column

This fixes management configuration screen when a column needs a special
 attributes array, for instance because it contains a multi-valuated
 field.

issue #5135
parent cfcf20c1
......@@ -109,9 +109,8 @@ class ManagementConfigurationDialog extends simplePlugin
foreach ($columnInfos as $column) {
if (!isset($column[1]['attributes'])) {
$column[1]['attributes'] = '';
}
if (is_array($column[1]['attributes'])) {
$column[1]['attributes'] = implode(',', $column[1]['attributes']);
} elseif (is_array($column[1]['attributes'])) {
$column[1]['attributes'] = json_encode($column[1]['attributes']);
}
if (!isset($column[1]['label'])) {
$column[1]['label'] = '';
......@@ -160,7 +159,12 @@ class ManagementConfigurationDialog extends simplePlugin
foreach ($values as $value) {
$column = array($value[0], array());
if (!empty($value[1])) {
$column[1]['attributes'] = $value[1];
$jsonDecoded = json_decode($value[1], TRUE);
if ($jsonDecoded !== NULL) {
$column[1]['attributes'] = $jsonDecoded;
} else {
$column[1]['attributes'] = $value[1];
}
}
if (!empty($value[2])) {
$column[1]['label'] = $value[2];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment