Bug 9048 - Quote editor does not work under Plack
Summary: Quote editor does not work under Plack
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Robin Sheat
QA Contact:
URL:
Keywords:
Depends on: 12163
Blocks: 12173
  Show dependency treegraph
 
Reported: 2012-11-10 00:58 UTC by Jared Camins-Esakov
Modified: 2014-12-07 20:07 UTC (History)
4 users (show)

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


Attachments
Bug 9048 - fix quote editor under plack (2.88 KB, patch)
2014-04-30 03:49 UTC, Robin Sheat
Details | Diff | Splinter Review
Bug 9048 - fix quote editor under Plack (2.94 KB, patch)
2014-05-06 16:07 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 9048 - fix quote editor under Plack (3.00 KB, patch)
2014-05-08 15:55 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 2012-11-10 00:58:43 UTC
Because the return values in tools/quotes/quotes_ajax.pl are backwards -- I think -- Plack returns a 500 server error after successfully editing quotes. From the logs:
exited nonzero: 1 at /home/jcamins/kohaclone/tools/quotes/quotes_ajax.pl line 121
    CGI::Compile::ROOT::home_jcamins_kohaclone_tools_quotes_quotes_ajax_2epl::__ANON__ at /usr/share/perl5/CGI/Emulate/PSGI.pm line 28
    CGI::Emulate::PSGI::__ANON__('HASH(0x542f808)') called at /usr/share/perl5/Plack/App/WrapCGI.pm line 83
    Plack::App::WrapCGI::call('Plack::App::WrapCGI=HASH(0x5aecdc8)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /usr/share/perl5/Plack/App/CGIBin.pm line 50
    Plack::App::CGIBin::serve_path('Plack::App::CGIBin=HASH(0x50d7a08)', 'HASH(0x542f808)', '/home/jcamins/kohaclone/tools/quotes/quotes_ajax.pl') called at /usr/share/perl5/Plack/App/File.pm line 34
    Plack::App::File::call('Plack::App::CGIBin=HASH(0x50d7a08)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /usr/share/perl5/Plack/App/URLMap.pm line 71
    Plack::App::URLMap::call('Plack::App::URLMap=HASH(0x4e16750)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Middleware::StackTrace::__ANON__ at /usr/share/perl5/Try/Tiny.pm line 71
    eval {...} at /usr/share/perl5/Try/Tiny.pm line 67
    Plack::Middleware::StackTrace::call('Plack::Middleware::StackTrace=HASH(0x5133138)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /usr/share/perl5/Plack/Middleware/Static.pm line 18
    Plack::Middleware::Static::call('Plack::Middleware::Static=HASH(0x5133330)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /home/jcamins/perl5/lib/perl5/Plack/Middleware/Debug/Base.pm line 23
    Plack::Middleware::Debug::Base::call('Plack::Middleware::Debug::Memory=HASH(0x51cdb80)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /home/jcamins/perl5/lib/perl5/Plack/Middleware/Debug/Base.pm line 23
    Plack::Middleware::Debug::Base::call('Plack::Middleware::Debug::Timer=HASH(0x51cdd78)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /home/jcamins/perl5/lib/perl5/Plack/Middleware/Debug/Base.pm line 23
    Plack::Middleware::Debug::Base::call('Plack::Middleware::Debug::Response=HASH(0x51cdf10)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /home/jcamins/perl5/lib/perl5/Plack/Middleware/Debug/Base.pm line 23
    Plack::Middleware::Debug::Base::call('Plack::Middleware::Debug::Environment=HASH(0x51ce0a8)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /home/jcamins/perl5/lib/perl5/Plack/Middleware/Debug.pm line 138
    Plack::Middleware::Debug::call('Plack::Middleware::Debug=HASH(0x5133528)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /usr/share/perl5/Plack/Middleware/AccessLog.pm line 21
    Plack::Middleware::AccessLog::call('Plack::Middleware::AccessLog=HASH(0x26e1500)', 'HASH(0x542f808)') called at /usr/share/perl5/Plack/Component.pm line 39
    Plack::Component::__ANON__('HASH(0x542f808)') called at /usr/share/perl5/Plack/Util.pm line 165
    eval {...} at /usr/share/perl5/Plack/Util.pm line 165
    Plack::Util::run_app('CODE(0x26e1428)', 'HASH(0x542f808)') called at /usr/share/perl5/Starman/Server.pm line 223
    Starman::Server::process_request('Starman::Server=HASH(0x26e1728)') called at /usr/share/perl5/Net/Server.pm line 142
    Net::Server::run_client_connection('Starman::Server=HASH(0x26e1728)') called at /usr/share/perl5/Net/Server/PreFork.pm line 273
    eval {...} at /usr/share/perl5/Net/Server/PreFork.pm line 273
    Net::Server::PreFork::run_child('Starman::Server=HASH(0x26e1728)') called at /usr/share/perl5/Net/Server/PreFork.pm line 229
    Net::Server::PreFork::run_n_children('Starman::Server=HASH(0x26e1728)', 2) called at /usr/share/perl5/Net/Server/PreFork.pm line 144
    Net::Server::PreFork::loop('Starman::Server=HASH(0x26e1728)') called at /usr/share/perl5/Net/Server.pm line 117
    Net::Server::run('Starman::Server=HASH(0x26e1728)', 'port', 'ARRAY(0x4e16b40)', 'host', 'ARRAY(0x4e166a8)', 'proto', 'ARRAY(0x53f21d8)', 'serialize', 'flock', 'log_level', 2, 'log_file', '/home/jcamins/koha-dev/var/log/koha-error.log', 'min_servers', 2, 'min_spare_servers', 1, 'max_spare_servers', 1, 'max_servers', 2, 'max_requests', 50, 'user', 1001, 'group', '1003 33 999 1003', 'listen', 1024, 'leave_children_open_on_hup', 1, 'no_client_stdout', 1, 'pid_file', '/home/jcamins/koha-dev/var/run/plack.pid', 'setsid', 1, 'background', 1) called at /usr/share/perl5/Starman/Server.pm line 61
    Starman::Server::run('Starman::Server=HASH(0x26e1728)', 'CODE(0x26e1428)', 'HASH(0x50d79d8)') called at /usr/share/perl5/Plack/Handler/Starman.pm line 18
    Plack::Handler::Starman::run('Plack::Handler::Starman=HASH(0x50d76f0)', 'CODE(0x26e1428)') called at /usr/share/perl5/Plack/Loader.pm line 88
    Plack::Loader::run('Plack::Loader=HASH(0x265ba98)', 'Plack::Handler::Starman=HASH(0x50d76f0)') called at /usr/share/perl5/Plack/Runner.pm line 263
    Plack::Runner::run('Plack::Runner=HASH(0x23d09a0)') called at /usr/bin/starman line 31
Comment 1 Robin Sheat 2014-04-30 02:20:15 UTC
Confirmed. Additionally, Koha doesn't handle this very well. It just sits there rather than letting the user know something had an upset.
Comment 2 Robin Sheat 2014-04-30 03:49:44 UTC Comment hidden (obsolete)
Comment 3 Robin Sheat 2014-04-30 03:51:27 UTC
Fixed the error codes. There seems to be a bug in the JS that prevents adding quotes showing up like they've been added until you refresh. That seems to be an unrelated bug that I'll have a quick look into. Everything else works however.
Comment 4 Robin Sheat 2014-04-30 04:33:05 UTC
Marking as blocked by bug 12163, which fixes the JS issue, as this is hard to test properly without that.
Comment 5 Galen Charlton 2014-05-06 16:07:26 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2014-05-08 15:55:15 UTC
Created attachment 28113 [details] [review]
Bug 9048 - fix quote editor under Plack

The ajax responder for the quote editor was using the wrong error codes.
These have been fixed. Also, a small fixup to get rid of some annoying
warnings.

To test:
* Under plack,
* Add/edit/delete a quote.
* Make sure that things don't crash.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Galen Charlton 2014-05-08 16:41:53 UTC
Pushed to master.  Thanks, Robin!