koha-ffzg.git
23 months agoUpdate release notes for 22.05.02 release v22.05.02
Lucas Gass [Wed, 29 Jun 2022 20:47:56 +0000 (20:47 +0000)]
Update release notes for 22.05.02 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoIncrement version for the 22.05.02 release
Lucas Gass [Wed, 29 Jun 2022 20:29:48 +0000 (20:29 +0000)]
Increment version for the 22.05.02 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoUpdate release notes for 22.05.01 release v22.05.01
Lucas Gass [Mon, 27 Jun 2022 15:35:45 +0000 (15:35 +0000)]
Update release notes for 22.05.01 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoIncrement version for the 22.05.01 release
Lucas Gass [Mon, 27 Jun 2022 14:50:03 +0000 (14:50 +0000)]
Increment version for the 22.05.01 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoTranslation updates for Koha 22.05.01
Koha translators [Mon, 27 Jun 2022 14:40:28 +0000 (11:40 -0300)]
Translation updates for Koha 22.05.01

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30971: (follow-up) Fix recall.branchcode occurences
Tomas Cohen Arazi [Wed, 15 Jun 2022 19:26:51 +0000 (16:26 -0300)]
Bug 30971: (follow-up) Fix recall.branchcode occurences

This fixes a couple cases actually.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d0c4303c5a2a6b9548d140909114879505e9d943)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30971: (follow-up) Fix one more occurence
Tomas Cohen Arazi [Wed, 15 Jun 2022 19:18:08 +0000 (16:18 -0300)]
Bug 30971: (follow-up) Fix one more occurence

To test:
1. Run:
   $ git grep 'recall.itemnumber'
=> SUCCESS: No more occurences
2. Run:
   $ git grep 'recall.biblionumber'
=> SUCCESS: No more occurences
3. Run:
   $ git grep 'recall\->biblionumber'
=> SUCCESS: No more occurences
4. Run:
   $ git grep 'recall\->itemnumber'
=> FAIL: One standing occurence
5. Apply this patch
6. Repeat 4
=> SUCCESS: No more occurences
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9991dc8811ab2235117e79aabcc746dd9e56085a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30971: Recalls log viewer error
Tomas Cohen Arazi [Wed, 15 Jun 2022 19:14:22 +0000 (16:14 -0300)]
Bug 30971: Recalls log viewer error

This patch addresses the itemnumber and biblionumber attributes for
recalls having been renamed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b73ab06b48a38afbdddd3f6a190b2c63566db0a3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 29325: [22.05.X] Fix commit_file.pl
Tomas Cohen Arazi [Tue, 26 Oct 2021 16:54:15 +0000 (13:54 -0300)]
Bug 29325: [22.05.X] Fix commit_file.pl

This patch fixes the broken commit_file.pl script.

It doesn't deal with commiting the import from the UI.

To test:
1. Pick a file for staging:
   $ kshell
  k$ misc/stage_file.pl --file TestDataImportKoha.mrc
=> SUCCESS: All good
2. Commit!
  k$ misc/commit_file.pl --batch-number 1
=> FAIL: You see
DBIx::Class::Storage::DBI::_exec_txn_begin(): DBI Exception: DBD::mysql::db begin_work failed: Already in a transaction at /kohadevbox/koha/C4/Biblio.pm line 303
3. Apply this patch
4. Repeat 2
=> SUCCESS: Commit succeeds
5. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29325: (QA follow-up) Remove unexisting parameters of BatchRevertRecords

There is no interval and callback as in BatchCommitRecords.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29325: Call progress callback one last time to confirm comppletion

Previously after finishing the loop we were still in a transaction that never completed - we should report progress when done
one final time to commit the last records

To test:
1 - Stage a file with > 100 records
2 - Commit file
3 - Confirm batch is imported and no records left as staged

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29325: Fix import from staff client

same test as before, but via the staff client

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29325: Handle the transaction in BatchCommitRecords

Requiring the callback to commit was breaking reversion, and likely elsewhere

Let's simplify and say that the routine iteself will handle the txn and commit

TO test:
1 - Stage a file
2 - Import a file
3 - Revert a file
4 - Test staff client and command line

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 29325: (QA follow-up) Tidy up

tools/manage-marc-import.pl: sub commit_batch does no longer need $schema
tools/manage-marc-import.pl: sub revert_batch: calling BatchRevertRecords which has no interval and callback
misc/commit_file.pl: sub print_progress_and_commit does no longer commit, renamed
misc/commit_file.pl: sub print_progress does no longer have a schema parameter
misc/commit_file.pl: sub revert_batch reported deleted items as added

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30234: Fix local cover image display for other holdings
Jonathan Druart [Mon, 7 Mar 2022 10:30:35 +0000 (11:30 +0100)]
Bug 30234: Fix local cover image display for other holdings

Bug 26145 added the ability to add local cover images to items.
If SeparateHoldings is set, items from other libraries are displayed in
a separate tab, and not considered as visible. We have a JS test to
assume that images not shown are not present, this only apply for the
images for the bibliographic record, as they can come from different
sources.

Test plan:
Turn on LocalCoverImages and SeparateHoldings
Create a record with different items coming from different libraries
Attach images to items and to the biblio
Notice that with this patch you can see the images from the "Other
holdings" tab

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 54734f68f21a2d4d248e339d144b67e071317236)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30972: Don't replace biblio's local cover images when uploading an image's image
Jonathan Druart [Thu, 16 Jun 2022 10:29:14 +0000 (12:29 +0200)]
Bug 30972: Don't replace biblio's local cover images when uploading an image's image

When attaching a new cover image to an item we should not replace cover
images attached to the bibliographic record if "Replace existing covers"
is ticked.

Test plan:
Attach 1+ image to a bibliographic record
Attach 1 image to an item of this biblio
Attach another image to the item and seect "replace existing covers"
=> Without this patch the images attached to the biblio are removed
=> With this patch applied only the images attached to the image are
removed

Same if you tick the checkbox when attaching an image to the biblio

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e32e7a6c9019ac93217f1b4322076e779d35dec4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30883: Authorities merge is limited to 100 biblio with Elasticsearch
Fridolin Somers [Thu, 2 Jun 2022 07:23:23 +0000 (21:23 -1000)]
Bug 30883: Authorities merge is limited to 100 biblio with Elasticsearch

In C4::AuthoritiesMarc::merge, we search all biblio records using an authority with Koha::Authorities->linked_biblionumbers().
This method uses simple_search_compat() with no results limit, even saying in comment :
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/Authorities.pm#L80

With Zebra searchengin it is correct.

But not with Elasticsearch, there is an hardcoded limit at 100 in case no limit is given :
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/SearchEngine/Elasticsearch/Search.pm#L346

This means authorities links are wrong after a merge or an edit in case the authority is used in more than 100 biblio records.

