Commit graph

7279 commits

Author SHA1 Message Date
cb9d59d1a5
Bug 35993: (follow-up) Fix MarcOverlayRules.t too
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 17:37:51 +02:00
31a66fcffe
Bug 35993: (follow-up) Fix Merge.t
The change for 005 makes some field compares fail. We should
exclude 005 in the local compare_fields sub.

We do NOT need the compare_fields from AuthoritiesMarc. Removing.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 17:37:51 +02:00
Mark Hofstetter
4bed77da08
Bug 31652: Add geo-search
This patch adds geosearch to Koha (using Elasticsearch 7). ElasticSearch
search_mappings get new types to store lat/lon, which can be indexed
from MARC 034$s and 034$t. There is a small change to the DB to allow a
new value in search_field.type ENUM.

The QueryBuilder is extended to allow for building advanced
ElasticSearch Querys (eg geo_distance) that cannot be represented in a
simple string query. The UI for searching (including showing the results
on a OSM/Leaflet map) is implemented in a separate plugin
(https://github.com/HKS3/HKS3GeoSearch)

Test Plan:

* make sure you're running ElasticSearch 7
  (eg via `curl http://es:9200?pretty | grep number`)
* apply patch
* got to a Framework, check Editor for 034$s and 034$t and save
* got to some books (in the correct framework) and enter some lat and lon into 034$s and 034$t (for example lat=48.216, lon=16.395)
* Run the elasticsearch indexer, maybe limited on the books you edited (-bn 123 -bn 456):
  misc/search_tools/rebuild_elasticsearch.pl -b -v
* You can check if the indexing worked by inspecting the document in elasticsearch:
  * get the biblionumber (eg 123)
  * curl http://es:9200/koha_kohadev_biblios/_doc/123?pretty | grep -A5 geolocation
  * You should get back a JSON fragment containing the lat/lon you stored
* You can query elasticsearch directly:
  * Run the following curl command, but adapt the value for lat/lng and/or the distance (in meters)
  * curl -X GET "http://es:9200/koha_kohadev_biblios/_search?pretty" -H 'Content-Type: application/json' -d '{"query": {"bool":{"must":{"match_all":{}},"filter":{"geo_distance":{"distance":100000,"geolocation":{"lat":48.2,"lon":16.4}}}}}}'
* To run the search via Koha, you need to either install and use https://github.com/HKS3/HKS3GeoSearch or create a handcrafted query string:
  * handcrafted query string:
    * /cgi-bin/koha/opac-search.pl?advsearch=1&idx=geolocation&q=lat:48.25+lng:18.35+distance:100km&do=Search
  * HKS3GeoSearch
    * install the plugin and enable it
    * got to OPAC / Advanced Search
    * There is a new input box "Geographic Search" where you can enter lat/long/radius
    * On the search result page a map is shown with pins for each found biblioitem

Sponsored-by: ZAMG - Zentralanstalt für Meterologie und Geodynamik, Austria - https://www.zamg.ac.at/
Sponsored-by: Geosphere - https://www.geosphere.at/
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Additional finetuning:

- Fix update and remove fixed fixme
- Update test count as well
- fix last small issues raised in Comment 23

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 15:19:34 +02:00
Björn Nylén
cb9854dd1e
Bug 32392: Tests for changes in C4::Serials::GetNextSeq
Signed-off-by: Marie Hedbom <marie.hedbom@musikverket.se>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 15:19:30 +02:00
d1443e7601
Bug 35993: Apply new routine to ModBiblioMarc
Now both AddBiblio and ModBiblio will insert 005 if not present.

Test plan:
Run t/db_dependent/Biblio.t
Add biblio record via acquistion order. Check 005 in the table
biblio_metadata.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:56 +02:00
b0712cbd36
Bug 35993: Add SimpleMarc::update_last_transaction_time
Note: This routine does not check field existence like
ModBiblioMarc does/did (see next patch). So it inserts
a field 005 if it is not present.

Test plan:
Run t/SimpleMARC.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:55 +02:00
d6011d6ae9
Bug 19097: Adjust some GetMarcFromKohaField calls
We need to:
[1] Remove obsolete framework parameters if any (yes there are).
[2] Check scalar context calls if any (most probably not).

Ad 1:
How to find them? Git grep and look at each hit. You will need the -C
parameter to add a few context lines around the call even.

Found one in C4/Biblio.pm and six in Suggestions.t with ''.
Found one in C4/Items on a second line. Similar one in Koha/EDI.
Note: sub receipt_items in EDI has no unit tests yet.

Also did a few git searches like:
git grep GetMarcFromKohaField | grep -v -P "GetMarcFromKohaField.*;"| grep -P "GetMarcFromKohaField\s*\("
Note: Seeing still three lines; they are all fine. Last line comes from
testing to trigger the warn.

Ad 2:
Have been looking at each git grep line and did not spot any
scalar context call. Before this report, we had an example in
POD and the Biblio test only.

Try to find them by performing smarter git searches?
Did look again at results for:
git grep GetMarcFromKohaField | grep -v -P "\)\s*=\s*&?(C4::Biblio::)?GetMarcFromKohaField" | grep -v -P "use "
The tests from this grep are included in the last test plan line.

Test plan:
Read the patch.
Run t/db_dependent/Biblio/TransformHtmlToMarc.t
Run t/db_dependent/Items.t
Run t/db_dependent/Suggestions.t
Run prove t/Biblio2.t t/db_dependent/Biblio.t t/db_dependent/Filter_MARC_ViewPolicy.t t/db_dependent/Koha/Authorities.t t/db_dependent/Koha/Biblio/Metadata.t t/db_dependent/Koha/Filter/EmbedItemsAvailability.t t/db_dependent/Koha/SearchEngine/Search.t t/db_dependent/XISBN.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:47 +02:00
7fc5e47251
Bug 19097: Remove wantarray from GetMarcFromKohaField
The routine should be called in list context now.
Warns also about use of obsoleted framework parameter. This
is the case for several years already btw. But may help us
catch a forgotten occurrence? Can be removed later.

In a follow-up we will check for second parameters and
we will update calls in scalar context.

Test plan:
Prove t/db_dependent/Biblio.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:46 +02:00
d24ec0e26d
Bug 19097: Remove wantarray from GetMarcSubfieldStructureFromKohaField
Replacing wantarray by always returning all mappings.
In a few cases only we expect multiple ones.
Changing two calls to pick the first hit, and add comment about
the implicit assumption being made (as before, no behavior change).

Test plan:
Look at results of git grep GetMarcSubfieldStructureFromKohaField
Run t/db_dependent/Biblio.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:46 +02:00
2b58f18f64
Bug 35646: (follow-up) Correct firstaquidate type
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:45 +02:00
db7c4f85b6
Bug 35646: Unit tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:45 +02:00
cca7ede28c
Bug 36605: Add update_lastseen to handle_patron_status for SIP
This patch extends the TrackLastPatronActivity trigger to cover SIP status messages as well.
Other SIP messages like Checkin/Checkout should be covered by those values in system preference, so
should not need adjustment.

To test:
prove -v t/db_dependent/SIP/Message.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:41 +02:00
1fe9180c41
Bug 34032: (QA follow-up) Tidy code
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:38 +02:00
Emmi Takkinen
db68d58592
Bug 34032: Use reserves.patron_expiration_date if set
If reserves.patron_expiration_date is set use it as holds
expiration date when waiting status is reverted.

To test:
1. Apply this patch.
2. Add hold for patron A and set expiration date manually.
3. Check in item on hold for patron A and confirm hold was
set as waiting.
4. Revert holds waiting status.
=> Hold should still have expiration date you set manually
in step 2.
5. Check that you have DefaultHoldExpirationdate and other
DefaultHold sysprefs set.
6. Add hold for patron B, but this time do not set expiration
date.
7. Check in item on hold for patron B, revert waiting status.
=> Hold should now have expiration date set based on
DefaultHold sysprefs.

Also prove t/db_dependent/Hold.t.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:38 +02:00
Emmi Takkinen
03efe5ba76
Bug 34032: Set new expirationdate if waiting status is reverted
When one reverts holds waiting status holds expiration
date is not set even if DefaultHoldExpirationdate
syspref is enabled. This patch adds new param
hold_reverted to be used when RevertWaitingStatus is
used to determine if expiration date should be set again.

To test:
1) Make sure you have DefaultHoldExpirationdate syspref enabled.
2) Find hold with status "Waiting".
3) Revert waiting status.
=> Note that hold has no expiration date set.
4) Apply this patch.
5) Repeat steps 2 and 3.
=> Expiration date should now be set based on reserve
date.

