Fix: scan_belege nutzte undefiniertes $upload_dir [deploy]
All checks were successful
Deploy mahnung / deploy (push) Successful in 13s

$upload_dir wird erst nach den Action-Handlern definiert.
scan_belege-Block berechnet den Pfad jetzt selbst.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Eduard Wisch 2026-05-13 16:57:36 +02:00
parent 7157f0d8c3
commit 9e3776fef3

View file

@ -180,8 +180,13 @@ if ($action === 'dismiss_tracking' && $user->hasRight('mahnung', 'write')) {
// Belege scannen: pdftotext + Pattern-Matching
if ($action === 'scan_belege' && $user->hasRight('mahnung', 'write')) {
require_once DOL_DOCUMENT_ROOT.'/custom/mahnung/class/mahnungtrackingpattern.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$scanDir = $upload_dir;
$scanRef = dol_sanitizeFileName($mahnung->ref);
$scanDir = (!empty($conf->mahnung->multidir_output[$mahnung->entity])
? $conf->mahnung->multidir_output[$mahnung->entity]
: $conf->mahnung->dir_output ?? (DOL_DATA_ROOT.'/mahnung'))
.'/'.$scanRef;
$patternService = new MahnungTrackingPattern($db);
$suggestions = array();