[Koha-bugs] [Bug 36172] New: Warn about incorrect values in the opacthemes system preference

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 27 10:58:22 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36172

            Bug ID: 36172
           Summary: Warn about incorrect values in the opacthemes system
                    preference
 Change sponsored?: ---
           Product: Koha
           Version: 21.11
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: System Administration
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: rudolfbyker at gmail.com
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com

Relevant IRC discussion:

- https://irc.koha-community.org/koha/2024-02-26#i_2538655
- https://irc.koha-community.org/koha/2024-02-27#i_2538955

tl;dr

- https://irc.koha-community.org/koha/2024-02-27#i_2539035

I had this set in my database from 12 years ago when someone had a custom theme
for our Koha:

MariaDB [koha_rsc]> select * from systempreferences where
variable='opacthemes';
+------------+----------+---------+--------------------------------------------------+--------+
| variable   | value    | options | explanation                                
     | type   |
+------------+----------+---------+--------------------------------------------------+--------+
| opacthemes | prog_rsc |         | Define the current theme for the OPAC
interface. | Themes |
+------------+----------+---------+--------------------------------------------------+--------+

When upgrading from 21.05 to 21.11, this caused the return value of `sub
get_xsl_filename` in `C4/XSLT.pm` to be
"/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl"
instead of
"/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl"
when `OPACXSLTDetailsDisplay` is set to "default". This caused the parts of the
page where the XSLT output should be to be completely empty. No errors were
shown in any of `/var/log/koha/*/*.log` when reloading those pages.

Workaround: Put full paths like
"/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl"
in the `OPACXSLT*Display` preferences instead of "default".

Manual fix:

1. Run this query: `update systempreferences set value = "bootstrap" where
variable = "opacthemes";`
2. Restart everything: `systemctl restart memcached && systemctl restart
apache2 && systemctl restart koha-common`

Proposed permanent fix:
- Have a fallback value for XSLT files when it does not exist on the disk AND
show a warning in the logs. OR: Don't have a fallback, and throw an error and
crash the program with a sensible error message.
- Show a warning somewhere when "opacthemes" contains an invalid value.

Feel free to close this if it's already fixed in a later version.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list