Also prove t/db_dependent/Hold.t.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:37 +02:00
b4e36c1bcd
Bug 30324: (follow-up) Remove stray comments
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 09:35:32 +02:00
afe8869d79
Bug 30324: Unit tests
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>
2024-04-29 09:35:31 +02:00
5786aa7530
Bug 31791: (follow-up) Fix Permissions.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2024-04-26 17:20:31 -03:00
3a3f1e7ee0
Bug 36495: Fix erm_counter_files.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2024-04-26 17:20:31 -03:00
5432a59032
Bug 36206: (follow-up) Fix Permissions.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2024-04-26 17:20:30 -03:00
Alex Arnaud
914afffd56
Bug 22613: Add GET endpoint /patrons/{patron_id}/checkouts
This patch adds a new endpoint, for fetching checkouts from a specific
patron.

Test plan:

1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/patrons_checkouts.t
=> SUCCESS: Tests pass!
3. Run:
   $ curl -v -s -u koha:koha --request GET \
        http://kohadev.local/api/v1/patrons/{id}/checkouts
test with query parameters (they are the same as for /patrons/{id}/holds
=> SUCCESS: The API works!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 20:15:49 +02:00
7e64e01515
Bug 31791: Add Koha::Biblio::Metadata->record_source
This patch adds a method for retrieving the related *Koha::RecordSource* from a *Koha::Biblio::Metadata* object.

The method is covered by tests:

1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Biblio/Metadata.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 20:15:38 +02:00
a054c569dd
Bug 31791: Add x-record-source-id header to POST /biblios
This patch adds support for setting the record source on the API. It
does so by adding support for a new header `x-record-source-id`.

Setting the record source is restricted to patrons with the
`set_record_sources` permission.

A 403 error is returned on an attempt to set it without the correct
permissions.

The feature is documented on the spec.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass! Tests cover the right use cases!
3. Play with Postman (or similar)
4. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 20:15:38 +02:00
cb8f95bce0
Bug 31791: Add 'source_record_id' param to {Add,Mod}Biblio(Marc)
Sponsored-by: ByWater Solutions
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 20:15:37 +02:00
e8595f9d62
Bug 31791: Add Koha::Biblio->can_be_edited
Sponsored-by: ByWater Solutions
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 20:15:34 +02:00
Andreas Jonsson
927c0680b9
Bug 35826: Add unit tests.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 18:06:18 +02:00
706246504c
Bug 36505: Unit tests
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 18:06:15 +02:00
cd3c5fcce9
Bug 36495: Use render_resource_not_found() helper everywhere
This patch makes the existing controllers use the new helpers for (most) 404 situations.
The remaining ones are subject to discussion.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 18:06:13 +02:00
fc7b6d9eb5
Bug 36495: Add render_resource_not_found() and render_resource_deleted() helpers
This patch introduces two helpers to be used in controllers.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/responses.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 18:06:13 +02:00
39879cd5cf
Bug 36482: Add embed tests
prove t/db_dependent/api/v1/libraries.t

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 18:06:12 +02:00
ee52b5c252
Bug 36481: Add GET /libraries/:library_id/cash_registers
This patch adds the mentioned route. For the task it:

* Adds Koha::Cash::Register->to_api_mapping with trivial mappings
* Adds a cash_register object definition on the API spec
* Adds a controller to handle requests
* Adds tests for the new endpoint

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ qa
=> SUCCESS: All green! Tests pass!
3. Play with Postman!
4. Sign off :-D

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>
2024-04-26 18:06:10 +02:00
afd83c134e
Bug 36480: Add GET /libraries/:library_id/desks
This patch adds the mentioned endpoint. For it, it does:

* Add Koha::Desk->to_api_mapping
* Add desk.yaml with the correct data structure for desks
* Add the route to the spec
* Add tests

Note: Lucas and I had doubts about the right return value for when the feature is disabled.
I opted for returning 404 with a message telling the feature is disabled. This can be discussed.

To test:
1. Apply this patches
2. Run:
   $ ktd
  k$ qa
=> SUCCESS: All green, all tests pass!
3. Play with this using Postman.
4. Sign off :-D

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>
2024-04-26 18:06:10 +02:00
7f7f486d94
Bug 36480: Add Koha::Library->desks
We add an accessor for the related desks. Tests are added.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Library.t
=> SUCCESS: Tests pass!
3. Sign off :-D

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>
2024-04-26 18:06:09 +02:00
7a32231a52
Bug 35353: Add REST API endpoint to retrieve old holds
Same as checkout but for holds, we need to provide a way to retrieve old
holds for a patron.

Test plan:
Create some holds for a patron, cancel and fulfill some, then use the
REST API endpoint with the new 'old' flag set to 1
  /api/v1/patrons/42/holds?old=1

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 18:06:09 +02:00
fbdd2fcba0
Bug 35919: Fix cypress tests
And remove "remove", "delete" inconsistency

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 17:06:06 +02:00
793dd17e29
Bug 35919: Add Koha::Biblio::Metadata->source_allows_editing
This patch adds a convenient method that tells if the record is
editable, according to it's record source.

To test:
1. Apply this patch
2. Run:
   $ ktd
  k$ prove t/db_dependent/Koha/Biblio/Metadata.t
=> SUCCESS: Tests pass! Use cases covered!
3. Sign off :-D

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Bug 31791: Rename can_be_edited -> source_allows_editing

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 17:06:05 +02:00
389debc4cd
Bug 35919: Add superlibrarian permission to Permissions.t
Permissions.t was failing when running a jenkins build to another branch with this bug applied. Permissions.t was missing the permission for record sources and is now added in this patch

Test plan:
1) prove t/Koha/Auth/Permissions.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 17:06:05 +02:00
af6b4e1a41
Bug 35919: Add cypress tests
This patch adds Cypress tests for the `record sources` CRUD as required
by QA.

