From 8801a8ba32c2553156d4326f5513b10e4f7f8864 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Tue, 24 Feb 2026 01:42:30 +0100 Subject: [PATCH] testversand --- public/assets/js/ui-editor.js | 10 ++++++---- public/assets/js/ui-list.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/public/assets/js/ui-editor.js b/public/assets/js/ui-editor.js index ae87ca8..15a704b 100755 --- a/public/assets/js/ui-editor.js +++ b/public/assets/js/ui-editor.js @@ -1293,8 +1293,9 @@ export function initEditor() {     prevDlg?.showModal?.();   }    -  async function openSend(ctx = null) { - if (!current?.section?.is_template) { +  async function openSend(ctx = null, sectionOverride = null) { + const sectionCtx = sectionOverride || current?.section || window.__activeSection || null; + if (!sectionCtx?.is_template) { err('Kein Template geladen'); return; } @@ -1537,13 +1538,14 @@ export function initEditor() { err('Testversand: Keine ID vorhanden'); return; } - if (!current?.section?.is_template) { + const sectionCtx = opts.section || window.__activeSection || current?.section || null; + if (!sectionCtx?.is_template) { err('Kein Template geladen'); return; } window.__currentItemId = targetId; setSendContext(targetId, opts.name || ''); - openSend({ id: targetId, name: opts.name || '' }); + openSend({ id: targetId, name: opts.name || '' }, sectionCtx); };   // Public API diff --git a/public/assets/js/ui-list.js b/public/assets/js/ui-list.js index 3047c29..6c5bd5f 100755 --- a/public/assets/js/ui-list.js +++ b/public/assets/js/ui-list.js @@ -649,7 +649,7 @@ export async function loadList(section) { return; } if (window.AdminTestSend && typeof window.AdminTestSend.open === 'function') { - window.AdminTestSend.open({ id, name: nm }); + window.AdminTestSend.open({ id, name: nm, section }); } else { toast('Testversand ist aktuell nicht verfügbar.', false); }