use correct array-structure for output of preconfig

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-05-01 16:57:52 +02:00
parent c59c5efc11
commit 54b467887b
3 changed files with 6 additions and 8 deletions

View File

@@ -61,7 +61,9 @@ class Preconfig
*/
public function addToPreConfig(array $array)
{
$this->preconfig_data = $this->preconfig_data + $array;
if (isset($array['title']) && isset($array['fields']) && count($array['fields']) > 0) {
$this->preconfig_data[] = $array;
}
}
/**
@@ -103,11 +105,8 @@ class Preconfig
'update_preconfig' => ['type' => 'hidden', 'value' => 1]
]
];
$result = [
$preconfig->getData(),
$agree
];
return $result;
$preconfig->addToPreConfig($agree);
return $preconfig->getData();
}
return [];
}