]> git.koha-community.org Git - koha.git/log
koha.git
5 months agoBug 32565: (follow-up) Tidy
Nick Clemens [Fri, 19 Apr 2024 11:25:58 +0000 (11:25 +0000)]
Bug 32565: (follow-up) Tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4da2e1444be2f80f9a9a87a73af55bec1fe52f98)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 32565: (QA follow-up) Fix tests
Pedro Amorim [Mon, 19 Feb 2024 10:45:50 +0000 (10:45 +0000)]
Bug 32565: (QA follow-up) Fix tests

Apply original tests patch + this follow-up. Run:
prove t/db_dependent/HoldsQueue.t
Notice tests fail.
Apply fix patch, run the above prove command again.
Notice tests pass.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c3eac3c8898759291011e9d5a3f2d25cd1112c1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 32565: Unit tests
Nick Clemens [Thu, 25 Jan 2024 12:31:46 +0000 (12:31 +0000)]
Bug 32565: Unit tests

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 379481541f63cbdbadc3884052ef1d6b82be99e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 32565: Add unallocated option to holds queue
Nick Clemens [Thu, 2 Mar 2023 17:01:07 +0000 (17:01 +0000)]
Bug 32565: Add unallocated option to holds queue

Add an unallocated option to CreateQueue and pass through as needed
Avoid deletion of the tmp_holdsqueue, and only check holds
and items that are not currently matched

A future hold with a higher priority will still fail here - because the
item may already be assigned, but on next change to the biblio it would
be corrected

To test:
1) Apply both patches
2) Enable RealTimeHoldsQueue and set HoldsQueueSkipClosed to "open"
3) Add a holiday to the calendar for all libraries for today, visit:
/cgi-bin/koha/tools/holidays.pl
-- Click today's day on the calendar and pick "Holiday repeated every same day of the week"
-- Click "Copy to all libraries". Hit "Save.
4) Place a biblio-level hold on a biblio record and set the pickup location to a library that has available copies, visit:
-- /cgi-bin/koha/reserve/request.pl?biblionumber=76&borrowernumber=51
-- Click the first "Place hold" button to place the biblio-level hold.
5) Verify that that hold got added to the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
6) Place a biblio-level hold on a biblio record where there are no other holds and copies are available at another location, but not the pickup location, visit:
-- /cgi-bin/koha/reserve/request.pl?biblionumber=437&borrowernumber=51
-- On the "pickup at" dropdown, pick something else other than "Centerville", e.g. "Fairfield".
-- Click the first "Place hold" button to place the biblio-level hold.
7) Check the holds queue again, notice that this 2nd hold was not added to the queue:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
8) Run the updated cronscript:
perl misc/cronjobs/holds/build_holds_queue.pl --force --unallocated
9) Notice nothing changed in the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
10) Remove the holiday we created previously, visit:
/cgi-bin/koha/tools/holidays.pl
-- Click today's day on the calendar and pick "Delete this holiday"
-- Click "Copy to all libraries". Hit "Save.
11) Run the updated cronscript:
perl misc/cronjobs/holds/build_holds_queue.pl --force --unallocated
12) Confirm the second hold is added to the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 939f1f389b848e06b7adcd7121ff7629a0ba4adf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 31345: Add ability to exit process_message_queue.pl early if any plugin before_se...
Kyle M Hall [Thu, 11 Aug 2022 19:43:15 +0000 (15:43 -0400)]
Bug 31345: Add ability to exit process_message_queue.pl early if any plugin before_send_messages hook fails

Sometimes it would be better for process_message_queue.pl to stop if a plugin hook fails rather than continue processing. It would be nice if that was a command line option.

Test Plan:
1) Install any plugin with a before_send_messages hook
2) Modify the plugin, add a 'die;' statement at the start of the
   before_send_messages method of the plugin.
3) Run process_message_queue.pl as usual
4) Note the exit code is 0
5) Run it again with the new -e setting
6) Note the exit code is 1

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>
(cherry picked from commit 83f9535fabc37be46ab8154d940a7ff614617eb2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35582: Supress possible warning
Kyle M Hall [Fri, 26 Apr 2024 18:41:42 +0000 (14:41 -0400)]
Bug 35582: Supress possible warning

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 615c7c5eafd207fdb1adc9a07a063ce83da668c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35582: Show advanced search languages with selected intranet language description...
lmstrand [Fri, 26 Jan 2024 08:36:00 +0000 (10:36 +0200)]
Bug 35582: Show advanced search languages with selected intranet language descriptions first

To test:

1. Check language dropdowns in advanced search, notice localized
   names of the languages are shown first in the menus, then the
selected ui language translations if available or the english translation
2. Apply patch
3. Check language dropdowns, notice the selected ui language's
   translations are shown first for the languages (if missing, english
translation), then the localized
language's name.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9c445218deb8daa8704ae48433783e723d8e8649)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: (follow-up) Fix specification file
Martin Renvoize [Tue, 30 Apr 2024 06:31:15 +0000 (07:31 +0100)]
Bug 26297: (follow-up) Fix specification file

We had a duplicate 'description' key introduced in the patron category
specification file here which causes errors on bundling the specs.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c120975b7839f8d4b35f9ecb14f6b70ded66509a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: (QA follow-up): Update tests
Pedro Amorim [Wed, 24 Apr 2024 11:01:08 +0000 (11:01 +0000)]
Bug 26297: (QA follow-up): Update tests

prove t/db_dependent/api/v1/patron_categories.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 593c3673f276fe18446131a62c95b85727bb7e46)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: (QA follow-up) Spec fixes
Tomas Cohen Arazi [Tue, 23 Apr 2024 13:04:06 +0000 (10:04 -0300)]
Bug 26297: (QA follow-up) Spec fixes

This patch fixes some spec misses. To test:

1. Run:
   $ ktd --shell
  k$ prove xt/api.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 456f47cad4060dcd0b003a9ac3d1b67aa378866c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: Add tests
Pedro Amorim [Tue, 12 Dec 2023 10:57:50 +0000 (10:57 +0000)]
Bug 26297: Add tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a43303b88bea5d7fbd0229df1870b9e4f15e6f47)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: API specs
Pedro Amorim [Mon, 11 Dec 2023 17:30:37 +0000 (17:30 +0000)]
Bug 26297: API specs

Test plan, k-t-d:
1) Access /api/v1/patron_categories
2) Verify the patron categories are correctly listed

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Bug 26297: (QA follow-up) Move to REST::V1::Patrons::Categories

Bug 26297: (QA follow-up) Use search_with_library_limits

JD amended-patch: squashed + tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0e593e59e2a39819e5384f03445a138aa79a7f34)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 26297: Add patron categories to_api_mapping
Pedro Amorim [Mon, 11 Dec 2023 17:31:09 +0000 (17:31 +0000)]
Bug 26297: Add patron categories to_api_mapping

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5b205969a91d325378945cad4e2730152f2417a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30598: remove all the console.log redundancies
Phan Tung Bui [Thu, 18 Apr 2024 13:49:59 +0000 (09:49 -0400)]
Bug 30598: remove all the console.log redundancies

