[Bug 28325] New: Build Mojolicious controller replacement for tools-home.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28325 Bug ID: 28325 Summary: Build Mojolicious controller replacement for tools-home.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org As per an email to koha-devel, I'm going to take the core Mojolicious code from Bug 26791, and try implementing it with a much simpler controller to replace tools-home.pl. The key prerequisites for the controller are authentication, authorization, and template rendering. It may be necessary to split out other bug reports to focus on refactoring Koha's existing code, rather than bolting an alternative onto Koha, which could just create maintenance woes. -- 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=28325 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26791 -- 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=28325 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28325 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- 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. -- 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=28325 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Created attachment 120857 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120857&action=edit Bug 28235: Build core functionality for Mojolicious controllers WIP -- 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=28325 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120857|0 |1 is obsolete| | --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Created attachment 120858 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120858&action=edit Bug 28235: Build core functionality for Mojolicious controllers -- 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=28325 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- 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... -- 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=28325 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- 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. -- 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=28325 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- 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=28325 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28325 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=7174 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28325 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28507 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28325 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31380 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28325 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |WISHLIST Status|NEW |RESOLVED --- Comment #7 from David Cook <dcook@prosentient.com.au> --- The patch is outdated and realistically we're not moving in this direction anyway -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org