Summary: | Build Mojolicious controller replacement for tools-home.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | Tools | Assignee: | David Cook <dcook> |
Status: | RESOLVED WISHLIST | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26791 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7174 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28507 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 |
||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 28235: Build core functionality for Mojolicious controllers
Bug 28235: Build core functionality for Mojolicious controllers |
Description
David Cook
2021-05-12 00:42:42 UTC
Test plan: 1. cp debian/templates/plack.psgi /etc/koha/sites/kohadev/plack.psgi 2. koha-plack --restart kohadev 3. koha-translate -i fr-FR 4. Update "language" system preference to include French 5. Go to http://localhost:8081/cgi-bin/koha/staff/tools/home 6. Note that it looks the same as http://localhost:8081/cgi-bin/koha/tools/tools-home.pl 7. Choose "Français" from the language bar 8. Go to http://localhost:8081/cgi-bin/koha/staff/tools/home 9. Note that it looks the same (in French) as http://localhost:8081/cgi-bin/koha/tools/tools-home.pl NOTES: - You cannot login at http://localhost:8081/cgi-bin/koha/staff/tools/home. It will redirect you to index.html where you will be prompted to login. You'll then have to navigate back to http://localhost:8081/cgi-bin/koha/staff/tools/home. Created attachment 120857 [details] [review] Bug 28235: Build core functionality for Mojolicious controllers WIP Created attachment 120858 [details] [review] Bug 28235: Build core functionality for Mojolicious controllers While this looks like it works, I'm getting weird errors in the Plack logs: 172.21.0.1 - - [12/May/2021:08:54:59 +0000] "GET /intranet/staff/tools/home HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36" 172.21.0.1 - - [12/May/2021:08:54:59 +0000] "GET /intranet/errors/404.pl HTTP/1.1" 200 18833 "http://localhost:8081/cgi-bin/koha/staff/tools/home" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/9 0.0.4430.93 Safari/537.36" I have no idea what's going on with that 404. I'd also get the following: [2021/05/12 09:22:22] [WARN] no query in gettemplate at /kohadevbox/koha/C4/Templates.pm line 206. [2021/05/12 09:22:22] [WARN] no query in themelanguage at /kohadevbox/koha/C4/Templates.pm line 266. [2021/05/12 09:22:22] [WARN] no query in themelanguage at /kohadevbox/koha/C4/Templates.pm line 266. [2021/05/12 09:22:22] [WARN] Use of uninitialized value $interface in string eq at /kohadevbox/koha/C4/Templates.pm line 279. [2021/05/12 09:22:22] [WARN] Use of uninitialized value $interface in string eq at /kohadevbox/koha/C4/Templates.pm line 280. [2021/05/12 09:22:22] [WARN] Use of uninitialized value $interface in string eq at /kohadevbox/koha/C4/Templates.pm line 282. [2021/05/12 09:22:22] [WARN] Use of uninitialized value $lang in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 296. [2021/05/12 09:22:22] [WARN] Use of uninitialized value $lang in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 296. [2021/05/12 09:22:22] [WARN] Use of uninitialized value $lang in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 296. Some of that I might expect because I'm not handling Templates quite right, but a certain amount of that is coming from the 404 handling it seems... I'm getting the following in the Plack error logs, but that's because C4::Templates is the worst, and I need to refactor it so it's not so tightly coupled to CGI. [2021/05/12 09:24:37] [WARN] no query in gettemplate at /kohadevbox/koha/C4/Templates.pm line 206. [2021/05/12 09:24:37] [WARN] no query in themelanguage at /kohadevbox/koha/C4/Templates.pm line 266. [2021/05/12 09:24:37] [WARN] no query in themelanguage at /kohadevbox/koha/C4/Templates.pm line 266. [2021/05/12 09:24:37] [WARN] Use of uninitialized value $interface in string eq at /kohadevbox/koha/C4/Templates.pm line 279. [2021/05/12 09:24:37] [WARN] Use of uninitialized value $interface in string eq at /kohadevbox/koha/C4/Templates.pm line 280. [2021/05/12 09:24:37] [WARN] Use of uninitialized value $interface in string eq at /kohadevbox/koha/C4/Templates.pm line 282. [2021/05/12 09:24:37] [WARN] Use of uninitialized value $lang in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 296. [2021/05/12 09:24:37] [WARN] Use of uninitialized value $lang in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 296. [2021/05/12 09:24:37] [WARN] Use of uninitialized value $lang in concatenation (.) or string at /kohadevbox/koha/C4/Templates.pm line 296. Bug 15204 makes me think that a Koha::Session module would be a good idea. It could be a good idea to actually have authentication in Koha::AuthN and authorization in Koha::AuthZ as well. After all, there are many ways to authenticate with Koha, but there's only one way to authorize. They're two separate activities, so they probably should be separate modules. The patch is outdated and realistically we're not moving in this direction anyway |