Please test the patch. Thank you!

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e0d38c77e6c9fff2d7c39cf523c1517b322ca9c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30598: Replacement cost is not copied from retail price when ordering from file
Phan Tung Bui [Fri, 12 Apr 2024 20:53:24 +0000 (16:53 -0400)]
Bug 30598: Replacement cost is not copied from retail price when ordering from file

Test plan :
To test :
1- In Acquisitions, create a basket
2- Add an order from a new (empty) record
 --> Note that when you enter the "vendor price", it is copied in the "replacement cost" field
3- Add an order from a new file
 --> Note that when you enter the "price", the "replacement price" field stays empty
4- Apply the batch
5- Redo step 3 and notice that when you change the 'price', the
'replacement price' syncs with it

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bed0563e568c4ee13a851d22025d66f36651beec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35903: In cataloguing authority plugin using autocomplete must set operator exact
Fridolin Somers [Thu, 25 Jan 2024 08:50:28 +0000 (09:50 +0100)]
Bug 35903: In cataloguing authority plugin using autocomplete must set operator exact

When cataloguing and using authority plugin, there is auto-completion on inputs and default operator is "contains".
When using auto-completion and selecting a result it would be logical to set operator "exact".

See doc https://api.jqueryui.com/autocomplete/#event-select

This patch also adds auto-completion missing on "Search all headings".

Test plan:
1) Create a new authority Topical Term with heading "Cart"
2) Create a new authority Topical Term with heading "Carthage"
3) Create a new biblio record
4) Use authority plugin on field 650
5) You see current operator are "contains"
6) Enter "Car" in "Search main heading ($a only):"
7) You see auto-completion showing "Cart" and "Carthage"
8) Click on "Cart"
9) You see operator changes to "is exactly"
10) Submit form to see the results
11) Clear form and repeat 6-9 for the three other inputs

