From c063fa695bb4035072b13a7e8e6825fe91b9fe69 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Mon, 2 Feb 2026 23:08:53 +0100 Subject: [PATCH] asdasd --- config/current.ver | 2 +- src/ApiKernel.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/config/current.ver b/config/current.ver index 434dcac..732aa7d 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.2.9 \ No newline at end of file +1.2.10 \ No newline at end of file diff --git a/src/ApiKernel.php b/src/ApiKernel.php index 50e8dc0..cc3eef4 100644 --- a/src/ApiKernel.php +++ b/src/ApiKernel.php @@ -2266,6 +2266,7 @@ class ApiKernel $htmlCol = $itemCols['html']; $jsonCol = $itemCols['json']; $craftCol = $itemCols['craft']; + $settingsCol = $itemCols['settings']; $versionsTable = $this->contentVersionsTable(); $versionCols = ($this->tableExists($versionsTable)) ? $this->resolveContentVersionColumns($versionsTable) : null; @@ -2273,11 +2274,13 @@ class ApiKernel $versionJsonCol = $versionCols['json'] ?? null; $versionCraftCol = $versionCols['craft'] ?? null; $versionActiveCol = $versionCols['is_active'] ?? null; + $versionSettingsCol = $versionCols['settings'] ?? null; $select = "i.`id` AS id, i.`name` AS name"; if ($htmlCol) $select .= ", i.`$htmlCol` AS item_html"; if ($jsonCol) $select .= ", i.`$jsonCol` AS item_json"; if ($craftCol) $select .= ", i.`$craftCol` AS item_craft"; + if ($settingsCol) $select .= ", i.`$settingsCol` AS item_settings"; $join = ''; $hasVersionJoin = $versionActiveCol && ($versionHtmlCol || $versionJsonCol || $versionCraftCol); if ($hasVersionJoin) { @@ -2292,6 +2295,9 @@ class ApiKernel if ($versionCraftCol && $versionActiveCol) { $select .= ", v.`$versionCraftCol` AS version_craft"; } + if ($versionSettingsCol && $versionActiveCol) { + $select .= ", v.`$versionSettingsCol` AS version_settings"; + } $sql = "SELECT $select FROM `$itemsTable` i $join WHERE i.`customer_id` = :cid AND i.`section_id` = :sid AND i.`id` <> :id"; $stmt = $this->pdo->prepare($sql); $stmt->execute([':cid' => $customerId, ':sid' => (int)$section['id'], ':id' => $templateId]); @@ -2305,6 +2311,8 @@ class ApiKernel (string)($row['item_json'] ?? ''), (string)($row['version_craft'] ?? ''), (string)($row['item_craft'] ?? ''), + (string)($row['version_settings'] ?? ''), + (string)($row['item_settings'] ?? ''), ]; $found = false; foreach ($blobs as $blob) { @@ -2329,13 +2337,15 @@ class ApiKernel $htmlCol = $this->firstExisting($allCols, ['html', 'body', 'markup', 'content']); $jsonCol = $this->firstExisting($allCols, ['json_content']); $craftCol = $this->firstExisting($allCols, ['craft_json', 'craft_content', 'craft_data']); - if ($htmlCol || $jsonCol || $craftCol) { + $settingsCol = $this->firstExisting($allCols, ['settings_json', 'settings']); + if ($htmlCol || $jsonCol || $craftCol || $settingsCol) { $nameCol = $this->conf['columns']['templates']['name'] ?? ($this->firstExisting($allCols, ['name']) ?: $idCol); [$tw, $tp] = $this->tenantWhere(['customer_id' => $customerId]); $select = "`$idCol` AS id, `$nameCol` AS name"; if ($htmlCol) $select .= ", `$htmlCol` AS html"; if ($jsonCol) $select .= ", `$jsonCol` AS json"; if ($craftCol) $select .= ", `$craftCol` AS craft"; + if ($settingsCol) $select .= ", `$settingsCol` AS settings"; $sql = "SELECT $select FROM `$table` WHERE `$idCol` <> :id" . $tw; $stmt = $this->pdo->prepare($sql); $stmt->bindValue(':id', $templateId, PDO::PARAM_INT); @@ -2347,6 +2357,7 @@ class ApiKernel (string)($row['html'] ?? ''), (string)($row['json'] ?? ''), (string)($row['craft'] ?? ''), + (string)($row['settings'] ?? ''), ]; $found = false; foreach ($blobs as $blob) {