:(

I propose to fix by using by default the real server max given by Koha::SearchEngine::Elasticsearch::Search::max_result_window().
This will allow a huge limit nearly impossible to reach.
See Bug 30882 to how increase this limit.

Test plan :
1) Use Elasticsearch search engine
2) Use an authority id=111 linked to 200 biblio records
3) Perform a search 'an:111', you get 200 results
4) Create a new authority id=222 linked to 2 biblio records
5) Perform a search 'an:222', you get 2 results
6) Perform a merge of the two authorties, keeping id=222
7) Perform a search 'an:111'
   without patch you get 100 results
   with patch you get no results
8) Perform a search 'an:222'
   without patch you get 102 results
   with patch you get 202 results

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 48d4b016ab8f5b7199efe75384c592e39e5dfce6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30899: [22.05.x] Follow-up for dbrev 211200041 from bug 30449
Marcel de Rooy [Tue, 7 Jun 2022 14:31:39 +0000 (14:31 +0000)]
Bug 30899: [22.05.x] Follow-up for dbrev 211200041 from bug 30449

Replace DROP CONSTRAINT by DROP FOREIGN KEY in old dbrev, and
submit a new dbrev to fix cases where dbrev went wrong.

Test plan:

NOTE: When you check show create table, verify that you see an index for category_code and a foreign key called borrower_attribute_types_ibfk_1.

[1] run updatedatabase; check show create table
[2] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; alter table borrower_attribute_types drop index category_code; RUN updatedatabase again; check show create table
[3] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; ALTER TABLE borrower_attribute_types ADD CONSTRAINT category_code_fk FOREIGN KEY (category_code) REFERENCES categories(categorycode); RUN updatedatabase again; check show create table

23 months agoBug 30907: Fix incorrect uses of Koha::Recall->item_level_recall
Tomas Cohen Arazi [Thu, 9 Jun 2022 13:22:16 +0000 (10:22 -0300)]
Bug 30907: Fix incorrect uses of Koha::Recall->item_level_recall

This attribute name was changed to *item_level* but this two remaining
places kept calling it with the old name.

To test, verify things don't explode when looking at checkouts with
recalls and also in the log viewer.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit beb663836b45a77f45195774133cc9b78957fcd5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30960: Fix JS error message when no pick-up location is selected when placing...
Petro Vashchuk [Mon, 13 Jun 2022 12:02:28 +0000 (15:02 +0300)]
Bug 30960: Fix JS error message when no pick-up location is selected when placing a hold

It's possible to place item-level hold without selecting a pick-up
location, which causes problems: if the item is then returned,
Koha tells about a hold, but gives error 500.
At patron's hold tab you see the number of holds, but cannot see the
actual holds there. However, if you go to the title in question,
then modify the hold so that it has a pick-up location,
then the hold will work normally again.

This patch fixes already existing but not working JS error message and
ensures that hold cannot be made while pickup location is undefined.

To reproduce:
1. Go to admin page, to the libraries configurations, and disable
pickup location for one of them.
2. Pick any biblio that has items that have that same library as a
default pickup location.
3. When placing the item-level hold, notice that the pickup location
dropdown box is empty by default. Keep it empty, place the hold.
4. Go to the patron's page of the patron who you placed that hold for,
check that it doesn't show the new hold.
5. Apply patch.
6. Repeat steps 2 and 3, it shouldn't let you make the item-level hold
until you select a specific pickup location.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 505b62b4d2ff9617733547d41088bdae37b4506d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 31005: Don't inlcude attributes only required for other categories
Nick Clemens [Thu, 23 Jun 2022 17:29:26 +0000 (17:29 +0000)]
Bug 31005: Don't inlcude attributes only required for other categories

To test:
 1 - Create a new patron attribute - check boxes to make it mandatory and visible etc.
 2 - Limit it to 'Patron' or other category
 3 - Edit a patron not in that category
 4 - Attempt to save
 5 - 500 Error
 6 - Missing mandatory extended attribute (type=MAND)
 7 - Apply patch
 8 - Attempt aedit again
 9 - It succeeds!
10 - Edit a patron in the category with MAND required
11 - on the edit page, right click teh attribute - click 'delete node'
12 - Submit the form
13 - 500 error, but this time that's good, the attribute check works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bc0264bae4769fc75133f0e10f13fc6edd86f016)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 31005: Unit test
Nick Clemens [Thu, 23 Jun 2022 17:22:53 +0000 (17:22 +0000)]
Bug 31005: Unit test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39c39430766f66008a465e1d023830c49b1f6122)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30912: Fix db rev 21.12.00.016
Tomas Cohen Arazi [Mon, 13 Jun 2022 13:17:22 +0000 (10:17 -0300)]
Bug 30912: Fix db rev 21.12.00.016

This is a mix of Nick's patch and Jonathan's comment on it. I tested it
with KTD using MySQL 8 and it works correctly.

To test:
1. Launch KTD with bells and whistles:
   $ docker compose -f docker-compose.yml \
                    -f docker-compose.mysql8.0.yml \
                    up -d
2. Inside of it, do:
   $ koha-mysql kohadev
   > update systempreferences set value="21.1200015" where variable="version";
   > \q
   $ restart_all
   $ updatedatabase
=> SUCCESS: All good :-D
3. Run:
   $ koha-mysql kohadev
   > update systempreferences set value="21.1200015" where variable="version";
   > ALTER TABLE user_permissions DROP PRIMARY KEY;
   > \q
   $ updatedatabase
=> FAIL: You get:
Upgrade to 21.12.00.016  [12:47:09]: Bug 30060 - Update user_permissions to add primary key and remove null option from code column
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS `PRIMARY`' at line 1 at /kohadevbox/koha/C4/Installer.pm line 739
4. Apply this patch
5. Run:
   $ updatedatabase
=> SUCCESS: Update goes well
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d3e6c3c7090ed706a152c6c465efc767fc0428c1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30733: [22.05] Simplify translatable strings
Victor Grousset/tuxayo [Wed, 11 May 2022 15:08:32 +0000 (17:08 +0200)]
Bug 30733: [22.05] Simplify translatable strings

And a few minor fixes when they where causing issues for
translatability.
And rephrased a string about password reset to have it identical to
other strings with the same meaning.

Simplified via wrapping strings with <span> to split to huge
concatenated strings with a lot of %s everywhere.

== Test plan ==
This patch needs mainly proof reading. Still it's possible to do some
basic testing to demonstrate that adding a <span> in an IF doesn't
break anything.
Pick in one of the 110 modified templates a string that you know how to
display. Otherwise:
1. acquisitions => vendor => basket => add to basket =>
   search "from existing record" => add order
