Commit graph

56365 commits

Author SHA1 Message Date
996ec95274
Bug 38846: Only call getLanguages for advanced search pages
This change makes it so that C4::Languages::getLanguages is only
called for the advanced search pages and not the search result pages
where the output is not used.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?expanded_options=1
2. Note that the "Language" and "Language of original" dropdowns appear with language
options
3. Go to the following
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?advsearch=1
&idx=kw&q=test&sort_by=relevance
4. Note that the page loads normally

5. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?expanded_options=1
6. Note that the "Language" dropdown appears with language options
7. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
8. Note that the page loads normally

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:24 +01:00
9e894ee790
Bug 38857: (QA follow-up) Fix perltidy errors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:23 +01:00
ed04d5b0fa
Bug 38857: Update cronjobs to log run before processing parameters
A few notes:
- I grabbed this list by looking for things in misc/ that had cronlogaction
- I didn't touch scripts that aren't in the cronjobs directory, except
  fix_invalid_dates where I follow import_patrons and only log if confirmed
  since they aren't crons, I figure this seems reasonable
- purge_suggestions I moved the logggin up and changed the addition of
  effective days to a verbose message - this seems more consistent

To test:
 1 - Enable CronjobLog
 2 - On command line:
     perl misc/cronjobs/cleanup_database.pl --old_reservers 550
 3 - Error on command line
 4 - In staff client, go to Tools->Log viewer, check 'Cronjobs' and submit
 5 - No entries
 6 - Apply patch
 7 - Repeat and see run is logged with wrong parameter
 8 - Fix parameter and confirm
 9 - Spot check other files until you are satisfied
10 - Sign it off!

Signed-off-by: William Lavoie <william.lavoie@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:23 +01:00
5a3380a751
Bug 38232: Pass exemptfine value into circ-needsconfirmation-modal form
To test:
1. FinesMode on
2. CircConfirmItemParts on
3. have an item with a materials specified note (952$3)
4. Check in item with 'forgive overdue charge' selected, no materials note, box stays checked.
5. Check in item with 'forgive overdue charge' selected, with a material note, Materials note checkin deselects the box.
6. APPLY PATCH
7. Try steps 4-5 again, the correct value should be retained in the 'forgive overdue charge' checkbox.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:22 +01:00
27ea32e74b
Bug 34068: Mock RESTdefaultPageSize
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:22 +01:00
44b29d114f
Bug 34068: Fix tests
Several wrong things in the previous attempt:
* as_list returns an array
* as_list returns objects, ->{library_id} does not exist
* as_list does not returns api object, you need to call ->branchcode to
  get the id
* $pickup_locations defined for both situations was confusing

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:21 +01:00
04c095c473
Bug 34068: Add tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:20 +01:00
37f85baed4
Bug 34068: Fix pagination for hold pickup locations
This patch addresses an issue where pagination filters are set incorrectly for the pickup locations endpoint. Only the final page is returned rather than the expected full list of results

Test plan:
1) In KTD, set the syspref RESTdefaultPageSize to 5
2) Set AllowHoldPolicyOverride to Allow
3) Create a hold on an item for a patron
4) Navigate to the patron's page and click on the holds tab
5) Click the dropdown in pickup locations
6) There will be two results, repeated three times
7) Apply patch and restart_all
8) Repeat step 5, there should now be a full list of 12 libraries

Co-authored-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:20 +01:00
Phil Ringnalda
3bd4a9fad6
Bug 38853: Make 'Cancel selected' on holds table work
Because 'Cancel selected' on the table of existing holds uses
$("#cancel_modal_form #inputs").empty; rather than empty();, it fails to
clear out whatever things are in there before it puts in the things it wants.
That leaves things in a confused state, and makes it fail to actually cancel
holds.

Test plan:
1. Without the patch, add a hold to any bib record
2. Select the checkbox for the hold you placed, then click 'Cancel selected'
   and confirm that you want to cancel
3. Note that there's no message box about a background job having been
   enqueued, and no matter how long you wait, the hold doesn't go away