I tried to cover all the UI interactions and behaviours.

To test:
1. Have all the patches applied
2. Run:
   $ ktd --shell
  k$ cypress run --spec t/cypress/integration/Admin/RecordSources_spec.ts
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 17:06:04 +02:00
07a12da11a
Bug 35919: Add /record_sources endpoints
This patch introduces endpoints for managing record sources. This is
done on top of Koha::RecordSource(s) following the current coding style.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/record_sources.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 17:06:03 +02:00
f8b5c5029a
Bug 16122: Tidy changed code blocks
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 14:15:02 +02:00
1123d26d09
Bug 16122: Add unit test
To test:
1. Apply patch, updatedatabase & schema, restart all Services
2. Go to Administration > Table setting. Find the holdings table ( Catalog > holdings_table ) and turn the local use column on.
3. Go to an item record and notice the column 'Local uses'
4. Turn the system preference RecordLocalUseOnReturn Off.
5. Check in an item that is not checkout out. No local use should be recorded for the item.
6. Turn RecordLocalUseOnReturn on and check in an item that is not checked out. Local use on that item should increment by 1.
7. Create a statistical patron and check an item out to them. Local use should increment by 1.
8. Go to /api/v1/items?external_id={barcode} and make sure the numbers for localuse look correct.

To test maintainence script:
1. Without the patch, have RecordLocalUseOnReturn on.
2. Check in some items to record localuse in the stats table. Keep note of those stats.
3. Apply the patches, updatedatabase.
4. Run the maintenance script, perl update_localuse_from_statistics.pl
5. Now check that items.localuse is congruent with what is in the stats table

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 14:15:01 +02:00
David Gustafsson
f44e4a72a3
Bug 36160: Use $builder->build_object for patron objects in Circulation.t
1) Set TrackLastPatronActivityTriggers to at least "Checking out an item"
2) Run tests in t/db_dependent/Circulation.t and verify that
   failes with "Invalid value passed, borrowers.updated_on..."
