Bug 28373: Add warning if custom stylesheets are defined

This patch adds a check of the current XSLT prefs and warns to check the new pref
if any are not set to default

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2021-08-30 19:53:40 +00:00 committed by Jonathan Druart
parent 2bc48bc748
commit 192d5bf13b

View file

@ -4,6 +4,12 @@ if( CheckVersion( $DBversion ) ) {
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo');
});
foreach my $pref ('XSLTDetailsDisplay','XSLTListsDisplay','XSLTResultsDisplay','OPACXSLTDetailsDisplay','OPACXSLTListsDisplay','OPACXSLTResultsDisplay'){
if( C4::Context->preference($pref) ne 'default' ){
print "NOTE: You have defined a custom stylesheet. If your custom stylesheets are utilizing item fields you must enable the system preference 'PassItemMarcToXSLT'\n";
last;
}
}
NewVersion( $DBversion, 28373, "Add PassItemMarcToXSLT system preference");
}