Bug 10085 - Unapi does not function under Plack
Summary: Unapi does not function under Plack
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker (vote)
Assignee: Jared Camins-Esakov
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-20 02:43 UTC by Jared Camins-Esakov
Modified: 2019-06-27 09:24 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10085: unapi does not function under Plack (2.29 KB, patch)
2013-04-20 02:55 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 10085: unapi does not function under Plack (2.44 KB, patch)
2013-04-20 06:28 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 10085: unapi does not function under Plack (2.50 KB, patch)
2013-04-22 10:17 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Camins-Esakov 2013-04-20 02:43:15 UTC
$cgi is not set. Everything breaks spectacularly.
Comment 1 Jared Camins-Esakov 2013-04-20 02:55:59 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2013-04-20 06:26:39 UTC
Comment on attachment 17565 [details] [review]
Bug 10085: unapi does not function under Plack

Review of attachment 17565 [details] [review]:
-----------------------------------------------------------------

::: opac/unapi
@@ -158,3 @@
>  
>      if (defined $id) {
>          print $cgi->header( -type =>'application/xml', -status => '300 multiple choices' );

WTF ... how did this ever work???
Comment 3 Chris Cormack 2013-04-20 06:28:15 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2013-04-22 10:16:41 UTC
QA comment:
Remove some global variables. Work as expected with and without Plack.
Marked as Passed QA.
Comment 5 Jonathan Druart 2013-04-22 10:17:02 UTC
Created attachment 17578 [details] [review]
Bug 10085: unapi does not function under Plack

The following errors appear when trying to use unapi under Plack (among
others):
Variable "$cgi" is not available at /home/jcamins/kohaclone/opac/unapi line 160.
Variable "$format_to_stylesheet_map" is not available at /home/jcamins/kohaclone/opac/unapi line 173.
Variable "$format_info" is not available at /home/jcamins/kohaclone/opac/unapi line 174.
Variable "$format_to_stylesheet_map" is not available at /home/jcamins/kohaclone/opac/unapi line 185.

To test:
1) Try to view /cgi-bin/koha/unapi under Plack
2) There is no step 2. Plack crashes.
3) Apply patch.
4) Try to view /cgi-bin/koha/unapi again, and note that it doesn't crash

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

I'm puzzled how this ever worked anyway, accidentally i'm guessing,
this tidies up some lazy coding

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 6 Jared Camins-Esakov 2013-04-23 12:38:46 UTC
This patch has been pushed to master and 3.12.x.
Comment 7 Chris Cormack 2013-04-27 06:09:05 UTC
Pushed to 3.10.x will be in 3.10.6