fix: switch between code and visual for custom forms

This commit is contained in:
2025-12-02 20:03:33 +03:00
parent dd12cb8c34
commit 0ab09aad10
5 changed files with 415 additions and 107 deletions

View File

@@ -79,7 +79,12 @@ class SettingsHandler
if ($forms) {
foreach ($forms as $form) {
$schema = json_decode($form['schema'], true, 512, JSON_THROW_ON_ERROR);
try {
$schema = json_decode($form['schema'] ?? '[]', true, 512, JSON_THROW_ON_ERROR);
} catch (\JsonException $exception) {
$schema = [];
}
$data['forms'][$form['alias']] = [
'alias' => $form['alias'],
'friendly_name' => $form['friendly_name'],