[Bug 39239] New: Add an optional default manageddate filter to speed up loading suggestions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39239 Bug ID: 39239 Summary: Add an optional default manageddate filter to speed up loading suggestions Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Although you can archive suggestions and make the performance a bit better, it still takes quite long to load the suggestions page. I am proposing here to add a pref that controls the initial manageddate_from filter to further control the number of loaded suggestions. After loading the user can always change the filter. -- 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=39239 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Already tested this tiny change with a local use pref: diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 2090a8a..f221bc7 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -409,6 +409,10 @@ if ($op=~/else/) { my $from_dt = $from && eval { dt_from_string($from) }; my $to_dt = $to && eval { dt_from_string($to) }; + if ( ( my $from_pref = C4::Context->preference('SuggestionsDefaultManagedFrom') ) && $field eq 'manageddate' ) { + $from_dt ||= dt_from_string()->subtract( days => $from_pref ); + $template->param( "${field}_from" => $from_dt ); + } if ( $from_dt || $to_dt ) { my $dtf = Koha::Database->new->schema->storage->datetime_parser; if ( $from_dt && $to_dt ) { -- 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=39239 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- The above SuggestionsDefaultManagedFrom is the age in days that you want to limit suggestions by, looking at manageddate. -- 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=39239 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- And with this tiny change, the Suggestions filter opens up to indicate that we added a default filter: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index ffa2363..098aa56 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -1450,6 +1450,9 @@ return true; }); }); + [% IF manageddate_from %] + $("fieldset.suggestion_information").toggle(); + [% END %] </script> [% END %] [% IF op == 'save' %] -- 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=39239 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- So yes, this is kind of a 'low budget' workaround to not refactor the whole thing rightaway (which is much more work). Although we are fetching say 100-200 records, it still takes too much time. If you have over 1000, you probably time out. -- 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=39239 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 178976 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178976&action=edit Bug 39239: Speed up loading suggestions with manageddate filter -- 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=39239 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@ptfs-europe.co | |m --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Current patch just illustrates this workaround. We actually need larger refactoring. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org