From 5ffc000172dbf91c8efe696be90b4b23da00900d Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Sun, 7 Dec 2025 01:12:43 +0100 Subject: [PATCH] ab --- src/ApiKernel.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ApiKernel.php b/src/ApiKernel.php index da3e01f..b080128 100644 --- a/src/ApiKernel.php +++ b/src/ApiKernel.php @@ -424,7 +424,13 @@ class ApiKernel $desc = (string)$this->val($this->in, ['description', 'desc'], null); $cat = (string)$this->val($this->in, ['category', 'cat'], null); $html = (string)$this->val($this->in, ['html', 'body', 'markup'], null); - $json = $this->val($this->in, ['content_json', 'json', 'content', 'structure_json'], null); + if ($kind === 'snippets' && ($html === null || $html === '')) { + $html = (string)$this->val($this->in, ['content'], $html); + } + $jsonKeys = ($kind === 'snippets') + ? ['content_json', 'json', 'structure_json'] + : ['content_json', 'json', 'content', 'structure_json']; + $json = $this->val($this->in, $jsonKeys, null); $settings = $this->val($this->in, ['settings_json', 'settings'], null); $templateId = $this->val($this->in, ['template_id', 'tpl_id'], null); $sectionId = $this->val($this->in, ['section_id', 'sec_id'], null); @@ -514,7 +520,13 @@ class ApiKernel $desc = $this->val($this->in, ['description', 'desc'], null); $cat = $this->val($this->in, ['category', 'cat'], null); $html = $this->val($this->in, ['html', 'body', 'markup'], null); - $json = $this->val($this->in, ['content_json', 'json', 'content', 'structure_json'], null); + if ($kind === 'snippets' && $html === null) { + $html = $this->val($this->in, ['content'], null); + } + $jsonKeys = ($kind === 'snippets') + ? ['content_json', 'json', 'structure_json'] + : ['content_json', 'json', 'content', 'structure_json']; + $json = $this->val($this->in, $jsonKeys, null); $settings = $this->val($this->in, ['settings_json', 'settings'], null); if ($name !== null) $data[$nameCol] = (string)$name;