2. Cancel the order
3. You see without issue "Bibliographic record will not be deleted"
4. administration => Patron categories
5. Try to delete a used and unused category
6. You see as expected
   Category XXXX is in use. Deletion not possible!
   and
   Confirm deletion of category XXXX

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30844: Ensure that allow_nonref is enabled when using older versions of JSON
Kevin Carnes [Thu, 9 Jun 2022 06:12:56 +0000 (08:12 +0200)]
Bug 30844: Ensure that allow_nonref is enabled when using older versions of JSON

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cc40bbf1952f67b2e46bae0cf71b8d4fbe0bea3d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30844: The OPAC detail page's browser is limited to the current page of results...
Kevin Carnes [Wed, 25 May 2022 10:54:25 +0000 (10:54 +0000)]
Bug 30844: The OPAC detail page's browser is limited to the current page of results when using Elasticsearch

When viewing the detail page of the first or last record of a result page,
it's not possible to browse to another page when using Elasticsearch.

To test:
1) Search for "*" in the OPAC
2) Click on the last result of the page
3) Observe that you cannot browse to the next page
4) Apply the patch
5) Search for "*" in the OPAC
6) Click on the last result of the page
7) Observe that you can browse to the next page
8) Sign off

Sponsored-by: Lund University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 71f54a75713c5d5a6acfbdd3fefe1166ea0efafd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30726: Fix "yesterday" when limited to past dates
Jonathan Druart [Wed, 1 Jun 2022 12:36:52 +0000 (14:36 +0200)]
Bug 30726: Fix "yesterday" when limited to past dates

Test plan:
Go to "Patrons with no checkouts" report, /cgi-bin/koha/reports/borrowers_out.pl
Select "Yesterday"
=> it automatically selects the previous day's date and populates the form field

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 637c580663f2abc5005ed2c96ef324e28c4feb20)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30746: Fix JS error on opac-memberentry
Jonathan Druart [Wed, 1 Jun 2022 12:54:34 +0000 (14:54 +0200)]
Bug 30746: Fix JS error on opac-memberentry

Empty PatronSelfRegistrationBorrowerMandatoryField and PatronSelfRegistrationBorrowerUnwantedField
Go to opac-memberentry.pl
Notice the JS error
  Uncaught TypeError: j is undefined
Apply this patch
Go to opac-memberentry.pl
=> no JS error
Fill the pref with some values
Go to opac-memberentry.pl
=> Confirm that the fields you marked as mandatory as flagged accordinly
on the UI

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c699f05970bbef78ec07e16eac5991cd72f9b87a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 23659: DBRev 22.05.00.001
Lucas Gass [Thu, 16 Jun 2022 14:35:42 +0000 (14:35 +0000)]
Bug 23659: DBRev 22.05.00.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 23659: (follow-up) Correct syspref.sql to match atomicupdate
Nick Clemens [Mon, 23 May 2022 12:59:03 +0000 (12:59 +0000)]
Bug 23659: (follow-up) Correct syspref.sql to match atomicupdate

Missed updating this file when I added another option and renamed another

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dd9ca0c44e89f922772092160fdd3892541de483)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 23659: Add DefaultHoldPickupLocation system preference
Nick Clemens [Wed, 18 May 2022 14:21:35 +0000 (14:21 +0000)]
Bug 23659: Add DefaultHoldPickupLocation system preference

On the staff side behaviour differs for default pickup location when placing a hold or
placing an overridden hold. Additionally, the behaviour has changed betwee master and stables

We should provide a consistent default, and allow the library to specify their choice

Note this only affects staff client as there is only a single dropdown on OPAC and it is not
tied to items

To test:
 1 - Apply patch
 2 - Update database
 3 - Find a record with items from various branches, and at least one with a different home/holding branch
 4 - Ensure there is an item that requires override to hold, and  AllowHoldPolicyOverride  is enabled
 4 - Attempt to place hold
 5 - Confirm all dropdowns default to logged in library
 6 - Set DefaultHoldPickupLocation to item's home branch
 7 - Refresh and confirm all dropdowns match item home library except biblio level hold - still logged in library
 8 - Set DefaultHoldPickupLocation to item's holding branch
 9 - Refresh and confirm defaults
10 - Mark one of the items holding library as 'not a pickup location' in Admin->Libraries
11 - Refresh and confirm dropdown is now empty for that item

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a25b4d78d090a69b46ad07b05f915cc0f849a30c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30893: Fix documentation in update_patrons_category.pl
Nick Clemens [Fri, 3 Jun 2022 11:35:34 +0000 (11:35 +0000)]
Bug 30893: Fix documentation in update_patrons_category.pl

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f279cdd30fa73241d87d9bb46c21f34c4370d472)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30868: (bug 29684 follow-up) Fix borrowernumber var in template
Jonathan Druart [Tue, 31 May 2022 06:23:30 +0000 (08:23 +0200)]
Bug 30868: (bug 29684 follow-up) Fix borrowernumber var in template

borrower_data does not contain the borrowernumber, it is sent
separately.

Test plan:
1. Edit a patron record (for example: Henry Acevedo).
2. Note that the URL is http://127.0.0.1:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=19
3. Change date of birth to yesterday.
4. Save.
5. Error message displayed above the Save and Cancel buttons:
   The following fields are wrong. Please fix them.
   - Patron's age is incorrect for their category. Ages allowed are 18-999.
6. Note that the URL is now http://127.0.0.1:8081/cgi-bin/koha/members/memberentry.pl
7. Fix date of birth (for example: change year to 2000).
8. Select Save.
=> Without this patch you get: "Patron not found. Return to search."
=> With this patch applied the patron's data is saved

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9f1cfa0bd31abdf54cb2ccd9eddae674dcaedc97)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30884: Fix jQuery selector to correctly detect active tab
Slava Shishkin [Fri, 3 Jun 2022 14:47:46 +0000 (17:47 +0300)]
Bug 30884: Fix jQuery selector to correctly detect active tab

To reproduce:
1. Go to /tools/modborrowers.pl and fill form Card number list with data and click Continue.
2. It should give "No patron card numbers or borrowernumbers given." warning.
3. Using the browser inspector tool see that post fields cardnumberlist or borrowernumberlist
   is sent with empty data.

Apply the patch, and then:
1. Fill form Card number or Borrowernumber list and click Continue.
2. Get the result: table with patrons for editing or warning about not found number.
3. Using the inspector tool see that request has data from the active tab in the form.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0062c67d6628ded2db76a9bb16a44e694acbaac)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30886: Show pending recall on item on OPAC
Aleisha Amohia [Thu, 2 Jun 2022 22:59:56 +0000 (22:59 +0000)]
Bug 30886: Show pending recall on item on OPAC

The 'completed' flag was causing the wrong status to be shown, but we
can also give a more useful message to the patron.

To test:
1) Enable the UseRecalls system preference and set up your
recalls-related circulation rules.
2) Check out an item to Patron B.
3) Log into the OPAC as Patron A and search for the item.
4) Place a recall on that item.
5) Go back to the staff client and check the item in. Confirm the recall
as waiting for Patron A.
6) Go back to the OPAC record page and look at the holdings table.
Notice the status still says the item is Available.
7) Apply patch, restart services, refresh the OPAC.
8) Confirm the holdings table status now says the item has a pending
recall.

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8f09ef75c365fd20dcdfefb92122e1b0c6afa6d6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30885: Display recall data correctly
Aleisha Amohia [Thu, 2 Jun 2022 21:23:55 +0000 (21:23 +0000)]
Bug 30885: Display recall data correctly

