[Bug 35828] New: Template::Plugin::CGI removed from Template::Toolkit package
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 Bug ID: 35828 Summary: Template::Plugin::CGI removed from Template::Toolkit package Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org Template::Toolkit 3.100 (released on 2022-04-26) has removed Template::Plugin::CGI. It is now distributed as a separate package (https://metacpan.org/pod/Template::Plugin::CGI) It is apparently used in only 2 places: - koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt - koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt Should we stop using it ? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- We should totally remove it -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no --- Comment #2 from Magnus Enger <magnus@libriotech.no> --- After upgrading to 26.05.05 on Ubuntu 26.04, searching in the Serials module gives a 500 error and this in the logs: ==> /var/log/koha/mykoha/plack-error.log <== Template process failed: plugin error - Can't locate Template/Plugin/CGI.pm in @INC (you may need to install the Template::Plugin::CGI module) (@INC entries checked: /usr/share/koha/lib /usr/share/koha/installer /usr/share/koha/lib/installer /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.40.1 /usr/local/share/perl/5.40.1 /usr/lib/x86_64-linux-gnu/perl5/5.40 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.40 /usr/share/perl/5.40 /usr/local/lib/site_perl /var/lib/koha/mykoha/plugins) at /usr/lib/x86_64-linux-gnu/perl5/5.40/Template/Plugins.pm line 189. The short term solution: $ sudo apt-get install libtemplate-plugin-cgi-perl -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |dependency CC| |mtj@kohaaloha.com, | |pedro.amorim@openfifth.co.u | |k --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Adding dependency keyword and Mason and Pedro (thinking about the technical requirements page, etc.) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 --- Comment #4 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Created attachment 210213 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210213&action=edit Bug 35828: Remove Template::Plugin::CGI usage Template Toolkit 3.100 no longer bundles Template::Plugin::CGI, which Koha does not list as a dependency. This breaks serials search and patron card management on newer systems (e.g. Ubuntu 26.04). The serials search referrer is now built from $query->query_string, which separates params with ';' instead of '&'. CGI.pm parses both. Test plan: 1) Before applying the patch, simulate a system without the plugin in KTD: sudo mv /usr/lib/x86_64-linux-gnu/perl5/5.40/Template/Plugin/CGI.pm /tmp/ restart_all 2) Visit both pages, notice the 500 errors: http://localhost:8081/cgi-bin/koha/serials/serials-search.pl http://localhost:8081/cgi-bin/koha/patroncards/manage.pl?card_element=layout 3) Apply patch, restart_all 4) Visit both pages again, they load fine 5) Create a subscription if you don't have one ('Serials' > 'New subscription') 6) Search subscriptions using 'Title' and 'Library', tick the result, click 'Edit selected serials' 7) Click 'Cancel', you're back on the same results with your filters 8) Repeat 6), fill in 'Public note', click 'Save' 9) You're back on the same results with your filters, and the note is saved (note the ';' separators in the address bar) 10) Restore the plugin: sudo mv /tmp/CGI.pm /usr/lib/x86_64-linux-gnu/perl5/5.40/Template/Plugin/CGI.pm restart_all Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 --- Comment #5 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Hi all, went the "change the code so it no longer needs the dependency" route instead of the "enforce a new dependency" route. No need to add libtemplate-plugin-cgi-perl to the requirements. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |pedro.amorim@openfifth.co.u |ity.org |k Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |dcook@prosentient.com.au |y.org | Keywords|dependency | --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Pedro Amorim (ammopt) from comment #5)
Hi all, went the "change the code so it no longer needs the dependency" route instead of the "enforce a new dependency" route. No need to add libtemplate-plugin-cgi-perl to the requirements.
That's exactly right. I'll ask Magnus to test and I can QA. Removing "dependency" keyword. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210213|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 --- Comment #7 from Magnus Enger <magnus@libriotech.no> --- Created attachment 210511 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210511&action=edit Bug 35828: Remove Template::Plugin::CGI usage Template Toolkit 3.100 no longer bundles Template::Plugin::CGI, which Koha does not list as a dependency. This breaks serials search and patron card management on newer systems (e.g. Ubuntu 26.04). The serials search referrer is now built from $query->query_string, which separates params with ';' instead of '&'. CGI.pm parses both. Test plan: 1) Before applying the patch, simulate a system without the plugin in KTD: sudo mv /usr/lib/x86_64-linux-gnu/perl5/5.40/Template/Plugin/CGI.pm /tmp/ restart_all 2) Visit both pages, notice the 500 errors: http://localhost:8081/cgi-bin/koha/serials/serials-search.pl http://localhost:8081/cgi-bin/koha/patroncards/manage.pl?card_element=layout 3) Apply patch, restart_all 4) Visit both pages again, they load fine 5) Create a subscription if you don't have one ('Serials' > 'New subscription') 6) Search subscriptions using 'Title' and 'Library', tick the result, click 'Edit selected serials' 7) Click 'Cancel', you're back on the same results with your filters 8) Repeat 6), fill in 'Public note', click 'Save' 9) You're back on the same results with your filters, and the note is saved (note the ';' separators in the address bar) 10) Restore the plugin: sudo mv /tmp/CGI.pm /usr/lib/x86_64-linux-gnu/perl5/5.40/Template/Plugin/CGI.pm restart_all Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Magnus Enger <magnus@libriotech.no> Fixes the display of the mentioned pages when Template::Plugin::CGI is not in place. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 --- Comment #8 from Magnus Enger <magnus@libriotech.no> --- (In reply to Magnus Enger from comment #7)
Test plan: 1) Before applying the patch, simulate a system without the plugin in KTD: sudo mv /usr/lib/x86_64-linux-gnu/perl5/5.40/Template/Plugin/CGI.pm /tmp/ restart_all 2) Visit both pages, notice the 500 errors: http://localhost:8081/cgi-bin/koha/serials/serials-search.pl http://localhost:8081/cgi-bin/koha/patroncards/manage.pl?card_element=layout 3) Apply patch, restart_all 4) Visit both pages again, they load fine
OK!
5) Create a subscription if you don't have one ('Serials' > 'New subscription') 6) Search subscriptions using 'Title' and 'Library', tick the result, click 'Edit selected serials' 7) Click 'Cancel', you're back on the same results with your filters
Not sure I understand this. I added two serials. When I search for them, the URL is http://localhost:8081/cgi-bin/koha/serials/serials-search.pl?ISSN_filter=&title_filter=&callnumber_filter=&publisher_filter=&bookseller_filter=&branch_filter=&location_filter=&expiration_date_filter=&searched=1 and both serials are shown. When I select them and click on 'Edit selected serials' I am sent here: http://localhost:8081/cgi-bin/koha/serials/subscription-batchedit.pl?referrer=&subscriptionid=2&subscriptionid=1 The link behind the "Cancel" label is the same: http://localhost:8081/cgi-bin/koha/serials/subscription-batchedit.pl?referrer=&subscriptionid=2&subscriptionid=1 So clikcing on "Cancel" does not really do anything.
8) Repeat 6), fill in 'Public note', click 'Save' 9) You're back on the same results with your filters, and the note is saved (note the ';' separators in the address bar)
No, this sends me back to http://localhost:8081/cgi-bin/koha/serials/serials-home.pl with an empty search form. There are no ';' separators in the URL. I consider 1-4 to be the most important part of this, so since this part works I have signed off the patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35828 --- Comment #9 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Hi Magnus, thanks for testing! I just ran through the whole test plan again in a fresh KTD and steps 6-9 work as described. Could you please try again after a koha-plack --restart kohadev? Thanks in advance. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org