[Bug 42527] New: Impossible to log into OPAC after error when OpacPublic disabled
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 Bug ID: 42527 Summary: Impossible to log into OPAC after error when OpacPublic disabled Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org There's a couple problems here. First: If you disable OpacPublic and go to http://localhost:8080/cgi-bin/koha/bad It generates a form action of "/cgi-bin/kohaerrors/404.pl" because Koha/AuthUtils.pm's get_script_name isn't returning the script name correctly for middleware handled errors. Second: C4/Auth.pm's checkauth probably should allow "errorpage.tt" as part of "@allowed_scripts_for_private_opac". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 198574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198574&action=edit Bug 42527: Add tests Patch from commit 28eba51 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 198575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198575&action=edit Bug 42527: Prepend script name with / if missing Patch from commit 4e71cb5 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- I've started here but actually get_script_name is not the place to fix IMO. Why are we missing the / between opac and errors? $ENV{SCRIPT_NAME} is /opacerrors/404.pl when we reach get_script_name. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #3)
I've started here but actually get_script_name is not the place to fix IMO. Why are we missing the / between opac and errors? $ENV{SCRIPT_NAME} is /opacerrors/404.pl when we reach get_script_name.
I think it's because of the subrequest in Plack::Middleware::ErrorDocument: https://metacpan.org/dist/Plack/source/lib/Plack/Middleware/ErrorDocument.pm... https://metacpan.org/module/Plack::App::File/source#L26 Now the paths in our ErrorDocument use relative paths because of reasons I can't remember. I know it is (or was) important at the time. Although that gives me an idea... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #4)
Now the paths in our ErrorDocument use relative paths because of reasons I can't remember. I know it is (or was) important at the time. Although that gives me an idea...
Changing the following in /etc/koha/sites/kohadev/plack.psgi seems good... 404 => 'errors/404.pl', to 404 => '/errors/404.pl', It fixes the path issue while ErrorDocument seems to still function correctly. Since plack.psgi can be customized, we might want to change both it and add the above "prepend script name with / if missing", although... it might be a small enough edge case that we just change the ErrorDocument config in plack.psgi... Really wonder why I said "it is important that these are relative links" in the .psgi file... Yeah nah... I can't see a necessary reason for not having the / for those config values... I've tried with both 404 and 500 (after turning off debugging in koha-conf.xml) Maybe it was due to some other thing that we fixed at some other stage... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 198986 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198986&action=edit Bug 42527: Add Cypress tests Patch from commit a7e9931 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 198987 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198987&action=edit Bug 42527: Correct error pages path Patch from commit 604b554 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- The Cypress tests are failing, line 49:
49 | cy.title().should("eq", "Koha staff interface");
It actually gets "403 wrong csrf token", I don't explain it. We clear the cookie and logout/login, the csrf token should be valid. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42527 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198574|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=42527 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198575|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org