3) Apply patch
4) Run Circulatoint.t tests again and verify that no longer
   produces this error

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 14:14:49 +02:00
ad463f99fd
Bug 27893: (follow-up) Check orderstatus in orders->cancel
Removed the results[0] test too in addbiblio, since there
can be warnings without effectively cancelled order lines.
Also reworded the warn (cancelled, not deleted).

Test plan:
Run t/db_dependent/Koha/Acquisition/Orders.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 14:14:49 +02:00
362cfb3c47
Bug 36535: (QA follow-up) Use dt_from_string
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 14:14:48 +02:00
f205cc59ea
Bug 36535: (bug 33568 follow-up) Add missing tests
Bug 33568 introduced a lot of new simple accessors without providing unit tests for them.

Test plan:
All tests modified by this patch should pass

Note that one bug was found! Logic issue in lost/not lost

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>
2024-04-26 14:14:48 +02:00
f08bb43222
Bug 35362: (follow-up) Fix guaruntor preview modal close in test
This patch updates the selenium test to correct the selector used to
close the preview modal as it changed with this patchset.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 14:14:47 +02:00
c317bb34c0
Bug 35979: (follow-up) Add check in ->enqueue
Foundation for removing same check elsewhere (later on).

Test plan:
Run t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

PA amended: Fix bug # in commit message

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 08:52:54 +02:00
92a4c99e24
Bug 30645: Add tests
to highlight the problem

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>
2024-04-26 08:52:48 +02:00
b42574afdc
Bug 30645: Add REST/Plugin/Query tests
prove t/Koha/REST/Plugin/Query.t

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>
2024-04-26 08:52:47 +02:00
07682a5a67
Bug 35568: (RM follow-up) Use warnings_exist over warning_like
We introduced additional warnings triggered by prepared letter and those
caused the test of the recall hook to fail.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-04-24 10:20:38 +01:00