4. Apply patch, repeat step 2, note that there's now a message box, and
   when the background job finishes, that the hold has been deleted.

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:19 +01:00
70ea004f02
Bug 38452: Use lc() for case insensitivity
To test:
1. Create an item give it a barcode like 'abc123';
2. Try creating a 2nd item with a barcode: 'ABC123', you get an error 'Error saving item: Barcode must be unique.'
3. Checkin the item 'ABC123', the 'abc123' item successfully checks in.
4. The case doesn't seem to matter elsewhere in Koha ( check-in, checkout, searching, batch tools )
5. Try the inventory tool and use 'ABC123'. The barcode is not found.
6. APPLY PATCH, restart_all
7. Try the inventory tool again with both 'abc123' and 'ABC123', they should now both work.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:19 +01:00
eecb123bd5
Bug 14907: Sort item search by cn_sort when sorting by callnumber
This patch simply intercepts a call to sort by callnumber and changes it to cn_sort

To test:
1 - Add three items:
    barcode TEST1 callnumnber D1015.B4 1965
    barcode TEST2 callnumnber D102.D3 1930
    barcode TEST3 callnumnber D101.2.A8 1951
2 - Go to item search
3 - barcode is 'TEST%'
4 - Sort the results by callnumber
5 - order is TEST3,TEST1,TEST2 (or reversed depending on sort direction)
6 - Apply patch, restart_all
7 - sort again
8 - order is TEST3,TEST2,TEST1 (or reversed depending on sort direction)

Signed-off-by: Gretchen Maxeiner <maxeinerGL@gcc.edu>
Signed-off-by: Heather Hernandez <flyingendpaper@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:18 +01:00
ef9c0f6872
Bug 14907: Unit tests
Signed-off-by: Gretchen Maxeiner <maxeinerGL@gcc.edu>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:18 +01:00
Leo Stoyanov
c500a8ac8c
Bug 37927: Fixed report name on page title not showing up when viewing SQL
To test:
1. Create a SQL report.
2. Go to /cgi-bin/koha/reports/guided_reports.pl?id=1&op=show.
3. Inspect element the page, go to the head, and find the title; it should have no report name or id.
4. Apply patch.
5. Redo steps 1-3 to see the fix.

Signed-off-by: Imani Thomas <imani.thomas@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:17 +01:00
6e59b40f55
Bug 38646: Update unit test for change
This drops the bracketed translation in the tests in
language_description where the bracketed language name matches the
preceeding one.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:17 +01:00
24379efb10
Bug 38646: (QA follow-up) Fix ONLY_FULL_GROUP_BY
We can use a plain AND in the WHERE clause here rather than requireing a
HAVING.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:16 +01:00
Michał Kula
26a6e476f1
Bug 38646: rewrite C4::Languages::getLanguages to use a single cachable SQL query
My profiling with NYTProf has found that the call to C4::Languages::getLanguages is unreasonably slow, taking over 100 ms (and that's just on a single call of it apparently!!!). Indeed, the way it's coded, it'd run over 540 SQL queries for no good reason, slowing the already slow catalog search page loading further down.

This patch is gonna replace the inefficient and complicated function logic with proper SQL statement that joins the relevant functions. It also fixes the bug where user's native language would be displayed with native language in the parenthesis as well, such as "Polski (Polski)" instead of just "Polski".

The whole query is pretty fast and it gets cached by MySQL server, meaning its runtime is measured in microseconds instead of hundreds of miliseconds, making it easily a 1000x+ improvement.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:16 +01:00
08bd56d1f7
Bug 38646: Improve unit test coverage
This patch adds proper coverage of getLanguages() to the existing test
file.

It should pass prior to applying the rest of the patchset of this bug

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:15 +01:00
210e0cb18b
Bug 38423: Add unit tests
Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:15 +01:00
af19a0f553
Bug 38423: Code more defensively in process_invoice
We re-arrange the logic of process_invoice a little here to ensure we
skip order lines in invoices that do not have corresponding bib records.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:14 +01:00
7fb78e4a5d
Bug 22415: (QA follow-up) Fix misc qa issues
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:14 +01:00
0f3511eaec
Bug 22415: Add new log config for EDI
This patch adds the Log4perl configurations required to match the
existing prior use of Log4perl in EDI code.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:13 +01:00
7f6c186831
Bug 22415: Update EDI to use Koha::Logger
This patch updates the EDI code to use the Koha::Logger wrapper in
preference to the bare Log::Log4perl module.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 19:19:13 +01:00
8c3a42aa02
Bug 38147: Fix Edit and Cancel translatability in booking table
It seems that "Edit" was not picked by the translator script because there was a TT tag
on the same line.

See comment 0 for a test plan.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:45 +01:00
de83983b98
Bug 38810: SIP account level system preference overrides not properly cleared between requests
Account level syspref overrides in SIP will "leak" between SIP requests.

Basically an account level system preference override will may be set by a given request, but those overrides will never be cleared for the life of that SIP process thus "contaminating" that process until it reaches end of life".

This is because the code
    # Clear overrides from previous message handling first
    foreach my $key ( keys %ENV ) {
        delete $ENV{$key} if index($key, 'OVERRIDE_SYSPREF_') > 0;
    }
is checking if the env key contains the substring OVERRIDE_SYSPREF_ at an index greater than 0. The problem is that for all overrides the subtring *starts at 0* since it's always the first part of the string. If the substring is not part of the string index will return -1. TLDR we have an "off by one" error. We need to check that the return value is zero instead of any positive value.

1) Set your SIP server params so that only one SIP process should run,
  <server-params
    min_servers='1'
    min_spare_servers='0'
    max_spare_servers='0'
    max_servers='0'
    custom_tcp_keepalive='0'
    custom_tcp_keepalive_time='7200'
    custom_tcp_keepalive_intvl='75'
  />
