"From branch" and date do not show up in patron's "Holds" tab: "Item in transit from since" OPAC log: opac-user.pl: No method frombranch! at /usr/share/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt line 607 This is related to Bug 13918 (see comment #3 in Bug 16680)
Created attachment 52157 [details] [review] Bug 16686 - Fix "Item in transit from since" in Holds tab "From branch" and date do not show up in patron's "Holds" tab: "Item in transit from since" OPAC log: opac-user.pl: No method frombranch! at /usr/share/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt line 607 Test Plan: 1) Apply this patch 2) Create an in transit hold 3) Not the from library is displayed
New methods should probably have unit tests.
Created attachment 52163 [details] [review] Bug 16686 - Fix "Item in transit from since" in Holds tab "From branch" and date do not show up in patron's "Holds" tab: "Item in transit from since" OPAC log: opac-user.pl: No method frombranch! at /usr/share/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt line 607 Test Plan: 1) Apply this patch 2) Create an in transit hold 3) Not the from library is displayed
Created attachment 52164 [details] [review] Bug 16686 - Fix "Item in transit from since" in Holds tab "From branch" and date do not show up in patron's "Holds" tab: "Item in transit from since" OPAC log: opac-user.pl: No method frombranch! at /usr/share/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt line 607 Test Plan: 1) Apply this patch 2) Create an in transit hold 3) Not the from library is displayed
With patch I get a lot of errors (even on OPAC main page or on Staff login page): syntax error at /usr/share/kohaclone/Koha/Item.pm line 101, near "unless defined" syntax error at /usr/share/kohaclone/Koha/Item.pm line 106, near "}" Global symbol "$self" requires explicit package name at /usr/share/kohaclone/Koha/Item.pm line 108. Can't use global @_ in "my" at /usr/share/kohaclone/Koha/Item.pm line 117, near "= @_" Global symbol "$self" requires explicit package name at /usr/share/kohaclone/Koha/Item.pm line 119. Global symbol "$self" requires explicit package name at /usr/share/kohaclone/Koha/Item.pm line 119. syntax error at /usr/share/kohaclone/Koha/Item.pm line 130, near "}" Can't use global @_ in "my" at /usr/share/kohaclone/Koha/Item.pm line 139, near "= @_" syntax error at /usr/share/kohaclone/Koha/Item.pm line 144, near "}" Can't use global @_ in "my" at /usr/share/kohaclone/Koha/Item.pm line 153, near "= @_" /usr/share/kohaclone/Koha/Item.pm has too many errors.
Created attachment 52183 [details] [review] Bug 16686 - Fix "Item in transit from since" in Holds tab "From branch" and date do not show up in patron's "Holds" tab: "Item in transit from since" OPAC log: opac-user.pl: No method frombranch! at /usr/share/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt line 607 Test Plan: 1) Apply this patch 2) Create an in transit hold 3) Not the from library is displayed
(In reply to Marc Véron from comment #5) > With patch I get a lot of errors (even on OPAC main page or on Staff login > page): It looks like some unwanted additions got merged into my patch. Please try this new version! Thanks!
Now, if I log in to the OPAC with the user who triggers the transit-message, I get: Template process failed: undef error - Can't call method "_columns" without a package or object reference at /usr/share/kohaclone/Koha/Object.pm line 266. OPAC log: [Wed Jun 08 16:13:10 2016] [error] [client 192.168.1.20] [Wed Jun 8 16:13:10 2016] opac-user.pl: The given value does not seem to be interpretable as a Boolean value at /usr/share/kohaclone/C4/Context.pm line 545, referer: http://192.168.1.35/cgi-bin/koha/opac-main.pl?logout.x=1 [Wed Jun 08 16:13:11 2016] [error] [client 192.168.1.20] [Wed Jun 8 16:13:11 2016] opac-user.pl: Use of inherited AUTOLOAD for non-method Koha::Item::GetTransfers() is deprecated at /usr/share/kohaclone/Koha/Item.pm line 123., referer: http://192.168.1.35/cgi-bin/koha/opac-main.pl?logout.x=1 [Wed Jun 08 16:13:11 2016] [error] [client 192.168.1.20] [Wed Jun 8 16:13:11 2016] opac-user.pl: Template process failed: undef error - Can't call method "_columns" without a package or object reference at /usr/share/kohaclone/Koha/Object.pm line 266., referer: http://192.168.1.35/cgi-bin/koha/opac-main.pl?logout.x=1
Re-tested. I can no longer log-in to the OPAC with a patron who has the hold on an item in transit. [Fri Jun 17 14:16:40 2016] [error] [client 192.168.1.35] [Fri Jun 17 14:16:40 2016] opac-user.pl: Use of inherited AUTOLOAD for non-method Koha::Item::GetTransfers() is deprecated at /usr/share/kohaclone/Koha/Item.pm line 123., referer: http://192.168.1.35/ [Fri Jun 17 14:16:40 2016] [error] [client 192.168.1.35] [Fri Jun 17 14:16:40 2016] opac-user.pl: Template process failed: undef error - Can't call method "_columns" without a package or object reference at /usr/share/kohaclone/Koha/Object.pm line 266., referer: http://192.168.1.35/ Without patch, I can log in with this patron.
Ran into this too - please fix!
Created attachment 52898 [details] [review] Bug 16686 - Fix "Item in transit from since" in Holds tab "From branch" and date do not show up in patron's "Holds" tab: "Item in transit from since" OPAC log: opac-user.pl: No method frombranch! at /usr/share/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt line 607 Test Plan: 1) Apply this patch 2) Create an in transit hold 3) Not the from library is displayed
Created attachment 53050 [details] [review] Bug 16686 - Fix "Item in transit from since" in Holds tab "From branch" and date do not show up in patron's "Holds" tab: "Item in transit from since" OPAC log: opac-user.pl: No method frombranch! at /usr/share/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt line 607 Test Plan: 1) Apply this patch 2) Create an in transit hold 3) Not the from library is displayed Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 53053 [details] [review] [ALT] Bug 16686: Fix "Item in transit from since" in Holds tab POC, tests needed.
Kyle, could you have a look at this counter-patch? It seems easier to use the DBIC relationship than to create 3 new methods.
Created attachment 53084 [details] [review] Bug 16686: Fix "Item in transit from since" in Holds tab POC, tests needed. Alternative patch works for me. Signed-off-by: Marc Véron <veron@veron.ch>
(In reply to Jonathan Druart from comment #14) > Kyle, could you have a look at this counter-patch? > It seems easier to use the DBIC relationship than to create 3 new methods. While I agree, I think it adds confusion. The method name 'transfer' is a verb, so it sounds like you would call $item->transfer() to initiate a transfer. Can you change the method name to get_latest_transfer or something like that? I'm also a bit reticent about having a Koha Object return a DBIC object. Would you create Koha::Item::Transfer(s) and return that? It would also avoid a second db query just to get the branch name.
Created attachment 53190 [details] [review] Bug 16686: Rename the transfer method to get_transfer
Created attachment 53191 [details] [review] Bug 16686: Add Koha::Object based class for Koha::Item::Transfer[s]
Created attachment 53192 [details] [review] Bug 16686: Add test for Koha::Item::Transfer[s] and Koha::Item->get_transfer
(In reply to Kyle M Hall from comment #16) > (In reply to Jonathan Druart from comment #14) > > Kyle, could you have a look at this counter-patch? > > It seems easier to use the DBIC relationship than to create 3 new methods. > > While I agree, I think it adds confusion. The method name 'transfer' is a > verb, so it sounds like you would call $item->transfer() to initiate a > transfer. Can you change the method name to get_latest_transfer or something > like that? Indeed, good idea! I have chosen "get_transfer" which returns the current transfer, or undef if the item is not in transit. > I'm also a bit reticent about having a Koha Object return a DBIC object. > Would you create Koha::Item::Transfer(s) and return that? It would also > avoid a second db query just to get the branch name. Done, but I am not sure to understand how it will avoid the second query. I now use the Branches TT plugin to retrieve the branch name.
(In reply to Jonathan Druart from comment #19) > Created attachment 53192 [details] [review] [review] > Bug 16686: Add test for Koha::Item::Transfer[s] and Koha::Item->get_transfer Hi Jonathan, I think there is a typo in the file name: Tranfers.t (schould be Transfers.t) If I run the test, I get a syntax error on line 37 (similar typo) and other errors.
Created attachment 53227 [details] [review] Bug 16686: Add test for Koha::Item::Transfer[s] and Koha::Item->get_transfer
(In reply to Marc Véron from comment #21) > (In reply to Jonathan Druart from comment #19) > > Created attachment 53192 [details] [review] [review] [review] > > Bug 16686: Add test for Koha::Item::Transfer[s] and Koha::Item->get_transfer > > Hi Jonathan, I think there is a typo in the file name: Tranfers.t (schould > be Transfers.t) > If I run the test, I get a syntax error on line 37 (similar typo) and other > errors. Oops, sorry about that. I did not finish to write these tests!
Test passes now.
Created attachment 54128 [details] [review] Bug 16686: Fix "Item in transit from since" in Holds tab POC, tests needed. Alternative patch works for me. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marc <veron@veron.ch>
Created attachment 54129 [details] [review] Bug 16686: Rename the transfer method to get_transfer Signed-off-by: Marc <veron@veron.ch>
Created attachment 54130 [details] [review] Bug 16686: Add Koha::Object based class for Koha::Item::Transfer[s] Signed-off-by: Marc <veron@veron.ch>
Created attachment 54131 [details] [review] Bug 16686: Add test for Koha::Item::Transfer[s] and Koha::Item->get_transfer Signed-off-by: Marc <veron@veron.ch>
Created attachment 54392 [details] [review] Bug 16686: Fix "Item in transit from since" in Holds tab POC, tests needed. Alternative patch works for me. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 54393 [details] [review] Bug 16686: Rename the transfer method to get_transfer Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 54394 [details] [review] Bug 16686: Add Koha::Object based class for Koha::Item::Transfer[s] Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 54395 [details] [review] Bug 16686: Add test for Koha::Item::Transfer[s] and Koha::Item->get_transfer Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Items.t fails if SearchEngine is set to Elastic: prove t/db_dependent/Koha/Items.t t/db_dependent/Koha/Items.t .. 1/5 problem with :564 : :1: parser error : Start tag expected, '<' not found tAw ^ tAw at /home/vagrant/kohaclone/C4/Biblio.pm line 1339. # Looks like you planned 3 tests but ran 1. Can't call method "field" on an undefined value at /home/vagrant/kohaclone/Koha/ElasticSearch/Indexer.pm line 180. # Looks like your test exited with 255 just after 4. t/db_dependent/Koha/Items.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 1/5 subtests Test Summary Report ------------------- t/db_dependent/Koha/Items.t (Wstat: 65280 Tests: 4 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 5 tests but ran 4. Files=1, Tests=4, 1 wallclock secs ( 0.02 usr 0.00 sys + 1.30 cusr 0.13 csys = 1.45 CPU) Result: FAIL
Found the bug, unrelated. Fixed on followup to bug 16272.
Pushed to master for 16.11, thanks Jonathan!
Pushed in 16.05. Will be in 16.05.04.