From 7387d3ac1ed699a7e8deeb9345a8fb4918b8d614 Mon Sep 17 00:00:00 2001 From: Eduard Wisch Date: Sun, 10 May 2026 18:40:30 +0200 Subject: [PATCH] Fix: Widget Fatal Error + Setup Upload-Include verschoben [deploy] - box_mahnung_offen.php: require_once mahnung.class.php nach oben verschoben, da Mahnung::STATUS_STORNIERT in der SQL-Query vor dem bisherigen Include benutzt wurde - setup.php: actions_setmoduleoptions.inc.php vor llxHeader() verschoben (sonst scheitert der ODT-Upload wegen "headers already sent"), Duplikat entfernt Co-Authored-By: Claude Opus 4.6 (1M context) --- admin/setup.php | 9 ++++++--- core/boxes/box_mahnung_offen.php | 3 +-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/admin/setup.php b/admin/setup.php index b8a2516..04644cb 100644 --- a/admin/setup.php +++ b/admin/setup.php @@ -167,6 +167,12 @@ function loadStufeById($db, $id, $entity) return $s; } +// --------------------------------------------------------------- +// ODT-Upload / Template-Loeschen (actions_setmoduleoptions.inc.php) +// Muss vor llxHeader() stehen, da es header()-Redirects macht. +// --------------------------------------------------------------- +include_once DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + // --------------------------------------------------------------- // Dokumentenmodell-Aktionen (vor View, da header()-Redirect) // --------------------------------------------------------------- @@ -313,9 +319,6 @@ print ''; print '

'; print load_fiche_titre($langs->trans('MahnungDokumentModelle'), 'Verfuegbare Template-Variablen', ''); -// Aktionen fuer Dokumentenmodelle (Upload, Loeschen, setModuleOptions) -include_once DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; - // Dokumentenmodelle auflisten $def = array(); $sql = "SELECT nom FROM ".MAIN_DB_PREFIX."document_model WHERE type = 'mahnung' AND entity = ".((int) $conf->entity); diff --git a/core/boxes/box_mahnung_offen.php b/core/boxes/box_mahnung_offen.php index 6b9e1a2..3e49950 100644 --- a/core/boxes/box_mahnung_offen.php +++ b/core/boxes/box_mahnung_offen.php @@ -14,6 +14,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/custom/mahnung/class/mahnung.class.php'; /** * Widget: Offene Kundenrechnungen mit aktueller Mahnstufe. @@ -97,8 +98,6 @@ class box_mahnung_offen extends ModeleBoxes $sql .= " ORDER BY f.date_lim_reglement ASC, f.ref ASC"; $sql .= $this->db->plimit($this->max + 1, 0); - require_once DOL_DOCUMENT_ROOT.'/custom/mahnung/class/mahnung.class.php'; - $result = $this->db->query($sql); if (!$result) { $this->info_box_contents[0][0] = array(