This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "main Koha release repository".
The branch, 20.05.x has been updated via e7bfecc25c07252c1558cf828d4a7fddb2ad1720 (commit) from e0ec375ee31270a8ee123e116355086ad58fa36d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e7bfecc25c07252c1558cf828d4a7fddb2ad1720 Author: Nick Clemens <n...@bywatersolutions.com> Date: Wed Nov 11 01:24:15 2020 +0000 Bug 26963: [20.05.x] Bug 26963: Unit tests Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Bug 26963: Don't call 'can_be_transferred' for each possible library for each item Currently When calling Koha::Template::Plugin::Branches::pickup_locations we call pickup_location for each item of the bib, and for each item we get a list of possible branches, we then check those branches against the transfer limits, this is inefficent Given a system with 100 branches, and each branch having an item attached to one bib (100 items) we will call can_be_transferred ~10000 times - and that will happen for each hold placed on the bib For me this patch reduced load time from 77 seconds to 18 seconds To test: 1 - Find a bib 2 - Place 4 title level holds 3 - Add some branches and items for this bib to your system: INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"A"),pickup_location FROM branches; INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"B"),pickup_location FROM branches; INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"C"),pickup_location FROM branches; INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"D"),pickup_location FROM branches; INSERT INTO items (biblionumber,biblioitemnumber,barcode,itype,homebranch,holdingbranch) SELECT 1,1,CONCAT("test-",branchcode),'BKS',branchcode,branchcode FROM branches; 4 - Set systempreferences: UseBranchTransferLimits = 'enforce' BranchTransferLimitsType = 'item type' 5 - Find the bib and click the holds tab 6 - Wait for a long time, it shoudl eventually load 7 - Apply patch and restart al the things 8 - Load the page again, it should be much faster Signed-off-by: Andrew Fuerste-Henry <and...@bywatersolutions.com> Signed-off-by: Bob Bennhoff <bbennh...@clicweb.org> Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Bug 26963: (follow-up) Change subroutine name for QA tools It didn't like the ending _at Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Bug 26963: (QA follow-up) Convert to ResultSets This patch removes the previously introduced private method by converting the arrayref returns to ResultSets appropriately and inlining the filter search queries. Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Bug 26963: (QA follow-up) Migrate unit tests into pickup_location We wrote unit tests for _can_pickup_locations as part of this patchset, but then I inlined the method whilst golfing. This patch moves those tests into the existing pickup_locations test so we more thoroughly cover the case where branch transfer limits are in play. NOTE: The tests all assume that all items have an effective_itemtype and ccode. I'm pretty sure items all have a type at this point, but I'm less sure we enforce collection codes? Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Bug 26963: (QA follow-up) Don't delete existing data before tests Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Bug 26963: (QA follow-up) Update mocked return of pickup_locations Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Bug 26963: (QA follow-up) Fix cases where we expected a list Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Bug 26963: (QA follow-up) Fix up tests and cover case of undefined ccode While this technically shouldn't happen, if a library creates itemtype limits, then flips the pref, those rules are still in the db until a ccode rule is saved. To be extra safe, when checking for rules of one type, we should make sure the other type is undef - i.e. if looking for ccode rules, we should confirm the itype is undef for those rules Additionally, we shouldn't set the barcode now that we are not deleting all items, so we use copynumber for our item identification field as it doesn't need to be unique in the DB Signed-off-by: Nick Clemens <n...@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomasco...@theke.io> Bug 26963: Ignore existing libraries Signed-off-by: Lucas Gass <lu...@bywatersolutions.com> Signed-off-by: Lucas Gass <lu...@bywatersolutions.com> ----------------------------------------------------------------------- Summary of changes: Koha/Biblio.pm | 2 +- Koha/Item.pm | 61 ++++--- Koha/Library.pm | 2 +- Koha/Template/Plugin/Branches.pm | 2 +- reserve/request.pl | 2 +- t/db_dependent/Koha/Item.t | 275 ++++++++++++++++++++---------- t/db_dependent/Template/Plugin/Branches.t | 3 +- 7 files changed, 231 insertions(+), 116 deletions(-) hooks/post-receive -- main Koha release repository _______________________________________________ koha-commits mailing list koha-commits@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-commits