2) Set noissuescharge to $5
3) Create two SIP accounts
4) Set an account level override for noissuescharge to $500
5) Create a patron that owes $10 in fines
6) Run a patron information request on the "normal" SIP account for the
   patron, the patron flags should show the patron being not able to
   check out items
7) Run a patron information request of the "overridden" SIp account for
   the patron, the patron flags should show the patron being allowed to
   check out items
8) Run a second patron information request on the "normal" SIP account
   for the patron, the patron flags should show the patron being able to
   check out even though they should not be able to check out
9) Apply this patch
10) Restart all the things!
11) Repeast steps 6-8
12) The flags should be correct!

Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:45 +01:00
e32533ef22
Bug 38827: DataTables - Do not filter when inputs lose focus
On a table using DataTables and the REST API wrapper with the column
filters, if one input is used to filter the table the query will be made
twice: when the user stopped typing and when the input will lose the
focus.

Test plan:
Search for patron
Open the dev console, "Network" tab
In the "Card" column filter enter "0000"
Notice that the table is filtered and that a request has been made
Click outside of the "Card" input
=> Without this patch another request (the same) is made and the table
updated
=> With this patch applied no request is made when the input loses the
focus.

Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:44 +01:00
368d59c9a9
Bug 33268: DBRev 24.12.00.003
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:44 +01:00
cd04d58522
Bug 33268: (QA follow-up): tidy up code
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:43 +01:00
David Gustafsson
e2c0403440
Bug 33268: If rules exists add rules to preserve current behavior
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:43 +01:00
David Gustafsson
cb2d98fc5b
Bug 33268: Overlay rules don't work correctly when source is set to *
Fallback to overlay rules with wildcard filter if no match
found for exact filter match.