Signed-off-by: Michelle Spinney <mspinney@clamsnet.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 36d96180aea6e71d24da116343cd37bd723e808f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36605: Add update_lastseen to handle_patron_status for SIP
Nick Clemens [Tue, 16 Apr 2024 03:50:21 +0000 (03:50 +0000)]
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>
(cherry picked from commit cca7ede28ccd37a56f88b4953aed54304b88833d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35689: Add id and classes to each MARC note in OPAC bibliographic details
Owen Leonard [Wed, 3 Jan 2024 16:01:56 +0000 (16:01 +0000)]
Bug 35689: Add id and classes to each MARC note in OPAC bibliographic details

Building on Bug 14156, this patch updates the OPAC bibliographic
detail page's display of MARC notes to add the tag number in both a
class (for consistent styling across the same tag number) and id (for
unique styling for each repeated tag).

To test:

- As a quick test for custom CSS, go to Administration -> System
  preferences and locate the OPACUserCSS preference.
  - Add this testing CSS:

   .marcnote { font-size:140%; font-family: serif; }
   .marcnote-500 { background-color: #66FFCC; }
   .marcnote-511 { background-color: #99FFFF; }
   .marcnote-520 { background-color: #CCFF00; }
   .marcnote-521 { background-color: #CCFFFF; }
   .marcnote-538 { background-color: #FFCCCC; }
   .marcnote-546 { background-color: #FFFFCC; }

- Locate a record with multiple notes fields. In the sample data, record
  46, "Viridiana" is a good example which works well with the above CSS.
- On the bibliographic detail page for the record, click the
  "Descriptions" tab.
  - Each MARC note should be colored according to the tag it comes from.
  - Inspect the HTML to confirm that each paragraph also has its own
    unique ID.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dfd4894acbab3af5355b72c859a0a17deef70af5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35996: Make it clear that --category-code can not be used alone
Matt Blenkinsop [Mon, 5 Feb 2024 16:50:32 +0000 (16:50 +0000)]
Bug 35996: Make it clear that --category-code can not be used alone

This patch adds a clarification to writeoff_debts.pl to make it clear that --category-code can't be used as the only filter when running the script. If this is the case, the script just displays the help menu as it is expecting one of the other filters

Test plan:
1) Run perl misc/cronjobs/writeoff_debts.pl --category-code TEST --confirm
2) Observe that the help menu is displayed instead of running the script
3) Check the help menu for the text added in this patch

WNC amended patch - added same warning in the option section

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 875809d66d4e6bde5385d88aad9f05f472a67b6b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30324: (follow-up) Remove stray comments
Nick Clemens [Fri, 26 Apr 2024 16:04:35 +0000 (16:04 +0000)]
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>
(cherry picked from commit b4e36c1bcd26a1f8b3187de3f8e160e8b5c78844)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30324: Don't use default rule if we have a parent rule
Nick Clemens [Thu, 11 Jan 2024 16:21:48 +0000 (16:21 +0000)]
Bug 30324: Don't use default rule if we have a parent rule

Currenty, if we find only a defult rule for a checkout we are ignoring the parent rule.
We should not use the default if there is a parent rule

To test:
 1: have an itype BK
 2: create an itype BK2, set BK as the parent to BK2
 3: create a circ rule for All Patrons, item type BK (displays as "Books (All)" in the circ rules interface), setting total checkouts to 1
 4: do not create any rule specifically for the BK2 itype
 5: have some BK items and some BK2 items
 6: check a BK item out to a patron
 7: check a BK2 item out to the same patron, observe you are not blocked from doing so
 8: try to check out a second BK2 item to the same patron, get message "Too many checked out. 1 checked out, only 1 are allowed."
 9: try to check out a second BK item to the same patrons, get message "Too many checked out. 2 checked out, only 1 are allowed."
10: return both items
11: check a BK2 item out to your patron
12: try to check a BK item out to your patron, get message "Too many checked out. 1 checked out, only 1 are allowed."
13: Apply patch
14: Repeat 7, you are now blocked
15: Other results should be the same

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Michael Adamyk <madamyk@ckls.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d7afd1ca30231dfc5752ddeece123b8471d8b4a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30324: Unit tests
Nick Clemens [Thu, 11 Jan 2024 14:50:35 +0000 (14:50 +0000)]
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>
(cherry picked from commit afe8869d792c3e44fb38b85577b3fa21f7bf32c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 22613: Add GET endpoint /patrons/{patron_id}/checkouts
Alex Arnaud [Wed, 10 Apr 2024 12:03:14 +0000 (14:03 +0200)]
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>
(cherry picked from commit 914afffd56b861727aff1309abc54b2950bdca0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36482: Add embed tests
Pedro Amorim [Thu, 4 Apr 2024 11:14:11 +0000 (11:14 +0000)]
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>
(cherry picked from commit 39879cd5cf1d46ee57e5ab22e1770c9d5c98b6ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36482: Make embedding work for GET /libraries/:library_id
Tomas Cohen Arazi [Mon, 1 Apr 2024 21:08:46 +0000 (18:08 -0300)]
Bug 36482: Make embedding work for GET /libraries/:library_id

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 8cd64b5dd689175a68a8a4b7f6f843cad2d271f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36482: Allow embedding desks and cash_registers on libraries endpoints
Tomas Cohen Arazi [Mon, 1 Apr 2024 21:08:13 +0000 (18:08 -0300)]
Bug 36482: Allow embedding desks and cash_registers on libraries endpoints

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 588ef525f3283fc49661597775b7dbfea1b08753)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36481: (QA follow-up) Rename branch_default to library_default
Martin Renvoize [Wed, 1 May 2024 12:48:35 +0000 (13:48 +0100)]
Bug 36481: (QA follow-up) Rename branch_default to library_default

Use agreed terminology

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 67abe6410631af52184c75b08742c6c197ef853b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36481: Add GET /libraries/:library_id/cash_registers
Tomas Cohen Arazi [Mon, 1 Apr 2024 20:52:46 +0000 (20:52 +0000)]
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>
(cherry picked from commit ee52b5c252c4fc5defadc28922c422ffd85b1877)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36480: Add GET /libraries/:library_id/desks
Tomas Cohen Arazi [Mon, 1 Apr 2024 20:24:35 +0000 (20:24 +0000)]
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>
(cherry picked from commit afd83c134e2ef4759d0512f713d4f4911f0190f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36480: Add Koha::Library->desks
Tomas Cohen Arazi [Mon, 1 Apr 2024 20:22:22 +0000 (20:22 +0000)]
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>
(cherry picked from commit 7f7f486d94e52eb50d070ccead61c94928aeff28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35353: Add REST API endpoint to retrieve old holds
Jonathan Druart [Mon, 25 Mar 2024 15:42:18 +0000 (16:42 +0100)]
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>
(cherry picked from commit 7a32231a52d9d1d5007ad574b8e3b48fd4c99878)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35353: DBIC specific
Jonathan Druart [Wed, 20 Dec 2023 10:23:52 +0000 (11:23 +0100)]
Bug 35353: DBIC specific

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>
(cherry picked from commit 6fb82fd6e32d0f38f24463c31adf546efe153bc3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35558: Do not retrieve the local image if none exists - OPAC
Jonathan Druart [Thu, 14 Mar 2024 14:01:39 +0000 (15:01 +0100)]
Bug 35558: Do not retrieve the local image if none exists - OPAC

Test plan:
 1 - Enable system preferences:
     LocalCoverImages
     OPACLocalCoverImages
 2 - open browser tools network page
 3 - Perform an intranet search
 4 - Note a request for each bib like:
    http://localhost:8081/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=35
 5 - Repeat on opac, same requests
 6 - Apply patches
 7 - Restart all
 8 - Repeat searches, note no fetches
 9 - Add local cover images to several biblios in the results
10 - Repeat searches
11 - Note the fetches are only for those records with images
12 - Confirm images still load correctly

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 747c9b573b828ee6d38f5085ac6bdbb82f0e3305)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35558: Do not retrieve the local image if none exists
Jonathan Druart [Wed, 13 Dec 2023 10:10:24 +0000 (11:10 +0100)]
Bug 35558: Do not retrieve the local image if none exists

On the search results we are fetching the thumbnails of the local cover
images using catalogue/image.pl
Which means 1 GET per results on the page.

This patch suggests to have this information beforehand in order to
reduce the number of hits and network traffic?

However the page load will be slightly slower ofc.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8cde45e0723a4b34bdf26c7ef4cfd2d8e767c837)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36295: Space out content blocks in batch record modification
Brendan Lawlor [Fri, 12 Apr 2024 16:40:41 +0000 (16:40 +0000)]
Bug 36295: Space out content blocks in batch record modification

This patch adds a float clearing class to a line break in the batch record modification template to fix a spacing issue in Chrome.

To test apply the patch and go to Cataloging -> Batch record modification

There should be space between the two sections.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 566894f058759c05922ec3399ba4ca96d27978f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36295: Space out content blocks in batch record deletion
Owen Leonard [Tue, 9 Apr 2024 12:02:40 +0000 (12:02 +0000)]
Bug 36295: Space out content blocks in batch record deletion

This patch adds a float-clearing line break to the batch record deletion
template so that the "Record type" section has visual separation from
the record number submission tabs.

To test, apply the patch and go to Cataloging -> Batch record deletion.

There should be padding between the two sections.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 55fbfffa0efe2efc09baa3a5e4d01595152165e7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35977: (follow-up) Cleaner working approach
Martin Renvoize [Tue, 30 Apr 2024 15:13:25 +0000 (16:13 +0100)]
Bug 35977: (follow-up) Cleaner working approach

This patch removes the Date_from_syspref recently added and replaces it
with the correct parseDate call as per bug 35559. We also clean up the
code around setting the input value in the first place and use iso which
is what the rest of flatpickr expects and now is handled correctly in
futuredate pickers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1ff3d65c7073e5d93502d329b917d886a3665e0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35977: Nuke value if setting required
Martin Renvoize [Thu, 25 Apr 2024 12:39:40 +0000 (13:39 +0100)]
Bug 35977: Nuke value if setting required

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 47400c327394a449b6bcb0998eba0e7840a9e6d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35977: Set holddatefrom default to today
Martin Renvoize [Wed, 7 Feb 2024 15:21:04 +0000 (15:21 +0000)]
Bug 35977: Set holddatefrom default to today

This patch sets the holddatefrom date to today by default on the opac.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c341b2d37584aca52fcac7243f7ab68f324d002c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 16567: Correct RSS feed validity errors
Owen Leonard [Mon, 15 Apr 2024 14:21:03 +0000 (14:21 +0000)]
Bug 16567: Correct RSS feed validity errors

This patch corrects a few markup errors in the XML feeds to make the
feeds validate correctly. The template has been largely re-indented to
improve readability and eliminate tab characters.

To test, apply the patch and perform a search in the OPAC.

- Open the RSS link appearing after the "Your search returned..."
  header.
- Depending on how your browser handles XML documents you may need to
  view source on the page to see the actual XML markup.
- Copy the source and paste it into the W3C feed validator:
  https://validator.w3.org/feed/#validate_by_input
- The feed should be found to be valid.
  - In my tests you'll get a "Recommendation" about "Self reference
    doesn't match document location." I think this recommendation
    doesn't apply.

Perform the same test with the other two available formats: Atom and
OpenSearch:

- Change the end of the RSS feed url from '&format=rss' to
  '&format=atom' and validate the result.
   - The same "self reference" recommendation will come up, and again I
     think we can ignore it.
   - There is another recommendation about "Two entries with the same
     value for atom:updated." The updated time is set to the same time
     as the feed itself (the time when the feed was generated. Maybe
     this is incorrect. If so we need a follow-up that exposes a
     different value to the template. biblio.datecreated maybe?
- Change the end of the feed url from '&format=atom' to
  '&format=OpenSearchDescription' and validate that result.

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>
(cherry picked from commit ee960bd45f7535aec058d3984891e21b255ace12)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36160: Use $builder->build_object for patron objects in Circulation.t
David Gustafsson [Fri, 23 Feb 2024 18:41:26 +0000 (19:41 +0100)]
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>
(cherry picked from commit f44e4a72a3bb14fd1cefb7ef94cb700700521eb8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35979: (follow-up) Add check in ->enqueue
Marcel de Rooy [Tue, 23 Apr 2024 12:47:11 +0000 (12:47 +0000)]
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>
(cherry picked from commit c317bb34c0bb59fd0f52b4e7c5c0d3326b0030ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35979: Check pref before inserting holds_queue background jobs
Marcel de Rooy [Tue, 23 Apr 2024 11:42:50 +0000 (13:42 +0200)]
Bug 35979: Check pref before inserting holds_queue background jobs

Test plan:
Confirm that modrequest does no longer insert when pref is off :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 310ba95efa7e83559134c7660f7739a6d1314524)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36649: Correctly embed biblio when retrieving items when adding to a train
Jonathan Druart [Mon, 22 Apr 2024 12:33:33 +0000 (14:33 +0200)]
Bug 36649: Correctly embed biblio when retrieving items when adding to a train

I didn't find when this regression has been introduced but the third
parameter here is the headers, not parameters, we should not repeat
"headers".

Test plan:
1. Add a new processing that contains columns from the database, for example biblio.title and biblio.author.
2. Create a new train.
3. Add items to the waiting list.
4. Click on "Add last x items to the train" button.
5. Choose the train you created on number 2.
6. Choose the processing you added on number 1.
7. Try to click the Submit button.
=> Without the patch nothing happens and there is a JS error in the
console: Uncaught TypeError: item.biblio is undefined
=> With this patch applied the item is correctly added to the train and
the attribute is properly populated.

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 63612311e32a546a6ea1067e0c65ac3199f2f292)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 32695: Fix search strings for 775, 780, 785 and 787
Nick Clemens [Fri, 26 May 2023 19:00:13 +0000 (19:00 +0000)]
Bug 32695: Fix search strings for 775, 780, 785 and 787

In the past due to some misunderstanding of the MARC standard
we built the search links for these fields using $a and $t with
the title index. But we actually need to search $t as title
and $a as author.
This patch fixes the templates for the MARC 7xx fields:
* 775
* 780
* 785
* 787

To test:
* Ensure systme preference 'UseControlNumber' is set to don't
* Create a record with the linking fields above
* Look at the OPAC and staff interface detail views
* Verify the content of your fields shows and the links combine a+t as a title search
* Apply patch
* Verify you have nicely formatted links now

Example:
775 _ _ ‡asomeone‡ttitle775
780 0 2 ‡asomeone‡ttitle780
785 0 2 ‡asomeone‡ttitle785
787 _ _ ‡ilabel:‡ttitle787‡asomeone

Signed-off-by: Sabrina Kiehl <kiehl@mpis.mpg.de>
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>
(cherry picked from commit b2b3d88b7335c542035fbdf11637fa2a31ea22bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36652: Pass copy_form template variable
Lucas Gass [Fri, 19 Apr 2024 17:22:15 +0000 (17:22 +0000)]
Bug 36652: Pass copy_form template variable

To test:

1. Go to Tools > Notices and slips
2. Pick any notice and try to copy it to another library using the 'Copy notice' column.
3. You are redirected to a blank screen and if you go back to the Notices and slips page the notice has not been copied.
4. APPLY PATCH
5. Try steps 1 - 3 again, but this time you should be correctly directed.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0e7d2c3db4727c629ab76e01a3f42d6810c89916)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30318: Don't reset messaging preferences when form is empty
Nick Clemens [Fri, 19 Apr 2024 12:29:31 +0000 (12:29 +0000)]
Bug 30318: Don't reset messaging preferences when form is empty

In testing, the messaging preferences are set in the form when EnhancedMessagingPreferences is enabled.
Switching categories silently updates the preferences unless you have made changes, in which case the
user is warned and can confirm if they want to reset or not. The code only applies to patron creatoin, and
does not seem to be taken into account during OPAC self-registration.

It seems the silent defaulting when saving can be removed in favor of the current updates/warns in the actual
form.

To test:
 1 - Set some messaging preferences for at least two categories
 2 - Enter a new patron
 3 - Confirm switching categories correctly defaults the messaging preferences
 4 - Edit the preferences and switch to another category with defaults
 5 - Confirm the warning appears, and preferences are set if confirmed and ignored if not
 6 - Set to a category with defaults, uncheck all, and save
 7 - Ooof, patron is defaulted
 8 - Apply patch
 9 - Repeat 1-5 and confirm nothing has changed
10 - Set to a category with defaults, uncheck all, save
11 - Confirm patron is saved with no preferences

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>
(cherry picked from commit 70fde44d4f6eef25e177012318e7acaa0ce740c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36282: Chomp whitespace around opac i18n strings
Pedro Amorim [Fri, 8 Mar 2024 11:49:26 +0000 (11:49 +0000)]
Bug 36282: Chomp whitespace around opac i18n strings

Same logic as bug 26816 but to OPAC

Test plan:
1) Apply test plan patch only
2) Visit opac home:
<opac_url>/cgi-bin/koha/opac-main.pl
3) Notice there's a space between 'Translated string' and ':', even though the markup does not contain a whitespace
4) Apply 2nd patch
5) Notice the white space is gone

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>
(cherry picked from commit b9f97ec015e4f101546e308754db4ed532987fde)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35345: Add --where option to rebuild_elasticsearch.pl
Thomas Klausner [Fri, 29 Mar 2024 09:20:37 +0000 (09:20 +0000)]
Bug 35345: Add --where option to rebuild_elasticsearch.pl

Sometimes we need to only re-index a subset of our bibliographic data or authorities. Currently this is only possible by enumerating all id (-bn or -ai), which does not work well when indexing eg 100.000 items of a 2.000.000 DB. Re-indexing everything is also overkill.

This patch adds an `--where` flag to misc/search_tools/rebuild_elasticsearch.pl which can take arbitrary SQL (that of course has to match the respective tables) and adds it as an additional param to the resultset to index

To test, start koha-testing-docker with ElasticSearch enabled, for example via `ktd --es7 up

Before applying the patch, rebuild_elasticsearch will index all data:

Biblios:
$ misc/search_tools/rebuild_elasticsearch.pl -b -v
[12387] Checking state of biblios index
[12387] Indexing biblios
[12387] Committing final records...
[12387] Total 435 records indexed
(there might be a waring regarding a broken biblio, which can be ignored)

Auth:
$ misc/search_tools/rebuild_elasticsearch.pl -a -v
[12546] Checking state of authorities index
[12546] Indexing authorities
[12546] 1000 records processed
[12546] Committing final records...
[12546] Total 1706 records indexed

Now apply the patch

Biblio, limit by range of biblioid:
$ misc/search_tools/rebuild_elasticsearch.pl -b -v --where "biblionumber between 100 and 150"
[12765] Checking state of biblios index
[12765] Indexing biblios
[12765] Committing final records...
[12765] Total 50 records indexed

Note that only 50 records where indexed (instead of the whole set of 435 records)

Auth, limit by authtypecode:
$ misc/search_tools/rebuild_elasticsearch.pl -a -v --where "authtypecode = 'GEOGR_NAME'"
[12848] Checking state of authorities index
[12848] Indexing authorities
[12848] Committing final records...
[12848] Total 142 records indexed

Again, only 142 have been indexed.

Sponsored-by: Steiermärkische Landesbibliothek
Sponsored-by: HKS3 / koha-support.eu
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 61e7aa374e8b4f85497c55e3741d829123fc4763)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36265: Bigger font-size for headers in staff interface
Fridolin Somers [Thu, 7 Mar 2024 09:31:28 +0000 (10:31 +0100)]
Bug 36265: Bigger font-size for headers in staff interface

In staff interface, text in nav bar and search header are at normal
size. Since these are used a lot, I propose to increase font-size at
110%.

Test by applying patch and rebuild CSS to see bigger text in staff
interface

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8ee1ce0cd2f9d6b513de6e9e7f421976dc2529da)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35967: Add more test cases
Tomas Cohen Arazi [Mon, 11 Mar 2024 13:45:08 +0000 (10:45 -0300)]
Bug 35967: Add more test cases

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b1aa99e96df314e1ae5f5bc26b8061c74622cd7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35967: (QA follow-up) `status` is not nullable
Tomas Cohen Arazi [Mon, 11 Mar 2024 13:38:33 +0000 (10:38 -0300)]
Bug 35967: (QA follow-up) `status` is not nullable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1b52c5c5395ebc11bde883ef1947fb91fd2e2cf3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35967: Add REST API endpoint to list patron recalls
Aleisha Amohia [Thu, 1 Feb 2024 00:43:26 +0000 (00:43 +0000)]
Bug 35967: Add REST API endpoint to list patron recalls

This enhancement adds a REST API endpoint to list a patron's recalls:

/api/v1/patrons/{patron_id}/recalls

This depends on the logged in patron having the manage_recalls subpermission.

To test:

1. Log in to the staff interface as your superlibrarian self (Patron A)
2. Go to Koha Administration -> Global system preferences. Enable the UseRecalls system preference
3. Set the relevant recalls circulation and fines rules
4. Search for an item (Item A)
5. Check out Item A to yourself (Patron A)
6. Log in to the OPAC as Patron B, a patron who does not have the manage_recalls permission
7. Search for Item A and request a recall
8. While still logged in to the OPAC as Patron B, hit this URL: https://your-opac-url/api/v1/patrons/patron-b-borrowernumber/recalls (swap out your URL and Patron B's borrowernumber)
9. Confirm you are given an error: "Authorization failure. Missing required permission(s)."
10. Log out of the OPAC and log back in, this time as Patron A
11. Hit the URL again https://your-opac-url/api/v1/patrons/patron-b-borrowernumber/recalls
12. Confirm you are able to view a list of Patron B's recalls
13. Confirm tests pass: t/db_dependent/api/v1/patrons_recalls.t

Sponsored-by: Auckland University of Technology
PA amended: QA follow-up: tidy

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9d8254efd39ef73741eeb80088c1c3378528918e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 34575: Add a CSS class to patron email
Pedro Amorim [Fri, 22 Dec 2023 10:36:42 +0000 (10:36 +0000)]
Bug 34575: Add a CSS class to patron email

Adds a CSS class to the patron email section in the 'name-address' column of search results in members-home.pl
No functional behaviour change.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b9804c0781f88516c8ba60d584d9a2fa30bf9f36)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 34574: Add CSS class to datatable select filter
Pedro Amorim [Thu, 21 Dec 2023 14:11:35 +0000 (14:11 +0000)]
Bug 34574: Add CSS class to datatable select filter

Test plan:

1) Create a new patron category, visit:
/cgi-bin/koha/admin/categories.pl?op=add_form
2) Add a category code, en enrollment period, a category type and a really long description like:
"This is a real long description of the patron category code for demo purposes"
3) Now do the same but for a library, visit:
/cgi-bin/koha/admin/branches.pl?op=add_form
4) Add a library code and a really long name like:
"This is a real long library name for demo purposes"
5) Visit patrons home:
/cgi-bin/koha/members/members-home.pl
6) Hit "Search". Notice the "library" and "category" columns grow in width to match the largest option (added in previous steps)
7) Apply patch, add the following CSS to IntranetUserCSS:
.dt-select-filter{
max-width:200px;
}
8) repeat 5) and 6). Notice the columns no longer grow in width.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 99014e9395c1811e6c9c31cbb781d77f49f05cc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36138: Add reason to status column on opac-holdshistory, if there is a reason
Lucas Gass [Tue, 20 Feb 2024 20:49:29 +0000 (20:49 +0000)]
Bug 36138: Add reason to status column on opac-holdshistory, if there is a reason

TO TEST:
1. Turn on OPACHoldsHistory
2. Make some holds for a patron and then cancel them with a reason.
3. Log in as that patron and go to the 'Holds history' tab. Notice the text in the 'Status' column is 'Cancelled' but nothing shows up regarding the reason.
4. Apply patch and try again, this time you should see the reason for cancellation.

Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f4f2fdb65f37780004d6d538c090902c20544167)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36093: (QA follow-up) Fix unit tests
Matt Blenkinsop [Fri, 19 Apr 2024 09:02:13 +0000 (09:02 +0000)]
Bug 36093: (QA follow-up) Fix unit tests

This patch removes some unnecessary lines from the test file

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit efb18db778bcbb0f730602800cc85be12472d1c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36093: Add unit test and fix QA tests
Matt Blenkinsop [Fri, 1 Mar 2024 10:29:40 +0000 (10:29 +0000)]
Bug 36093: Add unit test and fix QA tests

prove t/db_dependent/api/v1/erm_custom_reports.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8a1477557e8832c68583b1fac8d662f6e056bc1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36093: Fix missing array reference
Matt Blenkinsop [Wed, 14 Feb 2024 12:29:01 +0000 (12:29 +0000)]
Bug 36093: Fix missing array reference

This patch adds an array reference where it was previously missed.

Test plan:
Review patch diff and observe that the array reference is now correctly added

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 675ffb1b694339fedbe36f13b82b4fc1a8c8772d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 8461: Tidy
Nick Clemens [Fri, 12 Apr 2024 11:21:07 +0000 (11:21 +0000)]
Bug 8461: Tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit be4700b0f087e42ea4ab9075fd656b775c63048a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 8461: Display information on withdrawn item when checked in
Nick Clemens [Wed, 24 Jan 2024 14:49:53 +0000 (14:49 +0000)]
Bug 8461: Display information on withdrawn item when checked in

This patch displays the due date and withdrawn information in the Checked-in items table when 'ShowAllCheckins' is enabled. While the top message is clear, if a staff member checks in two items, then refers to the table they would not have all the information.

To test:
1 - Enable system preference 'ShowAllCheckins'
2 - Set system preference 'BlockReturnOfWithdrawnItems' to 'Block'
3 - Check out an item to a patron
4 - Mark the item as withdrawn
5 - Check the item in
6 - Note message at top says things like 'Cannot check in' 'Item has been withdrawn'
7 - Note the Checked-in items table says 'Not checked out'
8 - Apply patch, restart all
9 - Check the item in again
10 - Note top message has not changed
11 - Note the table now say 'Item was not checked in' and displays the due date and patron info
12 - Note the table also includes the withdrawn value for the item

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f5fcdb83e63683fac2c369ba3247d16bbd9f9a05)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 34963: Restore the ability to blank fields when editing a suggestion
Jonathan Druart [Wed, 17 Apr 2024 09:48:16 +0000 (11:48 +0200)]
Bug 34963: Restore the ability to blank fields when editing a suggestion

Regression introduced by bug 23991.
We don't want to remove the fields from the edition if they are empty.

Ideally we should have separate parameters for edition and search, but
this is the low-effort fix, and hopefully won't introduce side-effects.

Test plan:
Try to edit a suggestion and blank some fields
Try to search for suggestions using the search form on the left of the
screen

Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cd1f4145fe091314895a4f8a4f73a5b3a5f8bb87)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35973: DBRev 23.11.05.005
Katrin Fischer [Fri, 19 Apr 2024 15:52:33 +0000 (15:52 +0000)]
Bug 35973: DBRev 23.11.05.005

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6f705dfb1fe49d65cea09a76cef212ff5205671b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35973: (QA follow-up) Ad exec flag to update
Nick Clemens [Fri, 19 Apr 2024 13:30:28 +0000 (13:30 +0000)]
Bug 35973: (QA follow-up) Ad exec flag to update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b6a4aa541f43f6c1a4481474ea7059d1ceb83576)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35973: Correct wrong values for RedirectGuaranteeEmail system preference
Katrin Fischer [Sun, 17 Mar 2024 16:46:26 +0000 (16:46 +0000)]
Bug 35973: Correct wrong values for RedirectGuaranteeEmail system preference

The system preferences was added with 0/1 in sysprefs.sql is checked
as boolean. But the .pref file was added with yes/no which both
evaluate as strings to true.

This fixes the .pref file and includes a database update that sets
0 and 1 correctly for the value currently chosen in the pref.

To test:
* Make sure to update RedirectGuaranteeEmail to Enable/Don't enable
  before applying the patch
* Verify in the database, that the values was set to yes or no
  You can use a report like:
    SELECT * from systempreferences WHERE variable = "RedirectGuaranteeEmail";
* Apply patch and run database update
* Verify the value in the database was corrected:
  Yes = 1, No = 0
* Change the setting, verify the new value is stored correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 34c85d051d330210227eccf76dd835d6b35b3e60)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35394: Correction to booked items logic
Martin Renvoize [Fri, 8 Mar 2024 15:25:10 +0000 (15:25 +0000)]
Bug 35394: Correction to booked items logic

This patch fixes the overly extreme message that was designed to appeared
when someone tried to check out a booked item to the wrong user.
However, the message never appeared due to a logic error within
CanBookBeIssued which this patch also resolved.

Test plan
1) Make an item bookable
2) Add a booking for the item to patron A from tomorrow
3) In the database, update the booking start_date to today (or wait a
   day before the next step)
4) Attempt to check the book out to patron B.
   Note that you are displayed with the new message 'The item is booked
   for another patron' and you are unable to check the item out.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1ebd742e08494c111a8998bee730ed8bd4bcee37)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36386: Pass user and group to Net::Server
Marcel de Rooy [Thu, 21 Mar 2024 14:17:35 +0000 (14:17 +0000)]
Bug 36386: Pass user and group to Net::Server

This prevents the User/Group Not Defined warns in syslog.

Test plan:
Restart sip and check your syslog.

KTD Test Plan:
1) Stop your SIP server
2) Run "perl C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/koha-conf.xml"
   We need valid XML without any valid SIP settings to the output goes
   to the command line
3) Note the warnings
4) Apply this patch
5) Repeat step 2
6) No warnings!

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>
(cherry picked from commit 2973a4e81a2878b8d2654477b2556ad1b1fb4e46)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36623: (follow-up) Fix cypress test
Matt Blenkinsop [Wed, 15 May 2024 10:41:53 +0000 (10:41 +0000)]
Bug 36623: (follow-up) Fix cypress test

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f368156e075e1b3608520cfd6a48d3b1052b07d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36623: (follow-up) Fix translation 'Cronjobs'
Matt Blenkinsop [Thu, 18 Apr 2024 14:38:51 +0000 (14:38 +0000)]
Bug 36623: (follow-up) Fix translation 'Cronjobs'

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a3fc07806a9198ee2ffd1bf6c5373c360bb84520)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36623: Remove localhost reference
Matt Blenkinsop [Wed, 17 Apr 2024 15:03:53 +0000 (15:03 +0000)]
Bug 36623: Remove localhost reference

This patch removes a reference to localhost from a url within ERM

Test plan:
This is quite hard to test without sushi credentials and is quite an easy fix. Check the patch diff to verify that the localhost reference has now been removed from the url

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 644294e73bb17cc1527aaef5259de54106deb8cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30068: Remove table_settings_borrowers_table from circulation.tt
Jonathan Druart [Wed, 17 Apr 2024 10:06:03 +0000 (12:06 +0200)]
Bug 30068: Remove table_settings_borrowers_table from circulation.tt

The history is a mess, but here we init a JS variable that is never
used.

Test plan:
  git grep table_settings_borrowers_table
should not return anything after this patch applied

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e90cba4e3819fd244e9397fec6c1bc0c4984690d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36420: Allow Basic authentication using `cardnumber`
Tomas Cohen Arazi [Wed, 27 Mar 2024 12:01:32 +0000 (12:01 +0000)]
Bug 36420: Allow Basic authentication using `cardnumber`

This patch makes the API Basic authentication work with cardnumbers.
The used `checkpw_internal` method already does the fallback check.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/auth_basic.t
=> FAIL: Tests explode! [1]
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

[1] This highlights an underlying bug! Instead of getting 403, etc we get a 500. This is because of the internal fallback mechanism allowing the cardnumber+password combination, but then the Koha::Patron->find... not finding :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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>
(cherry picked from commit 154a2ea9ad5b6e911a504b8798f5ffe6df1c2297)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36420: Unit tests
Tomas Cohen Arazi [Wed, 27 Mar 2024 12:00:48 +0000 (12:00 +0000)]
Bug 36420: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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>
(cherry picked from commit 5c3ad38157f483aeb4ff26048a838b3ba6ad34fc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 30987: Fix relationship fields for patron full and quick add forms
Lucas Gass [Mon, 26 Feb 2024 15:59:29 +0000 (15:59 +0000)]
Bug 30987: Fix relationship fields for patron full and quick add forms

To test:
1. APPLY PATACH and restart services.
2. Find the borrowerRelationship system preference. The description should no longer include the words "Leave empty to deactivate."
3. Populate the system preference with at least 1 choice.
4. Find a patron category with can_be_guarantee set to 'Yes'.
5. Quick add a patron of that type, making sure the relationship field shows in the Patron guarantor section. ( You have to +Add gaurantor before this field will show )
6. The values in the dropdown should refelct the borrowerRelationship values.
7. With BorrowerMandatoryField make relationship mandatory.
8. Try step 5 again, this time the Relationship field should be mandatory.
9. Remove the field from  BorrowerMandatoryField and add it to BorrowerUnwantedField.
10. Do step 5 again, the relationship field should not show on the quick add form.

Signed-off-by: Myka Kennedy Stephens <mkstephens@fosgail.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fccbd327d9f93925917e7a4f478ab72c1d1f2363)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35810: (QA follow-up) Add aria label for accessibility
Emily Lamancusa [Tue, 20 Feb 2024 14:49:48 +0000 (09:49 -0500)]
Bug 35810: (QA follow-up) Add aria label for accessibility

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c71798b44c93be650bb5c5c682a4a24f83ba20d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35810: Add back to top button on staff pages
Thibaud Guillot [Mon, 15 Jan 2024 10:19:51 +0000 (11:19 +0100)]
Bug 35810: Add back to top button on staff pages

Test plan:

1) Apply this patch and rebuild css with 'yarn build'
2) For example, perform a search from catalogue
3) Scroll down to see the button appear and scroll up to see it
   disappear

Note that it's works also on patron search etc..

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 926e87de86496003915247bf6d50e4290fd3a1e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 33205: (bug 28268 follow-up) Method call $row->authid inside quotes - produces...
Janusz Kaczmarek [Sat, 11 Mar 2023 10:45:32 +0000 (11:45 +0100)]
Bug 33205: (bug 28268 follow-up) Method call $row->authid inside quotes - produces meaningless warning

Bug 28268, in
Koha::MetadataRecord::Authority::get_all_authorities_iterator,
introduced a warning:

warn "Something went wrong reading record for authority $row->authid: $@\n";

But a method cannot be called from within quotes in Perl - extrapolation
does not work for functions/methods.  So, if something really goes
wrong, this line of code produces a warning like:

Something went wrong reading record for authority
Koha::Schema::Result::AuthHeader=HASH(0x55cf7e0d0958)->authid: Empty
String at /usr/share/perl5/MARC/File/XML.pm line 450.

which is not very informative -- authid is missing.

Test plan
=========
Hard to reproduce.  This problem occurs only in rare cases of some weird problem
in stores authority data or if a auth record had been deleted after a ES reindex
action has been initiated.  But the problem in the code and the fix seem obvious.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9c2510ea2ef1db46bf42cf948b6c599250d6dd9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36552: (QA follow-up) Add a theoretical check on $record
Marcel de Rooy [Fri, 12 Apr 2024 08:10:18 +0000 (08:10 +0000)]
Bug 36552: (QA follow-up) Add a theoretical check on $record

Theoretically, it might be empty? Note the check too in the
other script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cc834ba187b7d4a4b817d73f5c4be0eb0ebdaaf4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36552: (QA follow-up) Add POSIX module
Marcel de Rooy [Fri, 12 Apr 2024 08:07:40 +0000 (08:07 +0000)]
Bug 36552: (QA follow-up) Add POSIX module

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 34746f5706fb49377e5d610a9fe6e2c4792b9b26)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36552: Update record 'date entered on file' when duplicating a record
Janusz Kaczmarek [Wed, 26 Apr 2023 23:04:48 +0000 (01:04 +0200)]
Bug 36552: Update record 'date entered on file' when duplicating a record

The 'date entered on file' (MARC21: 008/0-5, UNIMARC: 100a/0=7) of a record created
by duplication of an existing record should be set to the current date instead of
having the value of the original record.

Test plan
=========
1. Check the 'date entered on file' of an existing biblio / authotiry record
   (MARC21: 008/0-5, UNIMARC: 100a/0=7).
2. Duplicate the record by Edit > Edit as new (duplicate)
3. Control the 'date entered on file' value - it will equal to that of the
   original record.
4. Apply the patch (restart plack).
5. Repeat step 2.
6. Check the date - it should be the current date.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dd8f9e1266f2b93b0d57f1f1289d49f61129391e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 34621: Tidy import_patrons.pl
Kyle M Hall [Mon, 18 Mar 2024 11:04:23 +0000 (07:04 -0400)]
Bug 34621: Tidy import_patrons.pl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c6641ef24f389e65a0dd90d3fd788f110f21158a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 34621: Tidy Import.t
Kyle M Hall [Mon, 18 Mar 2024 11:00:37 +0000 (07:00 -0400)]
Bug 34621: Tidy Import.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a4c2dd03a99741129bd94e261d7681bd3e634de)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 34621: implement Patron import option to 'Renew existing patrons' 'from the curre...
Kyle M Hall [Fri, 25 Aug 2023 17:37:46 +0000 (17:37 +0000)]
Bug 34621: implement Patron import option to 'Renew existing patrons' 'from the current membership expiry date'

Test Plan:
1) Test importing a patron with the "from the current membership expiry date" option,
   note it does not work
2) Apply this patch
3) Restart all the things!
4) Re-test, note the expiration was renewed from the patron's current
   expiration date!

Signed-off-by: David Nind <david@davidnind.com>
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b89d744e868cd93632d6b84f5f39116a475d342e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36473: (follow-up) Additionally warn the stringified exception
Nick Clemens [Thu, 18 Apr 2024 11:17:33 +0000 (11:17 +0000)]
Bug 36473: (follow-up) Additionally warn the stringified exception

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 903a8685c661ddde61335a08e126506120345abc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36473: (follow-up) Add biblionumber to warning
Nick Clemens [Thu, 18 Apr 2024 10:35:52 +0000 (10:35 +0000)]
Bug 36473: (follow-up) Add biblionumber to warning

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1b99de33f9e553f80507ef7da5e711b98e979e39)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36473: (follow-up) Correct biblio to bibliographic
Nick Clemens [Thu, 18 Apr 2024 10:33:40 +0000 (10:33 +0000)]
Bug 36473: (follow-up) Correct biblio to bibliographic

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0191500149433313aa73a6c43255a19d659acad0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36473: Handle Invalid Metadata Exceptions in totalissues.pl
Nick Clemens [Mon, 1 Apr 2024 14:32:08 +0000 (14:32 +0000)]
Bug 36473: Handle Invalid Metadata Exceptions in totalissues.pl

This patch wraps the call for record in an eval, and catches any invalid metadata
exceptions, letting the warning show, but allowing the script to continue
To test:
1 - In default KTD record 369 has problems, otherwise you need to break a record
2 - Run : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v
3 - It dies at record 369 (or the one you broke)
4 - Apply patch
5 - Run again
6 - It succeeds, but skips the bad record

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>
(cherry picked from commit f3d2f34d7a6aeead30b40a30b239f15c6c94a7f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36473: Unit tests
Laura Escamilla [Tue, 2 Apr 2024 13:43:00 +0000 (13:43 +0000)]
Bug 36473: Unit tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Tidied.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9e9cc822cbd7836827a9596f71c50d5ad37f6802)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36483: Patrons.pm use case
Tomas Cohen Arazi [Tue, 2 Apr 2024 12:53:45 +0000 (12:53 +0000)]
Bug 36483: Patrons.pm use case

This case brought my attention as there was a different 'user' parameter being passed.
It turns out we already thought about this, and `objects.to_api` is of course always passing it :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 5d9396289e6ff754a79e5fad5f450144eb3a1c7c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36483: Make API controllers use $c->objects->to_api
Tomas Cohen Arazi [Tue, 2 Apr 2024 12:43:51 +0000 (12:43 +0000)]
Bug 36483: Make API controllers use $c->objects->to_api

This patch makes all controller methods using direct $object->to_api, rely on $c->objects->to_api.

Direct ->to_api calling prevents things like embeds, +strings, etc to be dealt with correctly.
In some cases this change reduces the code as the authors extracted the embed structure from the stash and passed it explicitly.

I left out two Patrons.pm cases because I need to study it a bit more.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 635e65a3303a01b90bbc93695b24c98720683f10)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 23102: No mock in selenium
Nick Clemens [Fri, 12 Apr 2024 09:46:20 +0000 (09:46 +0000)]
Bug 23102: No mock in selenium

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9aa811c33481dddded624829dfd24643f31fc04d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 23102: 404 errors on page causes SCI user to be logged out
Nick Clemens [Wed, 12 Jun 2019 11:43:48 +0000 (11:43 +0000)]
Bug 23102: 404 errors on page causes SCI user to be logged out

To test:
 1 - Have something on the SCO page that won't load
     Add to SCOUserJS:
        </script>
        <img src="http://localhost:8080/silk/famfamfam.png"/>
        <script>
 2 - Enable the SCO and SCI system preferences:
     WebBasedSelfCheck: Enable
     SelfCheckInModuke: Enable
     AutoSelfCheckAllowed: Allow
     AutoSelfCheckID / AutoSelfCheckPass to a valid user with permissions
 3 - Add the self_checkin_module and self_checkout_module permissions to the AutoSelfCheck user
 4 - Access the selfcheckout module https://yoursite.org/cgi-bin/koha/sco/sco-main.pl
 5 - Sign in using a patron
 6 - Enter an unkown barcode, I used "DONTMATTER"
 7 - If not logged out, click to 'Return to account summary'
 8 - You are asked to sign in again
 9 - Repeat with the SCI module
10 - Apply patch
11 - Repeat, but this time you can return to account

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5bab87f76b05bbf8627cf6786975e9e30a5f2f6c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 23102: Selenium test
Nick Clemens [Fri, 14 Feb 2020 15:15:10 +0000 (15:15 +0000)]
Bug 23102: Selenium test

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fee56e8d85e4cd897293d9d8b0b48b66071fbde0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35969: (follow-up) Improve wording
Marcel de Rooy [Wed, 7 Feb 2024 13:53:20 +0000 (13:53 +0000)]
Bug 35969: (follow-up) Improve wording

As suggested by David Nind. Thanks!

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b4ce5051c1ac080ac68d44b464141507e5eca602)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 35969: Add error code in opac-sendbasket.pl
Marcel de Rooy [Thu, 1 Feb 2024 07:55:55 +0000 (07:55 +0000)]
Bug 35969: Add error code in opac-sendbasket.pl

No need to carp about empty basket or no reply address.
Just add a simple explanation on the form.

Note that it makes no sense to show the form if the patron
has no email address. We need it as reply-to.

Test plan:
Try opac-sendbasket.pl?bib_list=null
Remove email address from your account, try again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 35293612a8d0efa932bf376b7855b17cc29d6d5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36517: Fix output from install_plugins.pl
Magnus Enger [Fri, 5 Apr 2024 13:41:08 +0000 (13:41 +0000)]
Bug 36517: Fix output from install_plugins.pl

When misc/devel/install_plugins.pl does not find any plugins, it prints
the list of pluginsdir, but with a literal \n separating the dirs, and
no newline at the end.

To test:
- Edit koha-conf.xml and add a second entry for <pluginsdir>, so there
  are two entries. The second one could just be a copy of the original.
- Run "perl misc/devel/install_plugins.pl"
- Note the output looks something like this:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins\n/var/lib/koha/kohadev/pluginsroot@kohadevbox:koha(master)$

- Apply the patch and run the script again. Output should be:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins
/var/lib/koha/kohadev/plugins
root@kohadevbox:koha(master)$

- Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4848def5e2a336e01bf0dd0ff61a75a30b35f137)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36493: Make cashups test more robust
Tomas Cohen Arazi [Tue, 2 Apr 2024 15:39:02 +0000 (12:39 -0300)]
Bug 36493: Make cashups test more robust

This patch makes the test independent from existing cash registers in
the system.

To test:
1. Enable UseCashRegisters on a fresh KTD
2. Add a cash register
3. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/cashups.t
=> FAIL: Tests fail!
4. Apply this patch
5. Repeat 3
=> SUCCESS: Tests pass!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 4436a7d41a74bf002fdd80ec97f0be38d40eee22)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36438: Check object for calling metadata
Marcel de Rooy [Wed, 27 Mar 2024 12:19:34 +0000 (12:19 +0000)]
Bug 36438: Check object for calling metadata

Resolve: Can't call method "metadata" on an undefined value at catalogue/MARCdetail.pl line 93

The proceeding lines check for $record and respond appropriately.

Test plan:
Call catalogue/MARCdetail.pl with an unexisting biblionumber.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a37ebc77b7f3513b2775ebb8819a710e5a2eb416)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36531: Serve text/javascript compressed, like application/javascript is
Phil Ringnalda [Fri, 5 Apr 2024 01:59:34 +0000 (18:59 -0700)]
Bug 36531: Serve text/javascript compressed, like application/javascript is

Koha serves static .js files as application/javascript (if /etc/mime.types
says to) and serves them compressed, but output_with_http_headers uses the
currently-correct text/javascript mimetype, and Koha doesn't compress that.

Test plan:
1. Set the preference EnableAdvancedCatalogingEditor to Enable.
2. Open the browser Web Developer Tools to the Network tab
3. Load Cataloging - Advanced editor
4. Click on the line for the framework?frameworkcode=&callback=define load
5. Note the content-type text/javascript, no Content-Encoding line, and
   the size of 1.9MB
6. Apply the patches from bug 36463 if they haven't been pushed, then this
   patch, and reset_all
7. Repeat steps 1-4, and note a Content-Encoding: gzip header and a
   Transferred size around 160KB

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c52af2cef0d79f20d74ebf170d4d5514b139ea65)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 months agoBug 36463: (follow-up) Adjust other occurence (intranet)
Nick Clemens [Fri, 29 Mar 2024 16:12:01 +0000 (16:12 +0000)]
Bug 36463: (follow-up) Adjust other occurence (intranet)

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 69ad327379fe0bc46926fb51276f81849a4a6f49)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>