Skip to content

Commit 496f27b

Browse files
committed
fix: restore footer template policy sync and default state
Signed-off-by: Vitor Mattos <[email protected]>
1 parent d644e92 commit 496f27b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

lib/Controller/AdminController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,8 @@ public function getFooterTemplate(): DataResponse {
878878
public function saveFooterTemplate(string $template = '', int $width = 595, int $height = 50) {
879879
try {
880880
$this->footerService->saveTemplate($template);
881-
$pdf = $this->footerService->renderPreviewPdf($template, $width, $height);
881+
// Template was already persisted above; avoid a second save that can revert policy flags.
882+
$pdf = $this->footerService->renderPreviewPdf('', $width, $height);
882883

883884
return new DataDownloadResponse($pdf, 'footer-preview.pdf', 'application/pdf');
884885
} catch (\Exception $e) {

lib/Service/FooterService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ public function __construct(
2222
}
2323

2424
public function isDefaultTemplate(): bool {
25+
$legacyCustomTemplate = $this->appConfig->getValueString(Application::APP_ID, 'footer_template', '');
26+
if ($legacyCustomTemplate !== '') {
27+
return false;
28+
}
29+
2530
$footerPolicy = $this->getEffectiveFooterPolicy();
2631
return !$footerPolicy['customizeFooterTemplate'];
2732
}

0 commit comments

Comments
 (0)