Bug 32303: Remove DT pagination on system preference search result
authorOwen Leonard <oleonard@myacpl.org>
Tue, 22 Nov 2022 15:19:52 +0000 (15:19 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 23 Nov 2022 12:35:40 +0000 (09:35 -0300)
commit4e5776d1ad9a64c02291e50dd7704e6cb2cd99aa
tree1cb3ca07f8569a2873347e8b4e6b91bbb5817ca6
parent270715d9b73e3eef8a46b3152fc4f9a37c720090
Bug 32303: Remove DT pagination on system preference search result

This patch updates the way we retrieve a DataTable's saved state during
initialization. The change is to prevent cases where making a duplicate
call to DataTables() initializes the table again.

To recreate the bug, search system preferences for the term "last."
Scroll down to the "OPAC preferences" section and observe that there are
two filter forms displayed above it.

Apply the patch and perform the same search again. The extra forms
should be gone.

Confirm that DataTables behavior is still the same:

 - Test pages which use the "saveState" option in DataTables.
   - Type text in the table's search field
   - Reload the page. The search field should still have the string you
     entered, and the "Clear filter" button should be active.
     - Administration -> Libraries
     - Acquisitions -> Vendor -> Receive shipments -> Receive orders
     - Circulation -> Overdues

 - Test pages which don't use the "saveState" option, e.g. the checkout
   screen, patron search results, list of saved reports, etc. The
   behavior of the search form and table operations in general should be
   unchanged.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/js/datatables.js