Bugzilla – Attachment 166607 Details for
Bug 36797
Record with 1000+ holds and unique priorities causes a 500 error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36797: Change WHILE loop into FOREACH
Bug-36797-Change-WHILE-loop-into-FOREACH.patch (text/plain), 3.19 KB, created by
Nick Clemens (kidclamp)
on 2024-05-10 19:05:59 UTC
(
hide
)
Description:
Bug 36797: Change WHILE loop into FOREACH
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-05-10 19:05:59 UTC
Size:
3.19 KB
patch
obsolete
>From 836ad7e7c4343eea8fdecc3a2a2776200748f3ab Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 7 May 2024 16:03:54 +0000 >Subject: [PATCH] Bug 36797: Change WHILE loop into FOREACH > >To test: >1. Find a record that has 1000 non-waiting holds with different priorities. >2. Try loading the reserve page for that record ( /reserve/request.pl?biblionumber=X ) >3. Error: Template process failed: undef error - WHILE loop terminated (> 1000 iterations) >4. APPLY PATCH >5. Try again, this time the page should load. >6. Try testing on a record with less than 1000 holds, making sure the priorities are still set right. >7. Make sure you can change your priorities and everything works right. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../prog/en/includes/holds_table.inc | 22 +++++++++---------- > 1 file changed, 11 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index b532ff9fe74..af0e79c8c47 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -31,17 +31,11 @@ > [%- SET found_holds = 0 -%] > [%- SET last_priority = holds.last.priority -%] > >- [% BLOCK priority_dropdown %] >- [%- SET loop_priority = 1 -%] >- [%- WHILE loop_priority <= last_priority -%] >- [%- IF this_priority == loop_priority -%] >- <option value="[% loop_priority | html %]" selected="selected">[% loop_priority | html %]</option> >- [%- ELSE -%] >- <option value="[% loop_priority | html %]">[% loop_priority | html %]</option> >- [%- END -%] >- [%- loop_priority = loop_priority + 1- %] >- [%- END -%] >+ [% SET all_priorities = [] %] >+ [% FOREACH hold IN holds %] >+ [% all_priorities.push( hold.priority ) %] > [% END %] >+ > <tbody> > [% FOREACH hold IN holds %] > [%- IF !hold.found && first_priority == 0 -%] >@@ -67,7 +61,13 @@ > [% IF Koha.Preference('HoldsSplitQueue') == "nothing" && !hold.found %] > <select name="rank-request" class="rank-request" data-hold-id="[% hold.reserve_id | html %]"> > [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- [% PROCESS priority_dropdown %] >+ [% FOREACH priority IN all_priorities %] >+ [% IF priority == this_priority %] >+ <option value="[% priority | html %]" selected="selected">[% priority | html %]</option> >+ [% ELSE %] >+ <option value="[% priority | html %]">[% priority | html %]</option> >+ [% END %] >+ [% END %] > [% ELSE %] > <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option> > [% END %] >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36797
:
166302
|
166327
| 166607