]> git.koha-community.org Git - koha.git/commit
Bug 36447: Circ rules slow to load when many itemtypes and categories
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 28 Mar 2024 14:55:05 +0000 (10:55 -0400)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 17 Apr 2024 15:22:53 +0000 (17:22 +0200)
commitc13b941429d25a16c268c90f05b1b4c17fa0bcde
tree3fbdc7f39d104a70bac9e36c697e6b7c962a30af
parent067522e35e2ee22bc5808db213cdbae76a8ee5ce
Bug 36447: Circ rules slow to load when many itemtypes and categories

It seems that we loop all categories and item types to build the circ
matrix. We should only loop over values that have actually been used
in circulation rules.

Test Plan:
1) Create 1000 itemtypes and category codes. You can use the following
   script:

   use t::lib::TestBuilder;
   my $builder = t::lib::TestBuilder->new();
   $builder->build( { source => 'Category' } ) for 0..1000;
   $builder->build( { source => 'Itemtype' } ) for 0..1000;

2) Note the lengthy load time for smart-rules.pl
3) Apply this patch
4) Restart all the things!
5) Reload the page
6) Note the much faster load time!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4e04ff28b61b76e188e929c2e2814ff2190853b3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
admin/smart-rules.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt