Bug 39861 - Z39.50/SRU servers on second page of results cannot be deleted
Summary: Z39.50/SRU servers on second page of results cannot be deleted
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: David Cook
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-08 10:33 UTC by Nick Clemens (kidclamp)
Modified: 2025-05-09 07:15 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the Z39.50/SRU servers page so that servers on the second (and later) page of results can now be deleted.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39861: Delegate click function to the table (1.74 KB, patch)
2025-05-08 15:00 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 39861: Delegate click function to the table (1.79 KB, patch)
2025-05-08 20:10 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 39861: Delegate click function to the table (1.84 KB, patch)
2025-05-08 20:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 39861: Delegate click function to the table (1.89 KB, patch)
2025-05-09 01:42 UTC, David Cook
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-05-08 10:33:08 UTC
It seems that when paginating the Z3950 sources table, the event for the delete button is not attached to the second page of results.

To recreate:
1 - Add a new Z3950 server with basic information filled out, it doesn't need to be valid
2 - Add a second copy via the DB:
    INSERT INTO z3950servers SELECT null,host,port,db,userid,password,servername,checked,rank,syntax,timeout,servertype,encoding,recordtype,sru_options,sru_fields,add_xslt,attributes FROM z3950servers WHERE id=6;
3 - Delete the copy, assuming it is on page one, it works
4 - Spam the DB with the SQL above and create 20+ entries
5 - Open the Z3950 admin page
6 - Go to second page of servers
7 - Attempt to delete any entry
8 - Nothing happens
Comment 1 Lucas Gass (lukeg) 2025-05-08 15:00:00 UTC
Created attachment 182090 [details] [review]
Bug 39861: Delegate click function to the table

To test:
1 - Add a new Z3950 server with basic information filled out, it doesn't need to be valid
2 - Add a second copy via the DB:
    INSERT INTO z3950servers SELECT null,host,port,db,userid,password,servername,checked,rank,syntax,timeout,servertype,encoding,recordtype,sru_options,sru_fields,add_xslt,attributes FROM z3950servers WHERE id=6;
3 - Delete the copy, assuming it is on page one, it works
4 - Spam the DB with the SQL above and create 20+ entries
5 - Open the Z3950 admin page
6 - Go to second page of servers
7 - Attempt to delete any entry
8 - Nothing happens
9 - APPLY PATCH
10 - Try deleting again, it should now work.
Comment 2 Roman Dolny 2025-05-08 20:10:23 UTC
Created attachment 182118 [details] [review]
Bug 39861: Delegate click function to the table

To test:
1 - Add a new Z3950 server with basic information filled out, it doesn't need to be valid
2 - Add a second copy via the DB:
    INSERT INTO z3950servers SELECT null,host,port,db,userid,password,servername,checked,rank,syntax,timeout,servertype,encoding,recordtype,sru_options,sru_fields,add_xslt,attributes FROM z3950servers WHERE id=6;
3 - Delete the copy, assuming it is on page one, it works
4 - Spam the DB with the SQL above and create 20+ entries
5 - Open the Z3950 admin page
6 - Go to second page of servers
7 - Attempt to delete any entry
8 - Nothing happens
9 - APPLY PATCH
10 - Try deleting again, it should now work.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 3 David Nind 2025-05-08 20:23:15 UTC
Created attachment 182119 [details] [review]
Bug 39861: Delegate click function to the table

To test:
1 - Add a new Z3950 server with basic information filled out, it doesn't need to be valid
2 - Add a second copy via the DB:
    INSERT INTO z3950servers SELECT null,host,port,db,userid,password,servername,checked,rank,syntax,timeout,servertype,encoding,recordtype,sru_options,sru_fields,add_xslt,attributes FROM z3950servers WHERE id=6;
3 - Delete the copy, assuming it is on page one, it works
4 - Spam the DB with the SQL above and create 20+ entries
5 - Open the Z3950 admin page
6 - Go to second page of servers
7 - Attempt to delete any entry
8 - Nothing happens
9 - APPLY PATCH
10 - Try deleting again, it should now work.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Cook 2025-05-09 01:40:54 UTC
Trying this out and interestingly it only applies to 20+ entries.

If you have 10+ entries and change it to "Show 10 entries", you can delete from the second page. I guess that's because the click handler was added for the original <= 20 entries
Comment 5 David Cook 2025-05-09 01:42:32 UTC
Created attachment 182134 [details] [review]
Bug 39861: Delegate click function to the table

To test:
1 - Add a new Z3950 server with basic information filled out, it doesn't need to be valid
2 - Add a second copy via the DB:
    INSERT INTO z3950servers SELECT null,host,port,db,userid,password,servername,checked,rank,syntax,timeout,servertype,encoding,recordtype,sru_options,sru_fields,add_xslt,attributes FROM z3950servers WHERE id=6;
3 - Delete the copy, assuming it is on page one, it works
4 - Spam the DB with the SQL above and create 20+ entries
5 - Open the Z3950 admin page
6 - Go to second page of servers
7 - Attempt to delete any entry
8 - Nothing happens
9 - APPLY PATCH
10 - Try deleting again, it should now work.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 6 Katrin Fischer 2025-05-09 07:15:01 UTC
Pushed for 25.05!

Well done everyone, thank you!