[Bug 34639] New: Item shown in transit on detail.pl even if marked as arrived or cancelled
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Bug ID: 34639 Summary: Item shown in transit on detail.pl even if marked as arrived or cancelled Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: lari.taskula@hypernova.fi QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com To reproduce: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" -- 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=34639 --- Comment #1 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 154895 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154895&action=edit Bug 34639: (DO NOT PUSH) Add tests To reproduce: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" To test: 1. prove t/db_dependent/Koha/Item/Transfer.t -- 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=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lari.taskula@hypernova.fi |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=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154895|0 |1 is obsolete| | --- Comment #2 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 154896 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154896&action=edit Bug 34639: (DO NOT PUSH) Add tests To reproduce: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" To test: 1. prove t/db_dependent/Koha/Item/Transfer.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33497 --- Comment #3 from Lari Taskula <lari.taskula@hypernova.fi> --- Reproducible after Bug 33497 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33497 [Bug 33497] Reduce DB calls on staff detail page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 --- Comment #4 from Lari Taskula <lari.taskula@hypernova.fi> --- I do not yet understand why but something changed after prefetching current_branchtransfers. It returns a transfer even if it shouldn't when the transfer contains a datetime in datearrived or datecancelled. Koha/Schema/Result/Item.pm ... __PACKAGE__->has_many( "current_branchtransfers", "Koha::Schema::Result::Branchtransfer", { 'foreign.itemnumber' => 'self.itemnumber' }, { where => { datearrived => undef, datecancelled => undef }, order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ] } ); current_branchtransfers by itself works fine but together with the prefetch in detail.pl something gets broken. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 --- Comment #5 from Lari Taskula <lari.taskula@hypernova.fi> --- The WHERE condition in "current_branchtransfers" is completely ignored when prefetching current transfers. Tracing the query reveals this: $schema->storage->debug(1); my $items = Koha::Items->search( { 'me.itemnumber' => $transfer_item->itemnumber }, { prefetch => ['current_branchtransfers'] } ); warn $items->next; SELECT `me`.`itemnumber`, `me`.`biblionumber`, `me`.`biblioitemnumber`, `me`.`barcode`, `me`.`dateaccessioned`, `me`.`booksellerid`, `me`.`homebranch`, `me`.`price`, `me`.`replacementprice`, `me`.`replacementpricedate`, `me`.`datelastborrowed`, `me`.`datelastseen`, `me`.`stack`, `me`.`notforloan`, `me`.`damaged`, `me`.`damaged_on`, `me`.`itemlost`, `me`.`itemlost_on`, `me`.`withdrawn`, `me`.`withdrawn_on`, `me`.`itemcallnumber`, `me`.`coded_location_qualifier`, `me`.`issues`, `me`.`renewals`, `me`.`reserves`, `me`.`restricted`, `me`.`itemnotes`, `me`.`itemnotes_nonpublic`, `me`.`holdingbranch`, `me`.`timestamp`, `me`.`deleted_on`, `me`.`location`, `me`.`permanent_location`, `me`.`onloan`, `me`.`cn_source`, `me`.`cn_sort`, `me`.`ccode`, `me`.`materials`, `me`.`uri`, `me`.`itype`, `me`.`more_subfields_xml`, `me`.`enumchron`, `me`.`copynumber`, `me`.`stocknumber`, `me`.`new_status`, `me`.`exclude_from_local_holds_priority`, `current_branchtransfers`.`branchtransfer_id`, `current_branchtransfers`.`itemnumber`, `current_branchtransfers`.`daterequested`, `current_branchtransfers`.`datesent`, `current_branchtransfers`.`frombranch`, `current_branchtransfers`.`datearrived`, `current_branchtransfers`.`datecancelled`, `current_branchtransfers`.`tobranch`, `current_branchtransfers`.`comments`, `current_branchtransfers`.`reason`, `current_branchtransfers`.`cancellation_reason` FROM `items` `me` LEFT JOIN `branchtransfers` `current_branchtransfers` ON `current_branchtransfers`.`itemnumber` = `me`.`itemnumber` WHERE ( `me`.`itemnumber` = ? ) ORDER BY `me`.`itemnumber`: '1857' So all transfers are fetched instead regardless of their status. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 --- Comment #6 from Lari Taskula <lari.taskula@hypernova.fi> --- (In reply to Lari Taskula from comment #5)
The WHERE condition in "current_branchtransfers" is completely ignored when prefetching current transfers.
Ah this is surely intentional in detail.pl and we are meant to fetch all items and transfers here. detail.tt then eventually calls Koha::Item->get_transfer() which should limit to current/active transfers. I still do not understand why it doesn't. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 154900 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154900&action=edit Bug 34639: Use coderef for releationship This patch switches from a simple relationship to a custom join as illustrated in the DBIx::Class docs Reference: https://metacpan.org/pod/DBIx::Class::Relationship::Base#Custom-join-conditi... This does not include an order_by, so I am not sure if it is sufficient To test: 1 - On command line: export DBIC_TRACE=1; 2 - Save simple script: use Modern::Perl; use Koha::Items; my $items = Koha::Items->search( {'me.itemnumber'=>27}, {prefetch => 'current_branchtransfers'} ); my $item = $items->next; warn $item->_result->current_branchtransfers->count(); warn $item->get_transfer(); 3 - run it 4 - Note that the query doesn't include conditions on the transfers 5 - Apply patch 6 - Repeat 7 - Note that query is correct Test in staf client: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" 9. Apply patch 10. Restart all 11. Reload details - item no longer in transit -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154896|0 |1 is obsolete| | --- Comment #8 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 154917 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154917&action=edit Bug 34639: Add tests To test: 1. prove t/db_dependent/Koha/Item.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 --- Comment #9 from Lari Taskula <lari.taskula@hypernova.fi> --- (In reply to Nick Clemens from comment #7)
Created attachment 154900 [details] [review] Bug 34639: Use coderef for releationship This does not include an order_by, so I am not sure if it is sufficient
prove t/db_dependent/Koha/Item.t fails with # Subtest: get_transfers 1..16 ok 1 - Koha::Item->get_transfer should return a Koha::Item::Transfers object ok 2 - When no transfers exist, the Koha::Item:Transfers object should be empty ok 3 - When one transfer has been requested, the Koha::Item:Transfers object should contain one result ok 4 - When there are multiple open transfer requests, the Koha::Item::Transfers object contains them all ok 5 - Koha::Item->get_transfers returns the oldest transfer request first ok 6 - Koha::Item->get_transfers returns the newer transfer request second ok 7 - Koha::Item->get_transfers returns the newest transfer request last ok 8 - When one transfer is set to in_transit, the Koha::Item::Transfers object still contains them all not ok 9 - Koha::Item->get_transfers returns the active transfer request first # Failed test 'Koha::Item->get_transfers returns the active transfer request first' # at t/db_dependent/Koha/Item.t line 1158. # got: '369' # expected: '370' not ok 10 - Koha::Item->get_transfers returns the other transfers oldest to newest # Failed test 'Koha::Item->get_transfers returns the other transfers oldest to newest' # at t/db_dependent/Koha/Item.t line 1159. # got: '370' # expected: '369' ok 11 - Koha::Item->get_transfers returns the other transfers oldest to newest ok 12 - Once a transfer is received, it no longer appears in the list from ->get_transfers() ok 13 - Koha::Item->get_transfers returns the other transfers oldest to newest ok 14 - Koha::Item->get_transfers returns the other transfers oldest to newest ok 15 - Once a transfer is cancelled, it no longer appears in the list from ->get_transfers() ok 16 - Koha::Item->get_transfers returns the only transfer that remains # Looks like you failed 2 tests of 16. not ok 18 - get_transfers Other than that your patch seems to fix the original issue. Awesome! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154917|0 |1 is obsolete| | --- Comment #10 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 154918 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154918&action=edit Bug 34639: Add tests To reproduce: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" To test: 1. prove t/db_dependent/Koha/Item.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 --- Comment #11 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 154919 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154919&action=edit Bug 34639: Restore order_by To test: 1. prove t/db_dependent/Koha/Item.t 2. Observe success -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #12 from Lari Taskula <lari.taskula@hypernova.fi> --- Adding order_by back the way it was before works just fine. I confirmed this with dumping the SQL trace and it indeed still performs the ORDER BY SELECT `me`.`branchtransfer_id`, `me`.`itemnumber`, `me`.`daterequested`, `me`.`datesent`, `me`.`frombranch`, `me`.`datearrived`, `me`.`datecancelled`, `me`.`tobranch`, `me`.`comments`, `me`.`reason`, `me`.`cancellation_reason` FROM `items` `item__row` JOIN `branchtransfers` `me` ON ( `me`.`datearrived` IS NULL AND `me`.`datecancelled` IS NULL AND `me`.`itemnumber` = `item__row`.`itemnumber` ) WHERE ( `item__row`.`itemnumber` = ? ) ORDER BY `datesent` DESC, `daterequested` ASC: '2299 It now looks okay to me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=34554 CC| |azmikhalib@utm.my --- Comment #13 from Lari Taskula <lari.taskula@hypernova.fi> --- *** Bug 34554 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154918|0 |1 is obsolete| | --- Comment #14 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 154939 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154939&action=edit Bug 34639: Add tests To reproduce: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" To test: 1. prove t/db_dependent/Koha/Item.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154900|0 |1 is obsolete| | --- Comment #15 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 154940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154940&action=edit Bug 34639: Use coderef for releationship This patch switches from a simple relationship to a custom join as illustrated in the DBIx::Class docs Reference: https://metacpan.org/pod/DBIx::Class::Relationship::Base#Custom-join-conditi... This does not include an order_by, so I am not sure if it is sufficient To test: 1 - On command line: export DBIC_TRACE=1; 2 - Save simple script: use Modern::Perl; use Koha::Items; my $items = Koha::Items->search( {'me.itemnumber'=>27}, {prefetch => 'current_branchtransfers'} ); my $item = $items->next; warn $item->_result->current_branchtransfers->count(); warn $item->get_transfer(); 3 - run it 4 - Note that the query doesn't include conditions on the transfers 5 - Apply patch 6 - Repeat 7 - Note that query is correct Test in staf client: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" 9. Apply patch 10. Restart all 11. Reload details - item no longer in transit Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154919|0 |1 is obsolete| | --- Comment #16 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 154941 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154941&action=edit Bug 34639: Restore order_by To test: 1. prove t/db_dependent/Koha/Item.t 2. Observe success -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P1 - high Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #17 from Owen Leonard <oleonard@myacpl.org> --- This looks like it's working well but the QA script warns about tidiness. Can you please 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=34639 Lari Taskula <lari.taskula@hypernova.fi> 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=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154939|0 |1 is obsolete| | --- Comment #18 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 155127 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155127&action=edit Bug 34639: Add tests To reproduce: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" To test: 1. prove t/db_dependent/Koha/Item.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154940|0 |1 is obsolete| | --- Comment #19 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 155128 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155128&action=edit Bug 34639: Use coderef for releationship This patch switches from a simple relationship to a custom join as illustrated in the DBIx::Class docs Reference: https://metacpan.org/pod/DBIx::Class::Relationship::Base#Custom-join-conditi... This does not include an order_by, so I am not sure if it is sufficient To test: 1 - On command line: export DBIC_TRACE=1; 2 - Save simple script: use Modern::Perl; use Koha::Items; my $items = Koha::Items->search( {'me.itemnumber'=>27}, {prefetch => 'current_branchtransfers'} ); my $item = $items->next; warn $item->_result->current_branchtransfers->count(); warn $item->get_transfer(); 3 - run it 4 - Note that the query doesn't include conditions on the transfers 5 - Apply patch 6 - Repeat 7 - Note that query is correct Test in staf client: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" 9. Apply patch 10. Restart all 11. Reload details - item no longer in transit Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154941|0 |1 is obsolete| | --- Comment #20 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 155129 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155129&action=edit Bug 34639: Restore order_by To test: 1. prove t/db_dependent/Koha/Item.t 2. Observe success -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 --- Comment #21 from Lari Taskula <lari.taskula@hypernova.fi> --- (In reply to Owen Leonard from comment #17)
This looks like it's working well but the QA script warns about tidiness. Can you please take a look?
Thanks, wasn't aware of such change. I've now tidied all patches. (Nick, I took the freedom to squash perltidy fixes to your patch.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #22 from David Nind <david@davidnind.com> --- I have tested - for the staff interface it fixes things for the display, and the tests pass. However, I don't know enough about SQL queries to verify whether the query is correct (step 7 for the command line tests). So I will leave for someone else to sign off. Testing notes (using KTD): 1. Saved script in step 2 as test.pl, rang script using: perl test.pl. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=34639 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155127|0 |1 is obsolete| | Attachment #155128|0 |1 is obsolete| | Attachment #155129|0 |1 is obsolete| | --- Comment #23 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 155211 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155211&action=edit Bug 34639: Add tests To reproduce: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" To test: 1. prove t/db_dependent/Koha/Item.t 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=34639 --- Comment #24 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 155212 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155212&action=edit Bug 34639: Use coderef for releationship This patch switches from a simple relationship to a custom join as illustrated in the DBIx::Class docs Reference: https://metacpan.org/pod/DBIx::Class::Relationship::Base#Custom-join-conditi... This does not include an order_by, so I am not sure if it is sufficient To test: 1 - On command line: export DBIC_TRACE=1; 2 - Save simple script: use Modern::Perl; use Koha::Items; my $items = Koha::Items->search( {'me.itemnumber'=>27}, {prefetch => 'current_branchtransfers'} ); my $item = $items->next; warn $item->_result->current_branchtransfers->count(); warn $item->get_transfer(); 3 - run it 4 - Note that the query doesn't include conditions on the transfers 5 - Apply patch 6 - Repeat 7 - Note that query is correct Test in staf client: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" 9. Apply patch 10. Restart all 11. Reload details - item no longer in transit Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi> 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=34639 --- Comment #25 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 155213 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155213&action=edit Bug 34639: Restore order_by To test: 1. prove t/db_dependent/Koha/Item.t 2. Observe success 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=34639 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=34639 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155211|0 |1 is obsolete| | --- Comment #26 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 155236 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155236&action=edit Bug 34639: Add tests To reproduce: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" To test: 1. prove t/db_dependent/Koha/Item.t Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155212|0 |1 is obsolete| | --- Comment #27 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 155237 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155237&action=edit Bug 34639: Use coderef for releationship This patch switches from a simple relationship to a custom join as illustrated in the DBIx::Class docs Reference: https://metacpan.org/pod/DBIx::Class::Relationship::Base#Custom-join-conditi... This does not include an order_by, so I am not sure if it is sufficient To test: 1 - On command line: export DBIC_TRACE=1; 2 - Save simple script: use Modern::Perl; use Koha::Items; my $items = Koha::Items->search( {'me.itemnumber'=>27}, {prefetch => 'current_branchtransfers'} ); my $item = $items->next; warn $item->_result->current_branchtransfers->count(); warn $item->get_transfer(); 3 - run it 4 - Note that the query doesn't include conditions on the transfers 5 - Apply patch 6 - Repeat 7 - Note that query is correct Test in staf client: 1. Add an item to library A 2. Go to Circulation -> Transfer 3. Transfer the item from library A to another library B 4. Set your currently logged in library to library B 5. Check-in the item 6. Observe message "Item received from A" 7. View the bibliographic record of the item (catalogue/detail.pl) 8. Observe item in "In transit from A to B since xx/xx/xxxx Available" 9. Apply patch 10. Restart all 11. Reload details - item no longer in transit Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155213|0 |1 is obsolete| | --- Comment #28 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 155238 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155238&action=edit Bug 34639: Restore order_by To test: 1. prove t/db_dependent/Koha/Item.t 2. Observe success Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |aleisha@catalyst.net.nz |y.org | CC| |aleisha@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 --- Comment #29 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|23.11.00 |23.11.00,23.05.04 released in| | --- Comment #30 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to stable |RESOLVED CC| |matt.blenkinsop@ptfs-europe | |.com --- Comment #31 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Missing dependency for 22.11.x - not backporting Nice work everyone! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34639 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35100 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35100 [Bug 35100] Items assigned to StockRotation do not advance if a reserve is triggered before the initial transfer -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org