This page does not pull the recall columns correctly.

To test:
1) Enable the UseRecalls system preference and set up your
recalls-related circulation rules.
2) Check out an item to Patron B.
3) Log into the OPAC as Patron A and search for the item.
4) Place an item-level recall on that item.
5) Go back to the staff interface and search for the item. Confirm that when you go
to the record detail page, it explodes and errors are shown.
6) Apply patch and refresh page.
7) Confirm page loads as expected.
8) Check the Status information for the item in the Holdings table.
Confirm it shows the recall information correctly.
9) Check in the item and confirm the recall as waiting for Patron A.
10) Go back to the record detail page and confirm the Status information
for the item shows as Waiting in the Holdings table.

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3b1ee10ee5111eb5346ac8c285a776f8bd51e778)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30876: (follow-up) Use the $biblio object even further
Tomas Cohen Arazi [Wed, 1 Jun 2022 13:12:05 +0000 (10:12 -0300)]
Bug 30876: (follow-up) Use the $biblio object even further

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 12464241ebf8d4e3bbba9ea7023c66774ee810dc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30876: Use Koha::Biblio
Jonathan Druart [Wed, 1 Jun 2022 11:59:09 +0000 (13:59 +0200)]
Bug 30876: Use Koha::Biblio

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b60d59eb89a1250da5122ce6acea49a9197650cd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30876: Fix wrong call to ->search in list context
Tomas Cohen Arazi [Wed, 1 Jun 2022 11:16:00 +0000 (08:16 -0300)]
Bug 30876: Fix wrong call to ->search in list context

The code is clearly incorrect as ->search no longer returns a list when
called in list context.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8beb878e5b1276cf6924364d9a6e7caccbad065c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30756: (follow-up) Restore MARC21 authority file
Tomas Cohen Arazi [Sun, 5 Jun 2022 23:24:03 +0000 (20:24 -0300)]
Bug 30756: (follow-up) Restore MARC21 authority file

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b99458a6f60081f903565b869804d2e4a10687e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30840: Add support for barcode filters to course reserves
Nick Clemens [Tue, 24 May 2022 18:27:30 +0000 (18:27 +0000)]
Bug 30840: Add support for barcode filters to course reserves

This bug adds support for barcode filters on the inputs in the course reserves module.

To test:
1 - Set itemBarcodeInputFilter to 'Remove spaces from'
2 - Find a barcode in your system and add spaces between each characters
    e.g. 3 9 9 9 9 0 0 0 0 0 0 8 1 8
3 - Past that barcode into the checkin box, success
4 - Browse to course reserves, ensure you have a course or create on
5 - Test adding a reserve, batch adding a reserve, and batch removing reserves
6 - The pasted barcode does not in any
7 - Apply patch and restart
8 - Pasted barcode with spaces can now successfuly be added, batch added, and batch removed from courses

Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b8a18702d291210f9d62ca9daa747ec06f2cc8f6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 29961: Make horizontal scroll bar always visible on acqui/z3950_search.pl
Lucas Gass [Thu, 27 Jan 2022 16:55:34 +0000 (16:55 +0000)]
Bug 29961: Make horizontal scroll bar always visible on acqui/z3950_search.pl

To test:
1. In Acquisitions make a basket and add something "From an external source"
2. Search for a title and click on the 'MARC' button, make sure the MARC prview is both tall and wide.
3. You will not see the horizontal scroll bar unless you scroll all the way to the bottom of the preview.
4. Apply patch.
5. Try steps 1 & 2 again, this time you should see the horizontal scroll bar as soon as the MARC prveiw loads.

Note: I put the CSS on multiple lines for better readability

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 98c5ecd0d5bbced740c55c85ed1db226f1569b67)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30756: Rename to Koha_MetadataRecord_Authority
Marcel de Rooy [Sat, 14 May 2022 12:29:25 +0000 (12:29 +0000)]
Bug 30756: Rename to Koha_MetadataRecord_Authority

What we are actually testing here.

No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
JD amended patch: remove Dumper

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e96ba5ac7b3c12e8c231cc7e38fd49ebc13bc39c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30756: Further adjustments to Koha_Authority.t
Marcel de Rooy [Sat, 14 May 2022 12:07:17 +0000 (12:07 +0000)]
Bug 30756: Further adjustments to Koha_Authority.t

Remove use of exported_records file in favor of TestBuilder.
Remove conditional tests with SKIP block. Create reservoir record.

Test plan:
Run t/db_dependent/Koha_Authority.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24ff8b4a855680820761f6e6cfb7405526c82e2a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30756: Ground work for improving Koha_Authority.t
Marcel de Rooy [Sat, 14 May 2022 07:42:42 +0000 (07:42 +0000)]
Bug 30756: Ground work for improving Koha_Authority.t

Move stuff into two subtests.

Test plan:
Run t/db_dependent/Koha_Authority.t.
If you have no imported auths, you will still see skips.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 96867a4fdcde290a260085b38b5e285c455828db)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30855: (follow-up) Rewrite tests using Basic authentication
Tomas Cohen Arazi [Thu, 26 May 2022 14:35:41 +0000 (11:35 -0300)]
Bug 30855: (follow-up) Rewrite tests using Basic authentication

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b4ea3da6f1d1b6066317d885cb4a676a56e0f147)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30855: Rename /import => /import_batches
Tomas Cohen Arazi [Thu, 26 May 2022 14:17:18 +0000 (11:17 -0300)]
Bug 30855: Rename /import => /import_batches

This patch renames the route to make it consistent for future additions.

To test:
1. Run
   $ git grep 'matches/chosen'
=> FAIL: all occurences use /api/v1/import/
2. Apply this patch
3. Run:
   $ git grep 'matches/chosen'
=> SUCCESS: All occurences have '/api/v1/import_batches/'
4. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/import_record_matches.t
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 891972d0d335c4cf13ea458a024256367c21b6ad)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 27697: Only preopulate search when we have found a single biblio
Nick Clemens [Wed, 18 May 2022 15:08:39 +0000 (15:08 +0000)]
Bug 27697: Only preopulate search when we have found a single biblio

This patch uses the url parameter we created in 23475 to determine whether
we should populate the search bar or not

Note - a bookmark with this param will still populate search term with last search

To test:
1 - Search staff client for 'cat'
2 - Browse to a patrons checkouts and click on a title, or just go directly to a details page:
    http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=2850
3 - Search bar says 'cat'
4 - Apply patch
5 - Repeat 1-2
6 - Search bar is not populated
7 - Search "dalek war box set" or a term that finds a single record in your instance
8 - Search bar is populated
9 - Note url like: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=2850&found1=1

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 022330b8d26b81e53f9c4af7798fa42ff48bdaa3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30781: Fix warning in GetPreparedLetter
Fridolin Somers [Thu, 19 May 2022 03:50:13 +0000 (17:50 -1000)]
Bug 30781: Fix warning in GetPreparedLetter

