Bug 32303 - DT pagination on system preference search result
Summary: DT pagination on system preference search result
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords: rel_22_11_candidate
Depends on: 32016
Blocks:
  Show dependency treegraph
 
Reported: 2022-11-21 08:59 UTC by Jonathan Druart
Modified: 2022-11-23 12:48 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00


Attachments
Bug 32303: DT pagination on system preference search result (2.11 KB, patch)
2022-11-22 15:35 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 32303: DT pagination on system preference search result (2.15 KB, patch)
2022-11-22 22:48 UTC, David Nind
Details | Diff | Splinter Review
Bug 32303: Remove DT pagination on system preference search result (2.24 KB, patch)
2022-11-23 08:06 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2022-11-21 08:59:12 UTC
Weird thing here, The DataTable pagination is displayed when it should not, and it appears twice.

To recreate, search for "last"

http://kohadev-intra.mydnsname.org:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=last

Go to the "OPAC" section, and see: https://snipboard.io/E3boHT.jpg
Comment 1 Katrin Fischer 2022-11-21 20:13:01 UTC
When I search for 'e' I see even 3 datatable controls on the first entry.
Comment 2 Owen Leonard 2022-11-22 15:35:25 UTC
Created attachment 144159 [details] [review]
Bug 32303: 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.
Comment 3 David Nind 2022-11-22 22:48:36 UTC
Created attachment 144178 [details] [review]
Bug 32303: 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>
Comment 4 Jonathan Druart 2022-11-23 08:06:19 UTC
Created attachment 144187 [details] [review]
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>
Comment 5 Tomás Cohen Arazi 2022-11-23 12:48:32 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!