Löschen/Deaktivierung

This commit is contained in:
2026-02-01 01:43:12 +01:00
parent f98b3836ce
commit a72d50ced8
4 changed files with 5 additions and 5 deletions

View File

@@ -1 +1 @@
1.2.4
1.2.5

View File

@@ -1063,7 +1063,7 @@ export function initEditor() {
function isTemplateSection() {
if (current?.section?.is_template) return true;
const slug = (current?.section?.slug || '').toString().toLowerCase();
return slug === 'emailtemplate';
return slug === 'emailtemplate' || slug.includes('template');
}
async function confirmTemplateReferences(actionLabel) {

View File

@@ -91,7 +91,7 @@ async function openTemplateManager(item, section) {
const isTemplateSection = () => {
if (section?.is_template) return true;
const slug = (section?.slug || '').toString().toLowerCase();
return slug === 'emailtemplate';
return slug === 'emailtemplate' || slug.includes('template');
};
const fetchTemplateReferences = async () => {

View File

@@ -2350,9 +2350,9 @@ class ApiKernel
$templateItemsTable = $this->lookupTableName('template_items', 'emailtemplate_template_items');
if ($this->tableExists($templateItemsTable)) {
$sql = "SELECT DISTINCT `template_id` FROM `$templateItemsTable` WHERE `customer_id` = :cid AND `ref_type` = :rt AND `ref_id` = :rid";
$sql = "SELECT DISTINCT `template_id` FROM `$templateItemsTable` WHERE `customer_id` = :cid AND `ref_type` IN ('section','template') AND `ref_id` = :rid";
$stmt = $this->pdo->prepare($sql);
$stmt->execute([':cid' => $customerId, ':rt' => 'section', ':rid' => $templateId]);
$stmt->execute([':cid' => $customerId, ':rid' => $templateId]);
$ids = array_filter(array_map('intval', array_column($stmt->fetchAll() ?: [], 'template_id')));
if ($ids) {
if ($this->useUnifiedContent()) {