https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36668

Pedro Amorim <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #165325|0                           |1
        is obsolete|                            |

--- Comment #2 from Pedro Amorim <[email protected]> ---
Created attachment 166107
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166107&action=edit
Bug 36668: Excessive whitespace/newlines in circulation rules editor may cause
slow loads with large rules sets

Simply put we have a lot of SET lines and such in our circ rules editor
template. For large rule sets all the newlines add up and can balloon the
rendered html size to many megabytes! We should add a newline chomper to these
lines.

1) Generate a large number of circ rules with the following perl script

use Koha::CirculationRules;
use Koha::Patron::Categories;
use Koha::ItemTypes;

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

C4::Context->dbh->do("
    INSERT IGNORE INTO circulation_rules ( branchcode, categorycode, itemtype,
rule_name, rule_value )
    SELECT NULL, categories.categorycode, itemtypes.itemtype, 'issuelength', 5
    FROM categories JOIN itemtypes;"
);

2) Open the network debugging on your web browser
3) Load smart-rules.pl
4) Notice the size of the file
5) Apply this patch
6) Restart all the things!
7) Reload smart-rules.pl
8) Note the file size has been drastically reduced!

Signed-off-by: Pedro Amorim <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to