]> git.koha-community.org Git - koha.git/commit
Bug 28784: Remove code related to num_paragraph cookie
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 3 Aug 2021 08:58:47 +0000 (10:58 +0200)
committerWainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
Thu, 19 Aug 2021 02:16:28 +0000 (02:16 +0000)
commit351c7a92069eb443bc75b137832a5082edea1d63
treeb1189c9ec313ff5068bae5063ce35f3645a3f105
parent8f47d1b619beee636344d0a75ed4a570e6db48d1
Bug 28784: Remove code related to num_paragraph cookie

It could lead to server freeze if set to a big value (we are pushing
into an array and so RAM is being fulfilled, and CPU is looping).

I don't understand the point of this cookie.

        var numPar = $("#booleansearch fieldset p").size();
        if (numPar > [% search_boxes_count | html %]){
            jQuery.cookie("num_paragraph", numPar,{ path: '/'});
        }else{
            jQuery.removeCookie("num_paragraph", { path: '/'});
        }

But "#booleansearch fieldset p" does not exist, it's not 'p' but 'div'
elements.

I've removed the code related to num_paragraph and the "Return to the
last advanced search" feature still works as before.

From this comment:
    # determine what to display next to the search boxes (ie, boolean option
    # shouldn't appear on the first one, scan indexes should, adding a new
    # box should only appear on the last, etc.

The only bit that is not working as described is "adding a new box
should only appear on the last", but it has been working this way for
a long time already I think, and I don't see it as a bug.

Test plan:
Read the code, check that the above is correct.
Search for regression in this "return to last adv search" feature added
by bug 13307.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit d951d300f92a595adf4e8f40f6b25b0dffa4b721)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit d951d300f92a595adf4e8f40f6b25b0dffa4b721)
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt
opac/opac-search.pl