To test:
1. Administration => record overlay rules
2. Add this:
Module  Filter	                   Tag Preset  Added Appended Removed Deleted
Source  Z39.50 	                   245 Protect Skip  Skip     Skip    Skip
Source  * 	                   300 Protect Skip  Skip     Skip    Skip
Source  Batch record modification  245 Protect Skip  Skip     Skip    Skip
3. Add MARC modification templates:
Update existing or add new field 245$a with value CATSCATSCATSCATS
Update existing or add new field 300$a with value CATSCATSCATSCATS
4. Find a record that has those fields (likely any record would)
5. Use batch record modification on the record
6. 300$a should have been catified (expected, that's the bug)
7. 245$a is preserved
8. Change the value of the 300$a to something else.
   Temporarly disable MARCOverlayRules to be able to do so. And reenable
   it.
9. Apply the patch, restart services
10. Use batch record modification on the record
11. 300$a should be preserved, cat protection should have worked
12. Run tests: prove t/db_dependent/Biblio/MarcOverlayRules.t
13. Celebrate! :D

Sponsored-by: Gothenburg University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidied inline (tcohen)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:42 +01:00
David Gustafsson
3168da6e39
Bug 33268: Add tests for context module priority
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidied inline (tcohen)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:42 +01:00
David Gustafsson
03d6f83546
Bug 33268: Add tests
Sponsored-by: Gothenburg University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:41 +01:00
Emily Lamancusa
ee7a4aa4ee
Bug 38588: (follow-up) OK button needs to resubmit returns.pl
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:40 +01:00
Emily Lamancusa
4b94b6546d
Bug 38588: Don't generate a second transfer when printing transfer slip
When an item is checked in that should automatically return to its home
branch, AddReturn generates the appropriate transfer. In some cases, the
Print Slip button generates a second transfer, which now causes an
exception to be thrown.

In returns.pl, the op cud-dotransfer is used when a transfer was not
initiated previously and the librarian has confirmed they want to
initiate and send a transfer. The op cud-transfer is used when a
transfer has already been generated and the page needs to send or
cancel the transfer.

This patch updates the op from the modal to ensure that the correct of
the two options is generated according to whether a transfer was already
initiated or not.

To test:
1. Find or create an item that belongs to a branch other than the
   logged-in branch
2. In a new tab, check in the item - this should trigger a Return to
   Home transfer (keep the bib record tab open for later)
3. Click "Print Slip"
--> Internal server error - 'Active item transfer already exists'
4. Apply patch and restart_all
5. Check in item again and cancel the transfer
6. Check in item again to generate new transfer
7. Click "Print Slip"
--> Checkin page loads correctly
--> Refresh bib record and confirm item shows as in-transit
8. Enable syspref ShowAllCheckins
9. Repeat steps 5-7
--> Ensure item displays correctly in checkins table
--> Refresh bib record and confirm item still shows as in-transit
10. Repeat steps 5-7, except this time click "Yes" instead of "Print
    Slip"
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
10. Set syspref TransfersBlockCirc to Don't Block, and set
    AutomaticConfirmTransfer to Enable
11. Check in the item again and cancel the transfer
12. Check in the item to generate new transfer
13. Click away from the modal without selecting a response
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
14. Check out the item to a customer
15. Check the item in and click "Yes"
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
16. Repeat steps 14-15, clicking "Print Slip" instead of "Yes"
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
17. Repeat steps 14-15, clicking away from the modal without selecting a
    response
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-10 17:59:40 +01:00
93e5fdc744
Revert "Bug 36025: Selenium test for the query parameters"
This reverts commit 889455bccb.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-07 15:47:54 +01:00
7d2f41adee
Revert "Bug 36025: Incorrect clause in patron search"
This reverts commit 79085c4723.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-07 15:47:54 +01:00
e1a8dc875f
Revert "Bug 36025: Selenium test for the query parameters"
This reverts commit 395e2bd784.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-07 15:47:53 +01:00
885f33bdd6
Bug 38738: Only close select element if needed
Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c

Test plan, apply both patches:
1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box.
3) Notice the message 'This message should only show if a select input is present' only shows for select inputs, i.e. it's only closing the element when it needs to

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-07 15:47:53 +01:00
f1876c17b2
Bug 38546: Set tabWidth and useTabs in prettierrc
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-07 15:47:52 +01:00
723ed39c2a
Bug 38777: Use branch reply to for HOLD messages
When sending a notice of a hold ready for pickup (not digest) we use the library where the hold is at.

We should also use this when setting the reply to.

To test:
1 - Set the email/replyto for a patron's library to be:
    patron@example.com
2 - Set the email/replyto for another branch to be:
    holdbranch@example.com
3 - Place a hold for the patron for pickup at the other branch
4 - Check in and set hold waiting
5 - SELECT * FROM message_queue
6 - Note the message is from the hold branch, but has a null replyto
    This means we will use patron branch when sending
