Koha-clms/t/db_dependent/api/v1
Lisette Scheer 9be8db9c8a
Bug 41889: Update API to allow for null patron_id to be returned when listing checkouts
If a patron is deleted and there's a checkout associated with them, an api call to {url}/api/v1/checkouts?checked_in=true
will result in an error. This patch updates the api to allow for a null value to be returned for patron_id

To test:
Before applying the patch:

1. In Administration->System preference enable the RESTBasicAuth system preference.
2. Checkout an item to a patron (I used item barcode: 39999000000252 and patron barcode 23529000121682)
3. Check the item back in
4. In your brower go to {sandbox/ktdurl}/api/v1/checkouts?checked_in=1
5. Observe there is a patron ID in the JSON response
6. Delete the patron
7. Repeat step 4
8. Observe an error because a "null" value was returned
9. Apply patch
   Sandbox:
       In sandbox management Actions->Apply patches
       Once complete Actions->Build CSS and JS
       Actions->Restart services
   KTD:
       ktd --shell
       git bz apply 41889
       yarn build
       restart_all

10. Repeat step 4
11. Observe the checkout loads, but now has a null patron id.
12. Sign off
On KTD can also run the script: qa
to run tests.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-07-01 09:34:39 +00:00
..
iso18626 Bug 37762: (RM follow-up): Tidy t/db_dependent/api/v1/iso18626/request.t 2026-05-15 08:11:13 -06:00
items Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
public Bug 38365: Make swagger-cli happy 2026-03-16 11:57:37 +01:00
acquisitions_baskets.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
acquisitions_funds.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
acquisitions_orders.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
acquisitions_vendor_issues.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
acquisitions_vendors.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
action_logs.t Bug 29016: (QA follow-up) Expand action_logs API and test coverage 2026-05-05 13:42:09 -06:00
additional_contents.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
advanced_editor_macros.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
article_requests.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
auth.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
auth_authenticate_api_request.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
auth_basic.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
authorised_values.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
authorities.t Bug 41901: (follow-up) Fix perlcritic violation in unit tests 2026-04-29 09:09:13 -06:00
biblios.t Bug 38122: Add tests 2026-06-12 16:24:14 +00:00
bookings.t Bug 40134: (RM follow-up) Tidy commit 2026-02-10 08:51:04 -07:00
cash_registers.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
cashups.t Bug 41751: Allow anonymous_refund permission to access cashups API 2026-05-01 11:04:26 -06:00
checkouts.t Bug 41889: Update API to allow for null patron_id to be returned when listing checkouts 2026-07-01 09:34:39 +00:00
circulation_rules.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
cities.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
clubs_holds.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
config_search_mappings.t Bug 22639: Add GET /config/search_mappings endpoint 2026-04-15 11:37:17 -06:00
deleted_biblios.t Bug 17387: (follow-up) move records_restore under editcatalogue permission 2026-04-15 14:10:27 -06:00
deleted_items.t Bug 17387: (follow-up) move records_restore under editcatalogue permission 2026-04-15 14:10:27 -06:00
edifact_files.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_agreements.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_counter_files.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_counter_logs.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_counter_registries.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
erm_custom_reports.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_documents.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_eholdings_packages.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_eholdings_resources.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_eholdings_titles.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_licenses.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_sushi_services.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
erm_usage_data_providers.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_usage_titles.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
erm_users.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
extended_attribute_types.t Bug 39438: (RM follow-up): Fix failing test 2026-02-06 10:43:09 -07:00
file_transports.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
holds.t Bug 23269: (RM follow-up): Tidy 2026-03-21 20:28:15 +00:00
idp.t Bug 37711: API changes 2025-11-05 07:12:31 -07:00
ill_backends.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
ill_batches.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
ill_batchstatuses.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
ill_requests.t Bug 40105: Patrons cannot add notes when creating an ILL 2026-03-05 08:33:32 -07:00
ill_users.t Bug 40504: (QA follow-up) Tidy 2026-03-26 14:21:25 +01:00
import_batch_profiles.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
import_record_matches.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
item_groups.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
item_types.t Bug 38136: Refactor database translations (alternative) 2026-04-15 11:37:14 -06:00
items.t Bug 38136: Clear localization cache before testing itemtype localization 2026-04-17 09:17:58 -06:00
jobs.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
libraries.t Bug 42206: (follow-up) Rename to /closed_dates, improve efficiency 2026-05-01 11:04:25 -06:00
oauth.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
pagination.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
password_validation.t Bug 40286: (follow-up) Fix password_validation.t for find_by_identifier behavior 2026-03-23 08:01:09 +01:00
patron_categories.t Bug 26355: (QA follow-up) perl tidy to address qa tool errors 2026-05-01 09:30:03 -06:00
patrons.t Bug 36988: Update unit tests 2026-06-19 12:00:08 +00:00
patrons_accounts.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
patrons_checkouts.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
patrons_extended_attributes.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
patrons_hold_groups.t Bug 41849: Add tests 2026-04-10 09:48:05 -06:00
patrons_holds.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
patrons_password.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
patrons_password_expiration.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
patrons_recalls.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
patrons_self_renewal.t Bug 26355: (QA follow-up) perl tidy to address qa tool errors 2026-05-01 09:30:03 -06:00
preservation_Processings.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
preservation_Trains.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
preservation_WaitingList.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
provider.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
query.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
record_sources.t Bug 35380: Unit tests 2026-03-26 09:50:09 +01:00
responses.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
return_claims.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
search_filters.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
sip2_accounts.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
sip2_institutions.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
sip2_system_preference_overrides.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
smtp_servers.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
status.t Bug 41107: (QA follow-up) Tidy status.t 2026-03-23 09:33:54 +01:00
stockrotation_rotas.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
stockrotationstage.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
suggestions.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
sysprefs.t Bug 41994: Implement /sysprefs route to list system preferences 2026-04-15 11:37:05 -06:00
ticket_updates.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
tickets.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
transfer_limits.t Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
two_factor_auth.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
unhandled_exceptions.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00