Test by running :
  prove t/db_dependent/Letters.t
Check you dont see warning :
  Use of uninitialized value $val in substitution iterator

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 34b84b68e509c9172b850dad4dbc5b7e9f518225)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30781: Add unit test for substitute with undefined value
Fridolin Somers [Thu, 19 May 2022 03:47:18 +0000 (17:47 -1000)]
Bug 30781: Add unit test for substitute with undefined value

Add unit test that generates warn.
This may be usefull as no regression test.

Run prove t/db_dependent/Letters.t
You see warn :
t/db_dependent/Letters.t .. 1/84 Use of uninitialized value $val in substitution iterator at /kohadevbox/koha/C4/Letters.pm line 607.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2e0243c378158755660d7bc95e15ad32dd6d0ebf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30337: Holds to Pull ( pendingreserves.pl ) ignores holds if priority 1 hold...
Kyle Hall [Tue, 22 Mar 2022 18:14:52 +0000 (14:14 -0400)]
Bug 30337: Holds to Pull ( pendingreserves.pl ) ignores holds if priority 1 hold is suspended

Holds to Pull ( pendingreserves.pl ) ignores holds if priority 1 hold is suspended,
and shows the wrong number of "patrons with holds" which presumably tells the
librarian how many copies to pull from the shelves.

Test Plan:
1) Create a record with one or more holdable items
2) Place two holds on the record
3) Note they show in the holds to pull report
4) Suspend the priority 2 hold
5) Note the report continues showing that 2 patrons have holds
6) Resume the priority 2 hold
7) Suspend the priority 1 hold
8) Note the hold disappears from the holds to pull report
9) Apply this patch
10) Restart all the things!
11) Reload the holds to pull report
12) The report should show one hold that needs an item pulled to fill it!

Signed-off-by: David Nind <david@davidnind.com>
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: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e536229292617e2f6e5bade47e3fbad1a0101ea4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30523: Quiet console warning about missing shortcut-buttons map file
Owen Leonard [Wed, 13 Apr 2022 12:18:13 +0000 (12:18 +0000)]
Bug 30523: Quiet console warning about missing shortcut-buttons map file

This patch updates the Flatpickr plugin shortcut-buttons which adds the
"Yesterday," "Today," and "Tomorrow" links to Flatpickr widgets.  This
updates it to the latest version, 0.4.0.

The file is modified in two ways: The version information is added to
the top of the file, and the sourceMappingURL line is removed from the
bottom. This quiets browser console warnings about a missing map file.

To test:
- apply the patch and clear your browser cache.
- Go to Circulation -> Check out and check out to a patron.
- Click "Checkout settings" and click the "Specify due date" field.
- In the pop-up calendar, test all controls, including the shortcut
  links, to confirm that everything works as before.
- In the browser console there should be no warning related to
  shortcut-buttons-flatpickr. (Firefox didn't have the warning, Chromium
  can be used.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fcb08b0e932a2ce1b70e90b2c7219aebc72ac4f4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 28723: Replace "No title" by an empty string
Julian Maurice [Tue, 31 May 2022 09:36:37 +0000 (11:36 +0200)]
Bug 28723: Replace "No title" by an empty string

This is to be consistent with what is done in checkouts.js

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5a90eb17e6c9a0d54376584e356dcacef4aab6c8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 28723: Fix holds table display when a biblio has no title
Julian Maurice [Tue, 20 Jul 2021 12:45:35 +0000 (14:45 +0200)]
Bug 28723: Fix holds table display when a biblio has no title

Test plan:
1. Create a biblio without title, then create an item for this biblio.
2. Place a hold on it.
3. Go to the patron detail page and click on the Holds tab
4. Confirm that holds are correctly displayed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 35874fa380707ba8eedda825e9cdc7ad47755958)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30629: fix <span> in title of some pages
Victor Grousset/tuxayo [Fri, 13 May 2022 19:25:53 +0000 (21:25 +0200)]
Bug 30629: fix <span> in title of some pages

== Test plan ==
1. Go to http://localhost:8081/cgi-bin/koha/patroncards/manage.pl?card_element=layout
2. See that the page title in your browser window title is wrong because it contains <span>
3. Go to http://localhost:8081/cgi-bin/koha/labels/label-manage.pl?label_element=batch
4. See that the page title in your browser window title is wrong because it contains <span>
5. Go to http://localhost:8081/cgi-bin/koha/admin/aqbudgetperiods.pl
6. Administration => Budgets => Click on a budget => planning => plan by months
7. See that the page title in your browser window title is wrong because it contains <span>
8. Refresh the pages and see that the titles are correct
9. Sign off :)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 44d6528b566e5c16eba9b15f8aa24667293766c3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 28529: Make biblio-level hold itemtype count against max rules
Tomas Cohen Arazi [Wed, 1 Sep 2021 21:00:59 +0000 (18:00 -0300)]
Bug 28529: Make biblio-level hold itemtype count against max rules

The current situation is that biblio-level holds can be assigned an item
type, so they can only be fulfilled by items matching that specified
item type (be it item-level itype or the fallback to biblio-level).

But there's the situation in which max holds limits for a specific item
type can be overridden by using biblio-level holds with item type
selection (AllowHoldItemTypeSelection) enabled.

To test:
1. Have a patron of category 'Staff' (S)
2. Have 3 records with items with the 'BK' item type, and maybe others
3. Enable AllowHoldItemTypeSelection
4. Set a limit of 2 max holds for that category+item type
5. In the OPAC. Place bibio-level holds, with item type contraint to 'BK' on those 3 records
=> FAIL: You can place the 3 holds
6. Cancel the holds
7. Apply this patch and restart all
8. Repeat 5
=> SUCCESS: You can only place 2 holds
9. Run:
   $ kshell t/db_dependent/Reserves.t
=> SUCCESS: Tests pass!
10. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 81bdce5c4390e1914ff6cfb2adb469027904f659)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 28529: Regression tests
Tomas Cohen Arazi [Fri, 3 Sep 2021 19:47:14 +0000 (16:47 -0300)]
Bug 28529: Regression tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ad14a8eee8a8f229518ee0d40c7d9c807f1c0937)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30731: Remove Readonly::XS::MAGIC_COOKIE
Marcel de Rooy [Thu, 12 May 2022 07:05:50 +0000 (07:05 +0000)]
Bug 30731: Remove Readonly::XS::MAGIC_COOKIE

This variable does not make sense anymore, since the Readonly::XS
module is not listed in the cpanfile. So it will not be required
the versions_info loop.

Test plan:
Run t/Installer_PerlModules.t again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 900aa4bf51b131c9f362cb647edf1bb0de2fbcc0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30731: Silence noisy CPAN modules in C4::Installer::PerlModules
Marcel de Rooy [Wed, 11 May 2022 14:26:06 +0000 (14:26 +0000)]
Bug 30731: Silence noisy CPAN modules in C4::Installer::PerlModules