7 - Apply patch
8 - Revert hold waiting status
9 - Checkin and confirm hold again
10  -Check message queue
11 - Hold now has reply address of branch

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-07 15:47:52 +01:00
04dbbcc2f2
Bug 38826: Make check_api_auth $sessionID consistent
This change makes $sessionID consistently return using the session
ID and not sometimes the session object.

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' --cookie-jar /tmp/test.cookies
3. Note the Csrf-Token header value
4. Replace the <CSRF-TOKEN>, <USERID>, and <PASSWORD> tokens in the next step
using the appropriate values (eg the CSRF-TOKEN is from the previous step)
5. curl -v -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Csrf-Token: <CSRF-TOKEN>" -XPOST \
    'http://localhost:8081/cgi-bin/koha/svc/authentication' \
    -d "login_userid=<USERID>&login_password=<PASSWORD>" \
    --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies
6. curl -XGET -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \
    --cookie /tmp/test.cookies > rec.marcxml
7. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' \
    --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies
8. Note the Csrf-Token header value
9. curl -H "Content-Type: text/xml" -H "Csrf-Token: <CSRF-TOKEN>" \
    -XPOST -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \
    --cookie /tmp/test.cookies --data @rec.marcxml

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-07 15:47:51 +01:00
11500e7352
Bug 38724: Do not show the filters when updating col vis (if not needed)
(In reply to Brendan Lawlor from bug 38632 comment #7)
> During testing I noticed small related bug in current main. On the
> bibliographic record details page if you click to configure columns and you
> add or remove a column it automatically shows the column filters too, but it
> does not toggle the filter link to 'Hide filters` so you have to click twice
> to hide them.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-02 11:11:22 +01:00
2350a2ada8
Bug 37398: Fix test in basic_workflow.t
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-02 11:11:21 +01:00
3c1a4a2ffb
Bug 38684: Fix problem with koha-translate
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-02 11:11:21 +01:00
5d59ec0baa
Bug 38678: Fix wrong attribute mapping in Koha::Old::Biblio
Because the mapping was defined in the wrong direction, it is not
possible to filter results in `GET /deleted/biblios` neither on the
`deleted_on` attribute, or even the fallback to DB fields when mappings
don't exist, on `timestamp`.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/deleted_biblios.t
=> FAIL: A 200 returns a 500 instead
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass, behavior is correct
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:49 +01:00
51e42cde54
Bug 38678: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:48 +01:00
1938c510dd
Bug 38790: Add classes to item information on moredetail.pl
to test:
1 - Have a bib with multiple items
2 - view those items on the Items tab (moredetail.pl), confirm various parts of the page are not classed and are therefore hard to target with CSS, etc
3 - apply patch
4 - reload page, observe there are classes on things but the display and data have not changed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:48 +01:00
Andreas Jonsson
395e2bd784
Bug 36025: Selenium test for the query parameters
Fix selenium test:

1. Use classname of form instead of no longer existing id
2. Fix test count

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:47 +01:00
Andreas Jonsson
79085c4723
Bug 36025: Incorrect clause in patron search
This patch removes the search clause for
extended_attributes when there is no patron
attribute types which are searchable by default.

The clause was incorrectly added because the array
extended_attribute_types was rendered as [""] in
the template patron-search.inc most likely due to
a bug in DBIx::Class.

Test plan:

* Make sure that no borrower attribute type is set to "searched by default"
  in Koha administration -> Patron attribute types.
* Enable the network monitring in the developer tools in your web browser
  (Ctrl + Shift + E in firefox or Ctrl + Shift + I and select the "Network"
  tab).
* Go to the patrons view members-home.pl (click patrons in top menu bar).
* Search for a string that will match multiple borrowers (to not be automatically
  redirected)
* Examine the ajax-request and make sure that "extended_attributes.code" is NOT
  part of the query.
* Also, in koha-testing-docker with selenium enabled,
  run 'perl t/db_dependent/selenium/patrons_search.t'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:47 +01:00
Andreas Jonsson
889455bccb
Bug 36025: Selenium test for the query parameters
The test verifies that there is no clause for extended
attributes in the patron search query when no patron
attribute is searchable by default.

NC amended patch - tidied

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:46 +01:00
891b10311b
Bug 26211: (QA follow-up) Shorten error message
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-30 15:12:46 +01:00