This commit is contained in:
2026-01-20 21:26:15 +01:00
parent 03452ce973
commit 004af588e4
2 changed files with 12 additions and 14 deletions

View File

@@ -954,19 +954,17 @@ class ApiKernel
return;
}
if (!empty($section['is_template'])) {
$versionCols = array_filter([$jsonCol, $htmlCol, $craftCol, $settingsCol, $editorCol]);
$shouldSnapshot = false;
foreach ($versionCols as $col) {
if (array_key_exists($col, $data)) {
$shouldSnapshot = true;
break;
}
}
if ($shouldSnapshot) {
$this->createContentVersion($current, $itemCols, $customerId, (int)($section['id'] ?? 0));
$versionCols = array_filter([$jsonCol, $htmlCol, $craftCol, $settingsCol, $editorCol]);
$shouldSnapshot = false;
foreach ($versionCols as $col) {
if (array_key_exists($col, $data)) {
$shouldSnapshot = true;
break;
}
}
if ($shouldSnapshot) {
$this->createContentVersion($current, $itemCols, $customerId, (int)($section['id'] ?? 0));
}
$set = implode(',', array_map(static fn($c) => "`$c` = :$c", array_keys($data)));
$data['id'] = $id;