Main change is replacing 'no warnings' by local $SIG{__WARN__}.

The modules are sorted now too. This will make results of requiring
them one after the other a more predictable experience and improves
the output of koha_perl_deps.

Test plan:
Run about. Check plack intranet log.
Run koha_perl_deps.pl -a

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit da1115336bfab44eb9eebaae214c355fa19fc36d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30731: Unit tests
Marcel de Rooy [Wed, 11 May 2022 14:35:18 +0000 (14:35 +0000)]
Bug 30731: Unit tests

Installer_pm.t can safely be discarded, having Installer_PerlModules.t.

Note: Without the second patch, the test about versions_info being silent
might fail. With the second patch, it should pass.
Note that since the order of requiring the cpan modules varies (without
the second patch), the results (potential warnings) vary too.

Test plan:
Run t/Installer_PerlModules.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2265739a378c1d31c5ea3d4beb07cbaa4d04e62b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30842: 2FA - Allow at least one old TOTP
Jonathan Druart [Wed, 25 May 2022 08:04:58 +0000 (10:04 +0200)]
Bug 30842: 2FA - Allow at least one old TOTP

We allow one old token when we are setting the two-factor auth, we
should reuse the same settings when validation the authentication
itself.

Test plan:
Setup 2FA for your logged-in user
Logout/Login
Have a look at the code and wait for 30 sec before using it (< 1min
however)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f6110ce4170ced8ba246e295cc547c9794566ef1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30786: Fix capitalization in advanced search system preferences
David Nind [Wed, 18 May 2022 02:21:14 +0000 (02:21 +0000)]
Bug 30786: Fix capitalization in advanced search system preferences

This fixes the capitalization in the descriptions for the
AdvancedSearchTypes and OpacAdvancedSearchTypes system preferences.

Test plan:
1. In the staff interface, search the system preferences for
   'AdvancedSearch'.
2. Review the current descriptions for the AdvancedSearchTypes and
   OpacAdvancedSearchTypes system preferences.
3. Note that "..Shelving Location.." is used instead of "..Shelving
   location..".
4. Apply the patch.
5. Refresh the page.
6. Sentence case is now used for "Shelving location" in the
   descriptions (as per coding guideline HTML4: Upper and lower cases
   in strings).
7. Sign off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 17b7ae56c539bfaaf2dae75f6855e9cda13ec904)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30788: Unit test
Katrin Fischer [Fri, 20 May 2022 08:05:43 +0000 (08:05 +0000)]
Bug 30788: Unit test

Run:
  prove t/db_dependent/Circulation/CalcFine.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e59e2c4b8f58b267227bd5159e90a3ce015d0beb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30788: Fix warning in Overdues.pm when fine is empty in circ rules
Katrin Fischer [Fri, 20 May 2022 07:43:15 +0000 (09:43 +0200)]
Bug 30788: Fix warning in Overdues.pm when fine is empty in circ rules

Argument "" isn't numeric in multiplication (*) at /usr/share/koha/lib/C4/Overdues.pm

To test:
* Create a issuing rule where fine is empty, but a fine interval is set.
  Fine amount: empty
  To do this, remove the 0 displayed in the input field before saving.
  Fine charging interval: 5 or any other numeric value
  When to charge: Start of interval
  Fine grace period: 0
* Check out an item with the due date yester (use specify due date)
* Run misc/cronjobs/fines.pl -v
* You should see above warn in the output
* Apply patch
* Rerun fines.pl, there should be no warn.
* Run:
  t/db_dependent/Circulation/CalcFine.t
  t/db_dependent/Fines.t
  t/db_dependent/Circulation.t
  t/db_dependent/Overdues.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 368bdcf4e95e1cbb93f53f1d5dd976b98f59bf29)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30828: Remove useless 'type' parameter in placerequest.pl
Joonas Kylmälä [Sat, 21 May 2022 19:23:32 +0000 (19:23 +0000)]
Bug 30828: Remove useless 'type' parameter in placerequest.pl

To test:
 1) Grep for placerequest.pl in the source code and check that
    request.tt is the only place where the type parameter is passed.

Signed-off-by: David Nind <david@davidnind.com>
JD amended patch: adjust commit title
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 54a6c73c6d6e94554b7e4c15554e08d79e3eb578)

23 months agoBug 30774: Typo: i %sEdit %sReserve %s
Owen Leonard [Tue, 17 May 2022 11:19:19 +0000 (11:19 +0000)]
Bug 30774: Typo: i %sEdit %sReserve %s

This patch removes an out of place "i" and replaces it with a space. The
patch also removes obsolete CDATA markers in the page's JavaScript.

To test, apply the patch and go to Course reserves.

- Create a course if necessary, then view the details of your course.
- Click the "Add reserves" button.
- Enter a barcode or biblionumber.
- On the next page, the heading "Reserve [title] for [course]" should
  look correct, with no extra "i" at the beginning of the line.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 72dcf17ea0f23b0e23272231d39632bc5b57db73)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30772: (follow-up) Age restriction message
David Nind [Sat, 28 May 2022 18:55:59 +0000 (18:55 +0000)]
Bug 30772: (follow-up) Age restriction message

Improve age restriction message.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a614cb21268a21cb21f8aa59025bef5d5c1bb0d0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30772: Terminology: Replace instances of "reserve" with "hold"
Owen Leonard [Tue, 17 May 2022 12:04:41 +0000 (12:04 +0000)]
Bug 30772: Terminology: Replace instances of "reserve" with "hold"

There were several templates where we were still using the term
"reserve" instead of "hold." This patch corrects the ones I found,
including in a couple of HTML comments.

To test, apply the patch and confirm that the changes look correct and
affect only the relevant term.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e68ecb3311eb34e8b1f12a98ccf51576c03f3307)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 29860: Remove item type-related warnings
Tomas Cohen Arazi [Wed, 12 Jan 2022 14:15:10 +0000 (11:15 -0300)]
Bug 29860: Remove item type-related warnings

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/selenium/regressions.t
=> FAIL: You see several
item-level_itypes set but no itemtype set for item (985) at /kohadevbox/koha/Koha/Schema/Result/Item.pm line 905.
2. Apply this patch
3. Repeat 1
=> SUCCESS: No more item type warnings
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: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 169c535e880bf1233622042cab76351b7dbc65ca)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30761: Fix typos in OPAC reset password template
Owen Leonard [Tue, 17 May 2022 12:30:28 +0000 (12:30 +0000)]
Bug 30761: Fix typos in OPAC reset password template

This patch corrects the word "PLease" to "Please." The patch also adds
some periods at the end of some alert strings to make punctuation
consistent between different alerts.

