[Bug 30261] New: opac/tracklinks.pl renders 404 incorrectly
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Bug ID: 30261 Summary: opac/tracklinks.pl renders 404 incorrectly 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: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org As per https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23329#c87, tracklinks.pl will try to generate an intranet 404 instead of an OPAC 404 if the script is visited without the syspref being activated or if the URL is not a valid one to redirect to. -- 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=30261 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |23329 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23329 [Bug 23329] tracklinks.pl accepts any url from a parameter for proxying if not tracking -- 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=30261 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 watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 131533 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131533&action=edit Bug 30261 - Render opac 404 for opac/tracklinks.pl This patch updates C4::Output::output_error to take an additional argument which contains an "interface" parameter, so that opac/tracklinks.pl can generate an OPAC error instead of an Intranet error. Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Go to http://localhost:8081/test.pl 2. Note normal Intranet 404 error 3. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 4. Note normal Opac 404 error 4b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 5. Change 'TrackClicks' syspref to "Track" 6. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 7. Note normal Opac 404 error 7b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 8. Rejoice! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=11581 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 paul.derscheid@lmscloud.de changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131533|0 |1 is obsolete| | --- Comment #2 from paul.derscheid@lmscloud.de --- Created attachment 134921 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134921&action=edit Bug 30261 - Render opac 404 for opac/tracklinks.pl This patch updates C4::Output::output_error to take an additional argument which contains an "interface" parameter, so that opac/tracklinks.pl can generate an OPAC error instead of an Intranet error. Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Go to http://localhost:8081/test.pl 2. Note normal Intranet 404 error 3. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 4. Note normal Opac 404 error 4b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 5. Change 'TrackClicks' syspref to "Track" 6. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 7. Note normal Opac 404 error 7b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 8. Rejoice! Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Passes all tests. No unexpected behaviour could be identified. Current status: Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 paul.derscheid@lmscloud.de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de 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=30261 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Thanks Paul :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | Status|Signed Off |BLOCKED --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QAing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Processing additional checks * Commit title does not start with 'Bug XXXXX: ' - 2dc735c225 You should know by now, haha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Status|BLOCKED |Failed QA --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- There is something more going on here behind the scenes since we applied the errordocument changes to plack.psgi. Whatever we are doing now in the arguments to output_error like: - output_error( $cgi, '404' ); + output_error( $cgi, '404', { interface => 'opac' } ); is completely useless. Why? There is a fundamental flaw in output_error: output_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found'; Although we pass $error, it always outputs a 404. I tried sending a 403, and it does not work! The 404 from output_error is caught by Plack middleware and it will output the 404 error document. In this case the OPAC 404 error document! In other words, the bug description is invalid too. There is actually no problem when it is a 404. But we found another problem. We should fix the hardcoded 404 for other errors. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #5)
Processing additional checks
* Commit title does not start with 'Bug XXXXX: ' - 2dc735c225
You should know by now, haha
Huh... that is weird! Must've been an off day. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #6)
There is something more going on here behind the scenes since we applied the errordocument changes to plack.psgi.
Whatever we are doing now in the arguments to output_error like: - output_error( $cgi, '404' ); + output_error( $cgi, '404', { interface => 'opac' } ); is completely useless. Why?
There is a fundamental flaw in output_error: output_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found'; Although we pass $error, it always outputs a 404. I tried sending a 403, and it does not work!
The 404 from output_error is caught by Plack middleware and it will output the 404 error document. In this case the OPAC 404 error document!
In other words, the bug description is invalid too. There is actually no problem when it is a 404.
But we found another problem. We should fix the hardcoded 404 for other errors.
I'll have another look at this one. Can you open a different bug for what you describe? Feel free to CC me in and I'll take a look. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Cook from comment #8)
Can you open a different bug for what you describe? Feel free to CC me in and I'll take a look.
Sure. Bug 30803 is yours :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30803 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #6)
There is something more going on here behind the scenes since we applied the errordocument changes to plack.psgi.
Looking at this again... and I realise that the ErrorDocument stuff make this change less important, because the ErrorDocument is showing the correct error page. I figure it's worth still fixing this one, but it's tough to prove that it's using the wrong template initially... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134921|0 |1 is obsolete| | --- Comment #11 from David Cook <dcook@prosentient.com.au> --- Created attachment 191331 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191331&action=edit Bug 30261: Render opac 404 for opac/tracklinks.pl This patch updates C4::Output::output_error to take an additional argument which contains an "interface" parameter, so that opac/tracklinks.pl can generate an OPAC error instead of an Intranet error. Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Go to http://localhost:8081/test.pl 2. Note normal Intranet 404 error 3. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 4. Note normal Opac 404 error 4b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 5. Change 'TrackClicks' syspref to "Track" 6. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 7. Note normal Opac 404 error 7b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 8. Rejoice! Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Passes all tests. No unexpected behaviour could be identified. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz Keywords| |Academy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Harrison Hawkins <harrisonhawkins@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |harrisonhawkins@catalyst.ne | |t.nz --- Comment #12 from Harrison Hawkins <harrisonhawkins@catalyst.net.nz> --- Looks like this was signed by Paul Derscheid <paul.derscheid@lmscloud.de> Changed status to signed off. (In reply to David Cook from comment #11)
Created attachment 191331 [details] [review] Bug 30261: Render opac 404 for opac/tracklinks.pl
This patch updates C4::Output::output_error to take an additional argument which contains an "interface" parameter, so that opac/tracklinks.pl can generate an OPAC error instead of an Intranet error.
Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Go to http://localhost:8081/test.pl 2. Note normal Intranet 404 error 3. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest. com&biblionumber=29 4. Note normal Opac 404 error 4b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 5. Change 'TrackClicks' syspref to "Track" 6. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest. com&biblionumber=29 7. Note normal Opac 404 error 7b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 8. Rejoice!
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Passes all tests. No unexpected behaviour could be identified.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191331|0 |1 is obsolete| | --- Comment #13 from David Cook <dcook@prosentient.com.au> --- Created attachment 195379 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195379&action=edit Bug 30261: Render opac 404 for opac/tracklinks.pl This patch updates C4::Output::output_error to take an additional argument which contains an "interface" parameter, so that opac/tracklinks.pl can generate an OPAC error instead of an Intranet error. Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Go to http://localhost:8081/test.pl 2. Note normal Intranet 404 error 3. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 4. Note normal Opac 404 error 4b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 5. Change 'TrackClicks' syspref to "Track" 6. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 7. Note normal Opac 404 error 7b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 8. Rejoice! Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Passes all tests. No unexpected behaviour could be identified. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #14 from David Cook <dcook@prosentient.com.au> --- Created attachment 195380 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195380&action=edit Bug 30261: update unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|m.de.rooy@rijksmuseum.nl |jonathan.druart@gmail.com Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195379|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=30261 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195380|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=30261 --- Comment #15 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 195384 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195384&action=edit Bug 30261: Render opac 404 for opac/tracklinks.pl This patch updates C4::Output::output_error to take an additional argument which contains an "interface" parameter, so that opac/tracklinks.pl can generate an OPAC error instead of an Intranet error. Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Go to http://localhost:8081/test.pl 2. Note normal Intranet 404 error 3. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 4. Note normal Opac 404 error 4b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 5. Change 'TrackClicks' syspref to "Track" 6. Go to http://localhost:8080/cgi-bin/koha/tracklinks.pl?uri=https%3A%2F%2Ftest.com&biblionumber=29 7. Note normal Opac 404 error 7b. For extra points, note that tracklinks.pl returns a 404 instead of a 302 to the 404.pl page 8. Rejoice! Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Passes all tests. No unexpected behaviour could be identified. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #16 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 195385 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195385&action=edit Bug 30261: update unit tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Thanks for all the hard work! Pushed to main for the next 26.05.00 release as RM Assistant -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.05.00 |26.05.00,25.11.05 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30261 --- Comment #18 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org