To test, an inspection of the patch is probably enough. The main fix
(the "PLease") only appears when an unknown error occurs.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d1f67e4287e888beb205c48a6769d967deb1777e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30862: Typo: langues
Caroline Cyr La Rose [Fri, 27 May 2022 21:52:06 +0000 (17:52 -0400)]
Bug 30862: Typo: langues

This patch changes the word 'langues' to 'languages' in the description
of the following system preferences:

- OPACXSLTDetailsDisplay

- OPACXSLTListsDisplay

- OPACXSLTResultsDisplay

- XSLTDetailsDisplay

- XSLTListsDisplay

- XSLTResultsDisplay

To test:
1- Apply patch
2- Check the aforementioned system preferences and make sure the descriptions say 'languages'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 58de13cb9a5efa3fd9c9fd50865eea62ee18ec5b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30853: Add description for baskets in swagger.yaml
Tomas Cohen Arazi [Thu, 26 May 2022 12:52:46 +0000 (09:52 -0300)]
Bug 30853: Add description for baskets in swagger.yaml

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b46396c0035a981f61fbd2c26e0dceb50de0566b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30528: Process limits before handling CCL query
Nick Clemens [Thu, 14 Apr 2022 12:20:09 +0000 (12:20 +0000)]
Bug 30528: Process limits before handling CCL query

This patch moves the code that handles limit processing before that for CCL queries to ensure that special limit cases (branch, multibranch, etc) are handled before adding the limits to the query string

To test:
1 - Apply unit tests patch only
2 - prove -v t/db_dependent/Search.t
3 - It fails
4 - Apply this patch
5 - It passes!
6 - Test searching and confirm things work as epxected

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2da14cf8c10c2d5165220e6657b279b37aa02f81)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30528: Unit tests
Nick Clemens [Thu, 14 Apr 2022 12:19:22 +0000 (12:19 +0000)]
Bug 30528: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fde3aefba821c43554adaa53324c81cbe7d2d95a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30870: Don't skip tests if Test::Deep if not installed
Jonathan Druart [Tue, 31 May 2022 09:29:57 +0000 (11:29 +0200)]
Bug 30870: Don't skip tests if Test::Deep if not installed

We are using Test::Deep in different tests, but from t/db_dependent/Koha.t the tests are skippted if the module is not installed.
We must assume the module is installed

Test plan:
  prove t/db_dependent/Koha.t
should return green in ktd

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 42290cb43deb7dde668d9a55467c44ba705e665c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 29883: Add test
Jonathan Druart [Tue, 31 May 2022 09:26:36 +0000 (11:26 +0200)]
Bug 29883: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 740258568368b7741df1a95d7bf330c527bf9054)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 29883: avoid uninitialized value warn in GetAuthorisedValues sub
Petro Vashchuk [Fri, 14 Jan 2022 09:57:39 +0000 (11:57 +0200)]
Bug 29883: avoid uninitialized value warn in GetAuthorisedValues sub

GetAuthorisedValues is defined with optional parameter $category but it
is instantly interpolated without preventing "Use of uninitialized value
$category in concatenation (.) or string at .../C4/Koha.pm line 491."
warning.
As category param is optional, we can avoid throwing that warn as it is
something that can happen and is not an actual error:
C<$category> returns authorized values for just one category (optional).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 44e126bcc7fae369e13c533eea79f00ef41f2ff1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30854: (QA follow-up) Spec fixes
Tomas Cohen Arazi [Thu, 26 May 2022 13:42:29 +0000 (10:42 -0300)]
Bug 30854: (QA follow-up) Spec fixes

This patch fixes minor spec QA issues:

* Missing summary for routes
* Missing error_code description for 500

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3b431117e4e20e15f48cfa3c5dca5c228b96b4af)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30854: Missing description for 'import_record_matches' in swagger.yaml
Tomas Cohen Arazi [Thu, 26 May 2022 13:38:59 +0000 (10:38 -0300)]
Bug 30854: Missing description for 'import_record_matches' in swagger.yaml

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 15f8d8f42b6f2bdd14d5488cda92ae69d4b4f3c2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30892: (bug 30742 follow-up) Send single bib as a holdable bib
Nick Clemens [Thu, 2 Jun 2022 17:24:21 +0000 (17:24 +0000)]
Bug 30892: (bug 30742 follow-up) Send single bib as a holdable bib

To test:
1. Try placing hold
2. Everything seems to work but no hold gets placed.
3. Apply patch
4. Verify holds are no placed correctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d37b9e6013ab2f1c3cb94e68dd75a2e5092fe5e4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30742: Remove 'bad_bibs' and send a list of holdable bibs
Nick Clemens [Fri, 13 May 2022 15:23:30 +0000 (15:23 +0000)]
Bug 30742: Remove 'bad_bibs' and send a list of holdable bibs

Currently place request gets a list of bad_bibs that is created via javascript on the
template. It ignores this list

Ths patch instead doesn't add info for bad bibs, and provides a list of the bibs that
can be held

To test:
1 - Attempt multi hold with some items that can be held, and one that cannot due to notforloan
2 - Fill in pickup locations and place hold
3 - Note hold is place on bib with no avilable items and hsows twice in results
4 - Apply patch
5 - repeat with another patron
6 - Note no aidditonal hold on record with notforloan items
7 - Note with with not for loan items appears only once in results

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 503a7f0ab10b6689c2ac6e42f7f788d383575028)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30742: Prevent placing holds on items/records where all items notforloan
Nick Clemens [Fri, 13 May 2022 14:01:48 +0000 (14:01 +0000)]
Bug 30742: Prevent placing holds on items/records where all items notforloan

This patch does a few things:
1 - Adds itemtype not for loan status to display
2 - Adds a conditional to display notforlaon status as the reason a hold cannot be placed
3 - Seperates the lower 'Place hold(s)' buttons for single and multi holds into two template sections
4 - Handles the case where all bibs in a multi hold have no items available
5 - Disables the button for single hlds when all items are unavailable

To test:
 1 - Find or create a record with all items of itemtype marked 'notforloan'
 2 - Attempt to place single hold on this record from staff client
 3 - See one disab;ed button, one enabled 'Place holds' button
 4 - Click 'Place holds' - hold placed
 5 - Cancel hold
 6 - Place multiple holds with some bibs that can be held, and this one that cannot
 7 - Notice message that 'Cannot place hold on some items'
 8 - Click 'Place holds' - hold is generated for the notforloan bib
 9 - Apply patch
10 - Place single hold
11 - Note you now see not for loan status on items
12 - Note the red x also includes message abnout not for loan status
13 - Note the 'Place hold' button is disabled
14 - Attempt multi hold
15 - Message now includes "No items available: One or more records have no items that can be held"
16 - Click 'Place holds'
17 - Above still places the hold - this is for a followup patch

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c1c1e19f5529b5728ed7770a030feabf1a9b8df)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30831: Unit test
Nick Clemens [Mon, 23 May 2022 12:18:11 +0000 (12:18 +0000)]
Bug 30831: Unit test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: minor typo fix
(cherry picked from commit f08951f044e2cdac7a9bdf4cdfb6897b9de9e1f2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 30830: Add Koha Objects for Koha Import Items
Nick Clemens [Mon, 23 May 2022 12:25:53 +0000 (12:25 +0000)]
Bug 30830: Add Koha Objects for Koha Import Items

To test:
prove -v t/db_dependent/Koha/Import/Record/Items.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6cd0249725f211f0df77ba367c379f0e5c5e1d4e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 28152: Log the "duplicate item barcode" error
Jonathan Druart [Mon, 10 Jan 2022 10:22:54 +0000 (11:22 +0100)]
Bug 28152: Log the "duplicate item barcode" error

Looking at the code this 'import_error' column is empty for the last 9 years. Not sure it makes much sense to have this single error now.

commit 1dba9c6409d78cb1f90de6c1300cb5b63fb1b851
Date:   Wed Oct 10 14:21:22 2012 -0500
    Bug 7131: teach MARC import how to overlay items

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c0c375d8e073c9eb765179fa7b3c3d0136b5174)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
23 months agoBug 28152: Fix import_items row creation if duplicate barcode
Jonathan Druart [Thu, 15 Apr 2021 10:12:23 +0000 (12:12 +0200)]
Bug 28152: Fix import_items row creation if duplicate barcode

We are trying to insert "duplicate item barcode" into import_items.itemnumber (integer),
it fails with "Incorrect integer value: 'duplicate item barcode' for column 'itemnumber' at row 1"

To reproduce:
Export a biblio with an item
Import it
=> The item is not added, and there is no new row in import_items.

The error only appears in the log if you comment the close STDERR and
close STDOUT lines

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7a8a456c7dcc0bc2a015968f7a2c0e9ac2370f0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoBug 29828: Prevent additional content to be created without default
Jonathan Druart [Mon, 10 Jan 2022 09:15:35 +0000 (10:15 +0100)]
Bug 29828: Prevent additional content to be created without default

When creating or editing an additional content, the form is submitted if
only the title of the 'default' tab is filled in.
We should submit the form only if both title and content exist.

Test plan:
Create a new content using text editor (codemirror)
Confirm that the form is submitted only if title and content from the
default tab are not empty
Try again with wysiwyg (tinymce)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 05934b89b1b43ceb88928b48a4e1fd69708ac61b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2 years agoKoha 22.05.00 is here! v22.05.00
Fridolin Somers [Thu, 26 May 2022 09:47:49 +0000 (23:47 -1000)]
Koha 22.05.00 is here!

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years ago22.05.00: Fix translations (bis)
Fridolin Somers [Thu, 26 May 2022 09:42:40 +0000 (23:42 -1000)]
22.05.00: Fix translations (bis)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years ago22.05.00: Fix translations
Jonathan Druart [Fri, 26 Nov 2021 10:01:09 +0000 (11:01 +0100)]
22.05.00: Fix translations

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoTranslation updates for Koha 22.05.00
Koha translators [Thu, 26 May 2022 08:11:24 +0000 (05:11 -0300)]
Translation updates for Koha 22.05.00

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoAdd release notes for Koha 22.05.00
Fridolin Somers [Thu, 26 May 2022 07:37:13 +0000 (21:37 -1000)]
Add release notes for Koha 22.05.00

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30808: Add the 22.05 release team.
Martin Renvoize [Thu, 19 May 2022 12:40:56 +0000 (13:40 +0100)]
Bug 30808: Add the 22.05 release team.

Test plan
1/ Check against
   https://wiki.koha-community.org/wiki/Release_Teams

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years ago22.05.00: Update kohastructure.sql
Fridolin Somers [Thu, 26 May 2022 03:00:48 +0000 (17:00 -1000)]
22.05.00: Update kohastructure.sql

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years ago22.05.00: Update mailmap
Fridolin Somers [Thu, 26 May 2022 02:13:29 +0000 (16:13 -1000)]
22.05.00: Update mailmap

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years ago22.05.00: Update history.txt
Fridolin Somers [Thu, 26 May 2022 02:03:32 +0000 (16:03 -1000)]
22.05.00: Update history.txt

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years ago22.05.00: Update contributors.yaml
Fridolin Somers [Thu, 26 May 2022 02:01:56 +0000 (16:01 -1000)]
22.05.00: Update contributors.yaml

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoAdd Jeremy Breuillard to mailmap
Fridolin Somers [Thu, 26 May 2022 01:53:46 +0000 (15:53 -1000)]
Add Jeremy Breuillard to mailmap

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoAdd Thibaud Guillot to mailmap
Fridolin Somers [Thu, 26 May 2022 01:48:09 +0000 (15:48 -1000)]
Add Thibaud Guillot to mailmap

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30852: DBRev 21.12.00.057
Fridolin Somers [Thu, 26 May 2022 06:35:04 +0000 (20:35 -1000)]
Bug 30852: DBRev 21.12.00.057

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30852: Add index on article_requests.debit_id
Fridolin Somers [Thu, 26 May 2022 06:32:35 +0000 (20:32 -1000)]
Bug 30852: Add index on article_requests.debit_id

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30747: (follup-up) Add missing otherholdings_datelastborrowed column in settings
Fridolin Somers [Mon, 23 May 2022 18:40:51 +0000 (08:40 -1000)]
Bug 30747: (follup-up) Add missing otherholdings_datelastborrowed column in settings

See Bug 24176

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30747: Make column settings work for otherholdings table using forEach loop
Lucas Gass [Wed, 18 May 2022 14:12:11 +0000 (14:12 +0000)]
Bug 30747: Make column settings work for otherholdings table using forEach loop

To test:

1. Turn on SeparateHoldings and find a record that has some items at
   different home libraries.
2. Look at the Other holdings(x) tab. Notice there is no Columns tool
   (gear icon).
3. Go to Table Settings, try hiding columns from the otherholdings
   table. You cannot.
4. Apply patch.
5. Now under the Other holdings(x) tab you should see the Columns
   button, it should work.
6. Go back to Table settings and try hiding columns, it should work.
7. Now try uploading an item level cover image, make sure all columns
   are still properly hidden and the Columns tool works
8. Try steps 6 & 7 but with the regular holdings table. Confirm that all
   colums can properly hide.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Included a rename to table_name(s).
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30730: (follow-up) Simplify query
Martin Renvoize [Thu, 19 May 2022 14:52:21 +0000 (15:52 +0100)]
Bug 30730: (follow-up) Simplify query

This patch drops the 'fetch all non-loanable items' query used in the
subsequent query as part of the 'not_in' and instead replaces it with a
simple filter on 'notforloan => 0'

Test plan
Run the included unit tests before and apply applying the followup.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30730: Unit tests
Shi Yao Wang [Tue, 17 May 2022 15:37:21 +0000 (11:37 -0400)]
Bug 30730: Unit tests

Added an entry in holds for an item with negative notforloan value to
test if get_items_that_can_fill returns the right items.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>