koha.git
22 months agoTranslation updates for Koha 21.05.18
Koha translators [Fri, 26 Aug 2022 18:54:33 +0000 (15:54 -0300)]
Translation updates for Koha 21.05.18

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 25669: (follow-up) Minor fixes
Kevin Carnes [Wed, 25 May 2022 09:19:21 +0000 (09:19 +0000)]
Bug 25669: (follow-up) Minor fixes

Bulk doesn't support include_type_name, update requirement to
Search::Elasticseach@6.80, and remove data type name from tests.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 22c9ea9737d614a26b06092cda9708e27013e494)
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 3a46ff9702146b8def00c1c4000a316dc0fa10ed)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 25669: Use include_type_name parameter in ES calls
Nick Clemens [Mon, 28 Mar 2022 12:00:25 +0000 (12:00 +0000)]
Bug 25669: Use include_type_name parameter in ES calls

This patch includes the parameter:
include_type_name
on our ES calls

It removes the deprecation warning we are seeing, and should allow using ES7 with no other chnages.

For ES8 we will need to remove the hardcoded type,

I would suggest a second patch, with a new syspref "ElasticsearchLegacyType" set to 'True' by default.
Description can explain that this must be set to false, and data reindexed after upgrading to ES7 and before
upgrading to ES8 - then we can drop this pref when we drop ES7 support

When we drop ES6 support the pref can be set default true for upgrades, default 'false' for new installs

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 150a4b03f337f6a58869c67d3681caa64441d53a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 99757c2d975d224ea191622116e6eb839fff70c1)
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit a1fdcc4f440601272c2e30e92843a60a3850bd6b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR
Katrin Fischer [Mon, 6 Jun 2022 21:34:26 +0000 (21:34 +0000)]
Bug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR

In input fields we always use the decimal . while the display format
uses the decimal separtor definded by CurrencyFormat. When adding a
manual invoice without this patch, the amount is shown with comma, but
it should be . in the input field.

To test:
1- Go in Administration->Debit types
2- Click on New debit type
3- Fill the form:
   Code: USEDBOOK
   Default amount: 0.50
   Description: Used book
   Can be manually invoiced: Yes
4- Save
5- Go to any patron account
6- Go to the "Accounting" tab
7- Click on "Create manual invoice"
8- Fill the form
9- Choose the created debit (Used book)
10- Verify that the format is incorrect (0,50 instead of 0.50)
11- Apply the patch
12- Verify the amount is now using the correct format

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 c54e1de8b2beec131f51fdfe866fd27ee8bc0759)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 533a858684d8e5cf69caea560b64aefebc88b626)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 8a5ab91aed151fe2f0473fd5920e1297b3035ccb)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 30914: (24153 follow-up) Fix cleanup_database.pl --transfers --old-reserves
Jonathan Druart [Tue, 7 Jun 2022 12:11:06 +0000 (14:11 +0200)]
Bug 30914: (24153 follow-up) Fix cleanup_database.pl --transfers --old-reserves

Silly mistake, 'delete if verbose' must be 'delete if confirm'

Test plan:
Try the cleanup_database.pl script to delete transfers and old issues.
Using --transfers --old-reserves and the --confirm flag the entries must be
removed

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a6166405c7d7886466a8d1264c98970b4973f77f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b503c186e4ca8012b24441e746045c7439c44b97)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 144372e72ed59f9ded5db00b9f4f9e38bfa0ada9)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 29958: Do not set dateaccessioned on updates
Martin Renvoize [Fri, 24 Jun 2022 14:39:07 +0000 (15:39 +0100)]
Bug 29958: Do not set dateaccessioned on updates

This patch reomves the second occurence of setting daeaccessioned today,
outside of the 'add/update' handling in Koha::Item->store.

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 1f5fbcf73626139bcc01aca73b912fa29ff51f7d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e0fcd54a6edd728ab67924d5ab3ef3df8d4e52dd)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 898adc6ff6ef8e6c16e279508a9d073d2547084b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 29958: Regression tests
Tomas Cohen Arazi [Tue, 5 Jul 2022 12:14:16 +0000 (09:14 -0300)]
Bug 29958: Regression tests

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 91c4d411157a22bbeb58b43b878705f44c71f1f3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 35643f28f91428ca0fa6c1c8c4f5d6b8ba40d13a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 30848: [21.05.x] Export C4::Biblio::GetMarcSubfieldStructure()
Victor Grousset/tuxayo [Mon, 15 Aug 2022 20:46:57 +0000 (22:46 +0200)]
Bug 30848: [21.05.x] Export C4::Biblio::GetMarcSubfieldStructure()

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 30848: Add exec flag to test
Nick Clemens [Fri, 17 Jun 2022 13:09:02 +0000 (13:09 +0000)]
Bug 30848: Add exec flag to test

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4edaa27fc2a7a487a9558dc66acce9b636fa06b3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit b10ac8189facd7b6e36f986dd392730a27b7ccbd)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 30848: Fix issue exposed by unit tests
Martin Renvoize [Mon, 13 Jun 2022 13:26:33 +0000 (14:26 +0100)]
Bug 30848: Fix issue exposed by unit tests

This patch changes the 'map' to a simple for loop so that we can easily
map multiple subfields to a field without overwriting the first previous
subfields in the structure.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 965e9856196a30520ffaea7cc99f7724f7b123d3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 4541f43789495b0163fd5125620e0b25991ffede)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 30848: Expand unit tests
Martin Renvoize [Mon, 13 Jun 2022 13:25:30 +0000 (14:25 +0100)]
Bug 30848: Expand unit tests

Add to the unit tests to test Library and Itemtype expansions as well as
linking multiple subfields of the same marc field to such expansions.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 66999034d4ce274dec14340c1494dc280292984a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 8987b899709e5a8329f0f71b46aae476de83358b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 30848: Add an ExpandCodedFields RecordProcessor filter
Martin Renvoize [Thu, 26 May 2022 09:24:50 +0000 (10:24 +0100)]
Bug 30848: Add an ExpandCodedFields RecordProcessor filter

This patch introduces a RecordProcessor filter for MARC::Record objects
that replaces Koha codes with descriptions in the MARC::Record passed to the processor.

Target usage:

  my $biblio = Koha::Biblios->find(
      $biblio_id,
      { prefetch => [ metadata ] }
  );

  my $record = $biblio->metadata->record;

  my $processor = Koha::RecordProcessor->new(
    {
        filters => ('ExpandCodedFields'),
        options => {
            interface     => 'opac',
            frameworkcode => $biblio->frameworkcode
        }
    }
  );

  $processor->process( $record );

Test plan
* Read the included unit test and confirm it makes sense and passes

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0a861042947adbc12b4d865c89c6a87effe965b9)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 52dd29792ef8c746827e6071cd85e46a5dcbc8c1)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t
Mason James [Wed, 6 Jul 2022 10:54:55 +0000 (22:54 +1200)]
Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t

to test...

1/ run prove, test is not run :(
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 0

2/ apply patch

3/ run prove, test is run :)
 prove ./t | grep 00-check-atomic-updates.t | wc -l
 2

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 8884068904b77ecb8dff7875a056129443b08e6b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit fea07bfab8d4a58bc07929585939a9472c384a59)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 1df5e78deb59d1ae87d315389c84a77ef9409194)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
22 months agoBug 30958: OPAC overdrive search result page broken for translations
Alex Buckley [Mon, 13 Jun 2022 22:54:54 +0000 (22:54 +0000)]
Bug 30958: OPAC overdrive search result page broken for translations

Note: You will need a valid OverDrive subscription to test this.

This patch fixes a JavaScript error thrown on the OPAC overdrive search
results page for libraries using translation templates and who don't
have the OverDrivePasswordRequired system preference = 'Required'.

Test plan:
1. Install the en-NZ translation: https://wiki.koha-community.org/wiki/Installation_of_additional_languages_for_OPAC_and_INTRANET_staff_client

2. Enable the en-NZ language:
   - In the OPACLanguages system preference -> tick 'English New Zealand
     (en-NZ)' checkbox and untick 'English (en)'

3. Fill in the OverDrive system preferences:
   - Make sure you set: OverDrivePasswordRequired = "Not required"

4. Perform an OPAC search

5. Click on the Overdrive results link

6. Open the browser console and notice there is a JS error, and the
   OverDrive results do not load

7. Apply patch

8. Update the en_NZ translation:

9. Repeat steps 4, 5 and 6 and notice there is no JavaScript error and
   the OverDrive results do display

Sponsored-by: Melbourne Athenaeum Library, Australia
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ade61b5e0c185fd7263ab6f101b1a4082d0ea0dd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3f5c43cf2636e3e59d58b6ea739491dea192a51d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 6fb34f0d66d6b0882225c5edf099cdf79cdcc617)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoUpdate release notes for 21.05.17 release v21.05.17
Victor Grousset/tuxayo [Tue, 26 Jul 2022 01:46:14 +0000 (03:46 +0200)]
Update release notes for 21.05.17 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoIncrement version for 21.05.17 release
Victor Grousset/tuxayo [Tue, 26 Jul 2022 00:24:02 +0000 (02:24 +0200)]
Increment version for 21.05.17 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoFix translations for Koha 21.05.17
Victor Grousset/tuxayo [Mon, 25 Jul 2022 23:50:33 +0000 (01:50 +0200)]
Fix translations for Koha 21.05.17

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoTranslation updates for Koha 21.05.17
Koha translators [Mon, 25 Jul 2022 10:56:42 +0000 (07:56 -0300)]
Translation updates for Koha 21.05.17

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 30969: Cross site scripting (XSS) attack in OPAC authority search ( opac-authorit...
Kyle Hall [Wed, 15 Jun 2022 16:06:55 +0000 (12:06 -0400)]
Bug 30969: Cross site scripting (XSS) attack in OPAC authority search ( opac-authorities-home.pl )

There appears to be a cross site scripting attack vulnerability in opac-authorities-home.pl, but may be accessible from any page using C4::Output::pagination_bar.

https://MYKOHA.LOCAL/cgi-bin/koha/opac-authorities-home.pl?and_or=and%27%22()%26%25%3Csad%3E%3CScRiPt%20%3Ealert(document.domain)%3C/ScRiPt%3E&authtypecode=CORPO_NAME&excluding=1&marclist=all&op=do_search&operator=contains&orderby=HeadingAsc&type=opac&value=1

Test Plan:
1) Use the URL above to show the XSS vulnerability exists
2) Apply this patch
3) Restart all the things!
4) Reload the page, no XSS vulnerability!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 29504: (follow-up) Account for other blockers
Martin Renvoize [Wed, 15 Dec 2021 09:20:52 +0000 (09:20 +0000)]
Bug 29504: (follow-up) Account for other blockers

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 7a7716b6d8039476a6cc2d6403092cc2df42458e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3eceb3d5fe9c8c5ae6ce04720364acd21be0a7e6)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 96a6472747ae77e5415fddb9824b003ce3998494)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 29504: Allow 'ADDITIONAL_MATERIALS' check to be confirmed
Martin Renvoize [Mon, 22 Nov 2021 11:33:25 +0000 (11:33 +0000)]
Bug 29504: Allow 'ADDITIONAL_MATERIALS' check to be confirmed

The additional materials check when CircConfirmParts is enabled was
errantly relying upon the 'FORCE_CHECKOUT' permission.  This patch
updates the template to allow confirmation as well as cancellation of
chekout.

Test plan
1. Set a staff member with circ permissions, but not FORCE_CHECKOUT
2. Turn on CircConfirmItemParts
3. Log in as staff member in step 1
4. Attempt to checkout an item with a 952$3
5. The only option given is the Continue button (with a red X) and when
   clicked, the item does not get checked out.
6. Apply patch
7. Repeat step 4.
8. You should now have the option to 'Yes, check out (Y)' or
   'No, don't check out (N)'

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 49ef741405d0b81ba0cb37dd81fa9a4b5aba5bbb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 39f89b43fd0a1083b85b4902b4338aee04224a44)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit cf1afb56857b2a7faffd2f8dfd5accb2ed845f95)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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>
(cherry picked from commit 73604cdbcc1e777d39c85fc9337246d6b4821b28)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 2ef2b2d3b26626a5d61dd60b1ddac1ed448c6c51)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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>
(cherry picked from commit eae8863fcb37b86a32425525c43d53304423f9cd)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit e82827673a6c1133e2bd0dbf79f48a1a2f69eec8)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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>
(cherry picked from commit a2d22ee029291dd17ab0a6f03355943ef08d8d93)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit c914420371226df591e5d3516c5d1f09f434f8eb)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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>
(cherry picked from commit 2dbf1bf80f35655b1d9474b9f3dac398082d96ab)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit e15a421dae2b265072940278b244992425e3017b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 30551: Make cash register report take branchcode from cash register
Shi Yao Wang [Fri, 15 Apr 2022 16:37:34 +0000 (12:37 -0400)]
Bug 30551: Make cash register report take branchcode from cash register

This patch makes it so cash register reports puts branchcode from the
cash register where the payment was made into "Transaction library"
column instead of taking the branchcode of the manager.

Test plan:
1- Use cash registers (administration > system preferences > UseCashRegisters)
2- Create another library if you only have one (administration > libraries > new library)
3- Create a cash register in each library if they don't already have one (administration > cash registers > new cash register)
4- Create a fee on your own account and pay it right after in both libraries.
5- Go to reports > cash register and generate the statistics.
6- Notice "transaction library" in both rows are the same even though the fees were paid in two different libraries and two different cash registers.
7- Apply the patch and click submit to re-generate statistics
8- Notice it now shows the correct library where the transactions were done

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43299fe5cc1c8110112a76ba88e9ab03aaeda43c)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit bb8602c19045c40c283fdff07fae5ee4edcfc5bf)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 29418: (follow-up) Fix links generated in XSLTs
Tomas Cohen Arazi [Tue, 5 Jul 2022 00:09:05 +0000 (21:09 -0300)]
Bug 29418: (follow-up) Fix links generated in XSLTs

This patch addresses the case of links that are generated on the XSLT
side, those linking to host records using 773$t and 773$a.

To test:
1. Repeat the test plan from the other patches
2. When sitting on the detail view of the host record, click on the link
   to open the child.
=> SUCCESS: The link works, because of the previous patches
3. Click on the 'In:' link so the search takes you to the host record
=> FAIL: The link leads no results
4. Apply this patch
5. Restart all
6. Reload the child record page and click on the link
=> SUCCESS: Voila! The host record is retrieved!
7. Bonus points: Retry the full test plan, but add a " or ? to the
   author in both host and child records
=> SUCCESS: Things don't work before this patch, and work afterwards.
8. Sign off :-D

Sponsored-by: Theke Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 29418: Make detail rendering use the cleaned-up title for searching
Tomas Cohen Arazi [Fri, 1 Jul 2022 14:54:34 +0000 (11:54 -0300)]
Bug 29418: Make detail rendering use the cleaned-up title for searching

This patch makes both staff and OPAC detail pages generate a valid
search link so you can trace related records in the Show analytics
link.

To test:
1. Pick a bibliographic record (I chose 'Unconditional' from the sample
   data
2. Add " and ? to the title statement. I changed it to
   'Uncond"itional?¿'
3. Add a child record to it
4. Open the detail page for the host record
=> FAIL: It doesn't show the 'Show analytics' link
5. Repeat 4 for the same record, in the OPAC
=> FAIL: It doesn't show the 'Show analytics' link
6. Apply this patch
7. Repeat 4 and 5.
=> SUCCESS: Links are shown!
8. Follow the links
=> SUCCESS: The links take you to the right resultset!
9. 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: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 29418: Make clean_search_term escape double quotes
Tomas Cohen Arazi [Mon, 4 Jul 2022 18:19:27 +0000 (15:19 -0300)]
Bug 29418: Make clean_search_term escape double quotes

We noticed that several characters will break Zebra queries. So search
terms need to be quoted for things to work. In this context, double
quotes inside search terms are problematic because double quotes are
what we use for quoting strings.

This patch makes the clean_search_term method escape double quotes.

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/Koha/SearchEngine/Zebra/QueryBuilder.t
=> FAIL: It doesn't work as it should!
3. Apply this patch
4. Repeat 2
=> SUCCESS: It does the job!
5. 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: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoBug 29418: Unit tests
Tomas Cohen Arazi [Mon, 4 Jul 2022 18:18:44 +0000 (15:18 -0300)]
Bug 29418: Unit tests

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: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoRevert "Bug 30035: Fix month name in prediction pattern"
Victor Grousset/tuxayo [Wed, 13 Jul 2022 22:04:58 +0000 (00:04 +0200)]
Revert "Bug 30035: Fix month name in prediction pattern"

This reverts commit c9253082bbbe3bc2529188b0e908053d72b77eff.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
23 months agoRevert "Bug 30035: Fix failing test"
Victor Grousset/tuxayo [Wed, 13 Jul 2022 22:04:54 +0000 (00:04 +0200)]
Revert "Bug 30035: Fix failing test"

This reverts commit 5b38309599018a84e1c5a4e0566ea6d1ce9f87de.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoUpdate release notes for 21.05.16 release v21.05.16
Victor Grousset/tuxayo [Mon, 27 Jun 2022 23:36:37 +0000 (01:36 +0200)]
Update release notes for 21.05.16 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoIncrement version for 21.05.16 release
Victor Grousset/tuxayo [Mon, 27 Jun 2022 14:50:30 +0000 (16:50 +0200)]
Increment version for 21.05.16 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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>
(cherry picked from commit a0f14c6ab69c3104447c1957b21ba6c121a66cec)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 9e0685881cedaf15388f4292ea79dc88044efbd6)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoFix translations for Koha 21.05.16
Victor Grousset/tuxayo [Mon, 27 Jun 2022 14:45:15 +0000 (16:45 +0200)]
Fix translations for Koha 21.05.16

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoTranslation updates for Koha 21.05.16
Koha translators [Mon, 27 Jun 2022 12:30:06 +0000 (09:30 -0300)]
Translation updates for Koha 21.05.16

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years 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>
(cherry picked from commit 0783b96359e392b95538a7aca78f263ae178e1ca)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 994868be66f808d6d98ffdce3e46e233fd751712)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years 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>
(cherry picked from commit 3b3b7f0ad9b46f3c17ebc8f0fda7e05184fa5547)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 9068cc1c4227646011974ffe20a6f11115ed2d3e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30354: Don't assign warn as letter
Nick Clemens [Thu, 24 Mar 2022 15:31:05 +0000 (15:31 +0000)]
Bug 30354: Don't assign warn as letter

TO test:
1 - Check out an item marked for autop renewal to a patron and make it overdue
2 - Set system preference AutoRenewalNotices to follow messaging prefs
3 - set that borrower to receive both email and SMS AUTO_RENEWALS_DGST
4 - confirm your AUTO_RENEWALS_DGST does not have SMS content but does have email
5 - run the auto_renew cron
6 - item is renewed, but error from cron, and cron dies:

No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583.
no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/automatic_renewals.pl line 305.
Can't use string ("1") as a HASH ref while "strict refs" in use at /kohadevbox/koha/C4/Letters.pm line 898.

7 - Apply patch
8 - Make item eligible for auto renewal agian (or checkin/checkout)
9 - Run the cron
10 - There is still 2 warn, but cron does not die:

No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583.
no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/    automatic_renewals.pl line 305.

11 - Patron receives email and item is renewed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b4685ca2054d7b5484f09c4c879fb36919443a13)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30663: Implement overrides handling in POST /suggestions
Tomas Cohen Arazi [Tue, 3 May 2022 14:23:23 +0000 (11:23 -0300)]
Bug 30663: Implement overrides handling in POST /suggestions

This patch implements the override checks in the controller as expected
by the previous patch.

To test:
1. Apply this bug patches up to 'Add x-koha-override options...'
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/suggestions.t
=> FAIL: Tests fail! The controller doesn't care about overrides or
         sysprefs about suggestions limits.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Things work!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ce9664e1b01e9f3dc807855d76927b9184453aee)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30663: Add x-koha-override options to /suggestions
Tomas Cohen Arazi [Tue, 3 May 2022 14:20:46 +0000 (11:20 -0300)]
Bug 30663: Add x-koha-override options to /suggestions

This patch adds the x-koha-override header parameter to the route that
is used to create suggestions, POST /suggestions.

The idea is that adding suggestions will be rejected under certain
conditions unless x-koha-override is passed with appropriate values. The
added overrides are:

* any
* max_total
* max_pending

Tests are added for the expected behavior.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 25317416e62a267a4f4b06cf35f37ad38e04b40a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30663: Add Koha::Suggestions helper methods
Tomas Cohen Arazi [Tue, 3 May 2022 14:18:10 +0000 (11:18 -0300)]
Bug 30663: Add Koha::Suggestions helper methods

This patch adds the following helper methods:

* filter_by_pending
* filter_by_suggested_days_range

This methods follow basically what's done in opac-suggestions.pl
I chose 'pending' as opposed to 'open' to follow what we use in the UI
which might be the case because of being more accurate for end users.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 54dbb852486b004a73dc6aabae6dda4fcecb2573)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30628: Fix patron selection in batch patron modification tool
Jonathan Druart [Thu, 28 Apr 2022 08:32:28 +0000 (10:32 +0200)]
Bug 30628: Fix patron selection in batch patron modification tool

bug 28014 added Datatables to this view, but the form is submitted with
only the checkboxes from the first page.

Solution adapted from https://stackoverflow.com/questions/33240409/how-to-submit-checkboxes-from-all-pages-with-jquery-datatables

Test plan:
Have more than 20 cardnumbers, use the batch patron modification tool
Select (not all) patrons from the first page and second page
Submit the form
Notice that the patrons you have selected appear on the confirmation
page.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7e053bf5462494cf91f2f2be745416d2d7ad261b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30610: Update on click binding for print receipt
Martin Renvoize [Mon, 25 Apr 2022 14:37:33 +0000 (15:37 +0100)]
Bug 30610: Update on click binding for print receipt

This patch updates the binding for the on click even of the print
receipt button so that subsequent pages in the datatable work with the
reciept printing button.

Test plan
1) Enable cash management and process enough transactions to display
   more than one page of transactions in the register details page.
2) Confirm the 'Print receipt' button works on the first page of
   transactions
3) Confirm the 'Print receipt' button works on subsequent transactions
   pages in the datatable.
4) Confirm the same for the past transactions table.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 126c70c982089c74c75d1c99d33c01c9cc4cf001)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 30630: Prevent crash on check-in if HoldsAutoFill is ON
Jonathan Druart [Thu, 28 Apr 2022 07:43:06 +0000 (09:43 +0200)]
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON

RevertWaitingStatus has already removed the itemnumber from the hold, passing $itemnumber (from scanned item) should work, as it will reattach the hold to the item

Test plan:
1 - Enable HoldsAutoFill
2 - Place a title level hold
3 - Check in an item and confirm hold
4 - Switch to another branch
5 - Checkin the item
Without this patch you got
Can't call method "biblionumber" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1577.
 at /kohadevbox/koha/C4/Reserves.pm line 1576
With this patch applied the operation succeeds

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 73a2e3558944effbdb4a19e6c8a331679d41fcf8)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug ?????: Compiled SCSS due to compiler change or previous oversight
Victor Grousset/tuxayo [Fri, 17 Jun 2022 03:27:44 +0000 (05:27 +0200)]
Bug ?????: Compiled SCSS due to compiler change or previous oversight

Either it has been forgotten in a previous release or it's the compiler
version difference between me and the previous RMaint

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 24001: (follow-up) Fix t_Profile.t
Fridolin Somers [Fri, 29 Apr 2022 06:24:45 +0000 (20:24 -1000)]
Bug 24001: (follow-up) Fix t_Profile.t

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 333b698d6264859d6cae3ab112cca6c4ce52c623)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 24001: Fix Card template/rpinter profile creation and edit
Nick Clemens [Fri, 4 Mar 2022 16:19:35 +0000 (16:19 +0000)]
Bug 24001: Fix Card template/rpinter profile creation and edit

This patch adjusts the template/profiles to use the default of '0'
This should probably be NULL, and the columns foreign keys, this code
could use a further rewrite, but this should fix a long standing bug

To test:
 1 - Using the fresh install, with all the sample data.
 2 - Go to Home â€º Tools â€º Patron card creator â€º Templates
 3 - New > Card template
 4 - Save
 5 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'profile_id' at row 1
 6 - Edit an existing template
 7 - Save
 8 - Error: Can't bless non-reference value at /kohadevbox/koha/C4/Creators/Profile.pm line 89
 9 - Create a new 'Printer profile'
10 - Save
11 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'template_id' at row 1
12 - Apply the attached patch.
13 - Verify you can create a new 'Card template' and 'Printer profile' with no errors
14 - Verify you can edit and save both of the newly created objects above

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.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 65c784d3fd9b745613c35c84bef10422a7170043)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoBug 24001: Fix patron card template edition
Blou [Tue, 30 Jun 2020 16:50:09 +0000 (12:50 -0400)]
Bug 24001: Fix patron card template edition

Error when saving Patron card Template:
Can't bless non-reference value at
/home/vagrant/kohaclone/C4/Creators/Profile.pm line 89

This is caused by the profile dropdown offering invalid choices and is
fixed by adding a filter to limit options to creator = 'Patroncards'.
The UI already handles the case where no valid profile is avaiable.

Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>
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.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8be82f861621cdf86bcd4b683254365542897ed4)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2 years agoUpdate release notes for 21.05.15 release v21.05.15
Andrew Fuerste-Henry [Sun, 29 May 2022 16:27:06 +0000 (16:27 +0000)]
Update release notes for 21.05.15 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoIncrement version number for 21.05.15 release
Andrew Fuerste-Henry [Sun, 29 May 2022 16:20:30 +0000 (16:20 +0000)]
Increment version number for 21.05.15 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoFix translations for Koha 21.05.15
Andrew Fuerste-Henry [Sun, 29 May 2022 16:17:53 +0000 (16:17 +0000)]
Fix translations for Koha 21.05.15

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoTranslation fixes for 21.05.15
Andrew Fuerste-Henry [Sun, 29 May 2022 16:16:59 +0000 (16:16 +0000)]
Translation fixes for 21.05.15

2 years agoTranslation updates for Koha 21.05.15
Koha translators [Sun, 29 May 2022 16:02:08 +0000 (13:02 -0300)]
Translation updates for Koha 21.05.15

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29374: Don't crash if search engine returns a deleted record
Jonathan Druart [Fri, 29 Oct 2021 10:27:25 +0000 (12:27 +0200)]
Bug 29374: Don't crash if search engine returns a deleted record

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 20991feb62daedf5827b29e986002a34b0d41cce)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30212: Make Select2 available for ILL backends
Tomas Cohen Arazi [Wed, 2 Mar 2022 11:19:55 +0000 (08:19 -0300)]
Bug 30212: Make Select2 available for ILL backends

This patch makes select2 available for ILL backend developers to use on
their templates.

To test:
1. Have a configured backed and an ILL request
2. Open the inspector and load any action on the backend (intranet)
=> FAIL: no select2 asset is transfered from Koha to the browser
3. Apply this patch
4. Reload
=> SUCCESS: There's select2
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c864cc73e58daa37bbfc71a5629ece7625579fbe)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30199: Do not generate jwt if patron does not exist
Jonathan Druart [Fri, 18 Mar 2022 09:26:48 +0000 (10:26 +0100)]
Bug 30199: Do not generate jwt if patron does not exist

This is a follow-up patch for bug 29543. If an invalid cardnumber has
been used we should not generate a token.

Test Plan:
1. Set SelfCheckoutByLogin to 'cardnumber'.
2. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
3. Enter an invalid carnumber like 'thisisabadcardnumber'
4. See the appropriate message "Sorry The userid thisisabadcardnumber was not found in the database. Please try again."
5. Try again with a different cardnumber and notice the same exact error message including the 'thisisabadcardnumber' cardnumber.
6. Apply this patch
7. Restart all the things!
8. Repeat steps 2-4
9. Try again with a different cardnumber, you should now see the correct
   cardnumber!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e5aeb047a563b20769d49c2777d47039581ca7bd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30595: Prevent update_child_to_adult.t to fail randomly
Jonathan Druart [Fri, 22 Apr 2022 09:42:09 +0000 (11:42 +0200)]
Bug 30595: Prevent update_child_to_adult.t to fail randomly

t/db_dependent/selenium/update_child_to_adult.t ..         # Looks like you planned 3 tests but ran 2.

    #   Failed test 'Update child to adult'
    #   at t/db_dependent/selenium/update_child_to_adult.t line 132.
    # Looks like you planned 3 tests but ran 2.
    # Looks like you failed 1 test of 2 run.
t/db_dependent/selenium/update_child_to_adult.t .. 1/1
 #   Failed test 'Update child to patron'
 #   at t/db_dependent/selenium/update_child_to_adult.t line 153.
Cannot wait more for element '//input[@type="submit"]' to be visible at /kohadevbox/koha/t/lib/Selenium.pm line 189.

It happens when there are too many patron's categories and the submit
button is not in the viewport.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit faa35972b038b9df0459a582ced73e98adb897cc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30346: Correctly transfer values when editing rules
Lucas Gass [Mon, 11 Apr 2022 19:35:14 +0000 (19:35 +0000)]
Bug 30346: Correctly transfer values when editing rules

To test:
--Create a circulation rule with a value in "Overdue fines cap (amount), or edit an existing rule to add it
-Save the new (or edited) rule.
-Edit the same rule again to change any other field. Note that "Overdue fines cap (amount)" is now blank
-Save your edited rule - "Overdue fines cap (amount)" will save as blank.

Apply patch

--Create a circ rule with a value in Overdue fines cap (amount) and check "Cap fine at replacement price" for that same rule.
-Save the rule
-Try ediding the rule and make sure both of those values now save correctly.
-Add several more rules and try playing with both "Cap fine at replacement price" and "Overdue fines cap (amount)". Make sure everything saves right.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f69e3b364f13cb6dbcf9aa12d3d21fea8c1f3798)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30540: Fix perl critic complaint of leading zeros
Nick Clemens [Thu, 14 Apr 2022 10:51:18 +0000 (10:51 +0000)]
Bug 30540: Fix perl critic complaint of leading zeros

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8cc4961143756681ec1b9e1639bad6bb5198b7cf)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30540: eval on set_time_zone
Martin Renvoize [Thu, 14 Apr 2022 08:14:47 +0000 (09:14 +0100)]
Bug 30540: eval on set_time_zone

This patch adds an eval around the call to set_time_zone so that we
don't crash on invalid local dates and instead just keep the passed
floating timezone.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6dab34fe66d41b367141f8e1b96abfe1729d045b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30540: Unit test
Martin Renvoize [Thu, 14 Apr 2022 09:19:47 +0000 (10:19 +0100)]
Bug 30540: Unit test

This patch adds tests for checking the output_pref method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/DateUtils.t
=> FAIL: The feature is not implemented, tests fail to complete

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 052dd948af6eaaaeeb0e83a6950543b4832aeefe)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30518: Correct DateTime maths for needs_advancing
Martin Renvoize [Wed, 13 Apr 2022 07:24:22 +0000 (08:24 +0100)]
Bug 30518: Correct DateTime maths for needs_advancing

The needs_advancing method prior to this patch used basic DateTime
arithmatic, adding a DateTime::Duration in Days to the Arrival date of
the item and then comparing that to today. This, however, can cause bugs
when the arrival + duration date coincides with a DST boundary and as
such may result in an invalid local date.  See
https://metacpan.org/pod/DateTime#Making-Things-Simple for further
details.

This patch updates the code to use the DST safe delta_days method to
count the days between arrival and now instead and then compares this
integer to the defined duration of the stage.

To test:
1. Re-run the unit tests, they should now pass.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3929335cdbea81c7c891a8a979d69861468502fd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30518: Unit test
Martin Renvoize [Wed, 13 Apr 2022 07:52:02 +0000 (08:52 +0100)]
Bug 30518: Unit test

This patch adds tests for checking the needs_advancing method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/db_dependent/StockRotationItems.t
=> FAIL: The feature is not implemented, tests fail to complete

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4450ad21100a02055e3f0f05918b2d4b17852107)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoUpdate release notes for 21.05.14 release v21.05.14
Andrew Fuerste-Henry [Tue, 26 Apr 2022 13:05:42 +0000 (13:05 +0000)]
Update release notes for 21.05.14 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoIncrement version for 21.05.14 release
Andrew Fuerste-Henry [Tue, 26 Apr 2022 12:39:40 +0000 (12:39 +0000)]
Increment version for 21.05.14 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoTranslation fixes for 21.05.14
Andrew Fuerste-Henry [Tue, 26 Apr 2022 12:36:58 +0000 (12:36 +0000)]
Translation fixes for 21.05.14

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoTranslation updates for Koha 21.05.14
Koha translators [Tue, 26 Apr 2022 12:09:36 +0000 (09:09 -0300)]
Translation updates for Koha 21.05.14

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30142: Remove spaces from ElasticSearch mapping MARC fields
Thomas Klausner [Mon, 21 Feb 2022 11:35:15 +0000 (12:35 +0100)]
Bug 30142: Remove spaces from ElasticSearch mapping MARC fields

A first step to "validate" the MARC mappings: Remove all whitespace, so
if a user enters "245a " (with a trailing whitespace, which can easily
happen when copy/pasting) we only store "245a" in the DB. This is
neccessary, because the ES indexer will throw an exception in an invalid
MARC mapping.

Test Plan:
* Go to /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
* Go to the Bibliographic Records Tab
* Enter "100 a b c " (notice the whitespaces!) in the first "mapping"
  field
* Scroll down and save
* Go back to the Bibliographic Records Tab
* The spaces are still there

Now apply the patch

* Repeat the above steps
* After saving you should see "100abc" without any spaces in the
  "mapping" field

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0dbb236d891b69f09ab06a62e2679755ea36621c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30406: Add column filters before hiding columns
Julian Maurice [Fri, 1 Apr 2022 08:16:09 +0000 (10:16 +0200)]
Bug 30406: Add column filters before hiding columns

The code that adds column filters works only on visible columns, so we
should hide columns after filters are created

Test plan:
1. Apply patch
2. Go to Tables settings. Hide city_state for the cities table.
3. Create some cities and go to the cities page
4. Verify that filtering works as expected.
5. Make the city_state column appear. Verify that filtering on this
   column works too

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 37594d77377dc4b0784d497d70aee05977277dee)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 19169: Add a test to detect unneeded 'atomicupdate' files
Mason James [Sat, 5 Mar 2022 02:30:21 +0000 (15:30 +1300)]
Bug 19169: Add a test to detect unneeded 'atomicupdate' files

to test...

1/ set git repo
    $ git reset --hard v21.11.03

2/ run test
    $ prove ./t
    OK

3/ apply patch

4/ run test again, observe FAIL

    $ prove ./t/00-check-atomic-updates.pl
    ./t/00-check-atomic-updates.pl .. 1/?
    #   Failed test 'check for unhandled atomic updates: bug_29596.pl'
    #   at ./t/00-check-atomic-updates.pl line 34.
    #                   'bug_29596.pl'
    #           matches '(?^u:.*pl$)'
    # Looks like you failed 1 test of 3.
    ./t/00-check-atomic-updates.pl .. Dubious, test returned 1 (wstat 256, 0x100)
    Failed 1/3 subtests

JD Amended patch: fix copyright year
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1d24015e46c3127497aac31b2baddad547e4e8b3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29771: Scalar context for split
Tomas Cohen Arazi [Thu, 23 Dec 2021 19:58:57 +0000 (16:58 -0300)]
Bug 29771: Scalar context for split

This patch tackles a very specific scenario. Calling split(...,
CGI::param) makes it be called in list context. The split docs say:

split /PATTERN/,EXPR,LIMIT

this means the first CGI param will be used as EXPR and the second one
as LIMIT, which is wrong anyway. So the fix is to just force scalar
context.

To test:
1. Not sure, just make sure nothing breaks when using the scripts in the
   browser.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e5dc760b92bd939245c3d24a0cfa3db99f9ac764)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29771: Remove trivial cases
Tomas Cohen Arazi [Thu, 23 Dec 2021 19:16:58 +0000 (16:16 -0300)]
Bug 29771: Remove trivial cases

I squashed the patches because they are too trivial to have a test plan.
Or it is too much work to write the test plan for such trivial cases. I
leave the original commit messages just in case.

Generally, this are all cases in which CGI::param is being called in a
trivially identifiable _list context_. i.e. they are assigned to a
@variable.

I left one case out on purpose: admin/auth_subfields_structure.pl

Paul introduced this:

my @kohafield = ''.$input->param('kohafield');
and then:
my $kohafield = $kohafield[$i];

My intuition says it is forcing scalar context on the first assignment
so the list contains a single element and then inside the loop some
$kohafield assignments should lead to undef, and even warnings. I leave
it for a separate patch because it is not that easy testable and is a
sensible area.

Bug 29771: Remove warning from  acqui/finishreceive.pl

This patch removes a warning that shows when receiving.

To test:
1. Do the acq workflow up to the receive step.
2. Once you choose the items and click on Finish
=> FAIL: There's a warning in the logs
3. Revert receipt
4. Apply this patch
5. Receive
=> SUCCESS: No more warnings
6. Sign off :-D

Bug 29771: Remove warning from svc/members/add_to_list

To test:
1. Run:
   $ tail -f /var/log/koha/kohadev/*-error.log
2. Generate a patron list
3. Perform a patron search that gives you a few
4. Select some, and choose to add them to the list
=> FAIL: The logs show the infamous warn:
CGI::param called in list context from /kohadevbox/koha/svc/members/add_to_list
5. Apply this patch
6. Restart plack and repeat 4
=> SUCCESS: No warn!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1cfa7e38458b0e644ba7a34ae81520987071eca1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30583: Fix hold system for translated templates
Jonathan Druart [Thu, 21 Apr 2022 14:30:24 +0000 (16:30 +0200)]
Bug 30583: Fix hold system for translated templates

There are missing quotes, and the translate script is messing up with
the generated template.

Error is:
Template process failed: file error - parse error - holds_table.inc line 216-217: unexpected token (hold)

The generated line, without this patch is:
216 <td><input %]="%]" class="printholdslip" data-reserve_id="[%" hold.reserve_id="hold.reserve_id" html="html" name="printholdslip" type="button" value="Recibo" |="|"></td>
With this patch applied:
216  <td><input class="printholdslip" data-reserve_id="[% hold.reserve_id | html %]" name="printholdslip" type="button" value="Recibo"></td>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30118: (QA follow-up) Fix Perl Critic issues
Kyle M Hall [Wed, 30 Mar 2022 16:34:55 +0000 (16:34 +0000)]
Bug 30118: (QA follow-up) Fix Perl Critic issues

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 61468ffe6d201cdb1257923d9fed575ffb5911cb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30118: Make holds_block_checkin in SIP behave like in Koha interface.
Matthias Meusburger [Wed, 17 Mar 2021 13:14:25 +0000 (14:14 +0100)]
Bug 30118: Make holds_block_checkin in SIP behave like in Koha interface.

In koha interface, a warning is displayed when an item on hold is returned
only if the return is for this specific item.

This patch does the same in SIP: the return is blocked when holds_block_checkin
is enabled and there is a hold on a specific item and this is the very item
being returned.

Test plan:

The following behavior is expected in SIP:

 - An item is returned, and there is a reservation on record-level: block
 - An item is returned, and there is a reservation on this very item: block
 - An item is returned, and there is a reservation on another item: allow

Signed-off-by: Sonia <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 41abb100c3d3e5cf97473abf06337e49f9b44710)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30541 - Resolve return claim works but "hangs" if MarkLostItemsAsReturned is...
Kyle M Hall [Thu, 14 Apr 2022 10:50:20 +0000 (06:50 -0400)]
Bug 30541 - Resolve return claim works but "hangs" if MarkLostItemsAsReturned is set for return claims

Basically, if MarkLostItemsAsReturned is set for return claims, the code will crash while trying to pull the checkout so it can update the lost status of the item. This is because the code assumes there must be a checkout and never checks the old_checkouts table.

This bug appears to only exist in 21.05 at this time. It was fixed by a combination of bugs 29495 and 28588.

Test Plan:
1) Set MarkLostItemsAsReturned for return claims
2) Mark a checkout as claims returned
3) Verify the checkout is no longer on the patron record
4) Resolve the claim
5) Note the attempt "hangs" but refreshing the page shows it worked
6) Apply this patch, restart all the things!
7) Repeat steps 2-4
8) It works!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Christine Lee <chlee@pascolibraries.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30172: Enqueue the job even if rabbitmq is not reachable
Jonathan Druart [Thu, 24 Mar 2022 15:24:06 +0000 (16:24 +0100)]
Bug 30172: Enqueue the job even if rabbitmq is not reachable

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 ce24a745c30f807587857e2f9449176ad4f78291)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30172: Prevent race condition when enqueuing a new task
Jonathan Druart [Thu, 24 Feb 2022 09:41:16 +0000 (10:41 +0100)]
Bug 30172: Prevent race condition when enqueuing a new task

As we are sending the job to the rabbitmq before in the transaction, the
worker can receive the job to process before the transaction committed.

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 40a329474486ffdef145466ddb66d65060d656ac)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29704: (RM follow-up) Fix typo sned send
Fridolin Somers [Tue, 18 Jan 2022 19:49:09 +0000 (09:49 -1000)]
Bug 29704: (RM follow-up) Fix typo sned send

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1b1612170918241acca97ac34c16965378b4bd32)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29704: Add a triggered option to holds_reminder.pl
Nick Clemens [Fri, 17 Dec 2021 15:49:17 +0000 (15:49 +0000)]
Bug 29704: Add a triggered option to holds_reminder.pl

This patch adds an option to only trigger notices matching the number of
days waiting specified

You will need to define HOLD_REMINDER notices for the specific branch of the
patron and ensure the patron has hold reminder notices in their messaging preferences

TO test:
1 - Place a hold for a patron and check in to confirm
2 - Set the waiting date back a few days:
    update reserves set waitingdate = DATE_SUB(CURDATE(), INTERVAL 5 DAY);
3 - Run the cron and see that patron would be notified if running for 4 days weaiting
    perl misc/cronjobs/holds/holds_reminder.pl -v --days 4
4 - Apply patch
5 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 4 --triggered
6 - Note patron would not be notified
7 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 5 --triggered
8 - Note patron is notified when days waiting matches exactly

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b392547ab6937abafcd2e964f9d7490f1426a51c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30222: Remove warning
Jonathan Druart [Fri, 25 Mar 2022 08:05:18 +0000 (09:05 +0100)]
Bug 30222: Remove warning

Use of uninitialized value in string ne at misc/cronjobs/automatic_renewals.pl line 193.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6f574f6747b03bdf4d48a0a134da38b4a0442fe7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30222: Further simplify logic
Nick Clemens [Tue, 15 Mar 2022 13:34:39 +0000 (13:34 +0000)]
Bug 30222: Further simplify logic

For any borrower, we are either:
1 - following their preference, and that should set 'wants_email'
OR
2 - Never sending / following the cron, and can determine 'wants_email'
    from the 'send_notices' variable

This patch adds an 'else' if not using preferences to accomplish this

Follow test plan on previous patches

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 92c8bc7e4b7d39b5a4deb21ff3bc4bc6cce28c40)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30222: Simplify logic for reporting
Nick Clemens [Fri, 11 Mar 2022 13:24:33 +0000 (13:24 +0000)]
Bug 30222: Simplify logic for reporting

This patch adds two new variables:
$wants_email and $wants digest

These are used to simplify checks on whether notices should be sent

To test:
1 - Apply patch
2 - Confirm notices are not sent of pref is 'cron' and send_notcies flag not set
3 - Confirm notices are sent if pref is cron and send_notices flag is set and borrower
    does not have preference set for auto renewals
4 - Confirm notices not sent if pref is set to follow messaging preference and borrower
    does not have preferences set for auto_renewals
5 - Confirm regular notices sent if pref is set to follow messaging preferences and borrower
    does have the preference set but not digest
6 - Confirm digest notices sent if pref is set to follow messaging preferences and borrower
    does have the preference set and wants digest

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 17f1793ba952e3a95f98ec777d56486611b7036d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30222: Only send auto renewal digest wehn there is an update
Nick Clemens [Fri, 11 Mar 2022 12:00:26 +0000 (12:00 +0000)]
Bug 30222: Only send auto renewal digest wehn there is an update

Currently, the code sends an email to the patron when there is any error that is not
'too_soon' - we also don't include issues that are 'too_soon', so emials may be missing information

This patch changes the code to:
1 - push all issues that were checked to the report when a borrower wants a digest
2 - adds a variable to track when any of the issues has been updated, and checkes this when
    sending digests
3 - if nothing has been updated, no report is sent to the patron

To test:
 1 - Checkout an item, marked for autorenewal, backdated to be overdue to a patron
 2 - Set preferences
    AutoRenewalNotices = 'according to patron messaging preferences'
    EnhancedMessagingPreferences = 'Allow'
 3 - Set the patrons preference for auto renewal to email+digest
 4 - Ensure the patron has an email
 5 - Place an item level hold for another patron on the issued item
 6 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
 7 - Check patron record/notices tab
 8 - Note item not renewed, patron notified
 9 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
10 - Note item not renewed, status not changed, patron notified again
11 - Apply patch
12 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
13 - Item not renewed, patron no notified
14 - Checkout another item marked for auto renewal to the patron, but due in the future
     ensure it is outside of 'no renewal before'
15 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
16 - Patron not notified, items not renewd
     Change to status of 'auto_too_soon' is not notified
17 - Checkout a third item, marked for auto renew, overdue
18 - place an item level hold for another patorn on third item
19 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
20 - patron is notified, nothing renewed, all statuses reported
21 - cancel the item level hold on third item
22 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
23 - item renewed, patron notified, all statuses reported
24 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
25 - nothing renewed, patron not notified, only change is one issue 'auto_too_soon'

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3fac0c7aee782f96867d2384422962b038c5f7aa)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 26328: Add test
Jonathan Druart [Mon, 21 Mar 2022 14:56:21 +0000 (15:56 +0100)]
Bug 26328: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 68664b7b706945ad0d9176be69dd5fe71a0bd13b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 26328: Cast barcode from varchar to integer for incremental barcode
David Cook [Fri, 4 Dec 2020 05:36:04 +0000 (05:36 +0000)]
Bug 26328: Cast barcode from varchar to integer for incremental barcode

Without this patch, the incremental barcode generation will
treat 978e0143019375 as having an exponent and interpret it as a very
large number.

With this patch, the incremental barcode generation will first cast
barcode varchar strings to integers before finding a max() value.
In this case 978e0143019375 becomes 978 instead of
1.7976931348623157e308

Test plan:

0. Using koha-testing-docker

Before applying patch:

1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=autobarcode
2. Set to "generated in the form 1, 2, 3"
3. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=1#additema&searchid=scs_1607059974968
4. Add item with barcode 978e0143019375
5. Click "p - Barcode"
6. Note the barcode is "Inf"

After applying patch:
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=1#additema&searchid=scs_1607059974968
2. Click "p - Barcode"
3. Note the barcode is "39999000019194"

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 445cbb373bc7756494a4b28cede53ec23942999e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29020: Add link on the admin module
Jonathan Druart [Fri, 8 Oct 2021 13:57:31 +0000 (15:57 +0200)]
Bug 29020: Add link on the admin module

It works! P1 and P2 are inverted in the test plan, but
the principle that user with manage permission accesses
bg jobs from the admin page and user who do not only
have access through main page is there.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ca55dc3e42c77f41f8c0cf66e6db9aeda4e66842)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29020: Add link on the mainpage for users without admin access
Jonathan Druart [Fri, 8 Oct 2021 13:53:02 +0000 (15:53 +0200)]
Bug 29020: Add link on the mainpage for users without admin access

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30220: Purchase suggestion defaults to first library
Owen Leonard [Thu, 3 Mar 2022 16:45:43 +0000 (16:45 +0000)]
Bug 30220: Purchase suggestion defaults to first library

This patch updates the OPAC suggestions form to update the variable
used to pre-select the logged-in user's library.

To test, apply the patch and make sure the "suggestion" preference is
set to "Allow."

- Log in to the OPAC and click "your purchase suggestions" in the
  sidebar menu on your summary page.
- Click "New purchase suggestion."
- The selected library should match the logged-in user's home library.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit caf905ca385b09b66c356fdd40315e1cdc8037e9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30035: Fix failing test
Jonathan Druart [Fri, 4 Mar 2022 07:47:15 +0000 (08:47 +0100)]
Bug 30035: Fix failing test

Looks like there was a change in the output for Spanish.
Can be 'ene.' in older versions

Sponsored-by: Orex Digital
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 156c151006eed9b1e4a35b2b07449187ea31005e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30035: Fix month name in prediction pattern
Jonathan Druart [Mon, 7 Feb 2022 08:26:12 +0000 (09:26 +0100)]
Bug 30035: Fix month name in prediction pattern

We are using %B to display the month name but it seems that using the
CLDR pattern LLLL would be more appropriated.
https://metacpan.org/pod/DateTime#CLDR-Patterns
%B   - The full month name.
LLLL - The wide stand-alone form for the month.

For instance in Catalan:
https://metacpan.org/pod/DateTime::Locale::ca
%B will display "de gener" when LLLL will be "gener"

Test plan:
Create a new numbering pattern:
Home > Serials > Numbering patterns > New numbering pattern
Numbering formula: {X}
Label: monthname
Add: 1
Every: 1
Set back to: 1
When more than: 999
Formatting: Name of month
And test it at the bottom of the form
Locale: Catalan
The number column should contain "gener", not "de gener"
Test other locales and confirm that the output is correct (no change
expected for English, French and Spanish for instance).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 93c33c527fdbfad0f46bc26a6b3496cba7d02fbb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29338: (follow-up) only show print button when hold is waiting or intransit
Lucas Gass [Tue, 21 Dec 2021 21:36:28 +0000 (21:36 +0000)]
Bug 29338: (follow-up) only show print button when hold is waiting or intransit

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8ff018c3867d35a426339343f66debdae80e1146)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29338: Add print hold/transfer button to request.tt
Lucas Gass [Wed, 27 Oct 2021 21:58:44 +0000 (21:58 +0000)]
Bug 29338: Add print hold/transfer button to request.tt

1. Apply patch
2. Make some holds, have some item level and some bib level
3. On request.tt notice a new column on the holds_table called 'Print hold/transfer slip'
4. Make sure the button works and takes you to the proper hold/transfer slip
5. Make sure it works well with both item/bib level holds

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a68021a2387ff1caf854c17fc5331e85926c1f7e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29482: Replace the term branch with library
Owen Leonard [Tue, 18 Jan 2022 12:46:51 +0000 (12:46 +0000)]
Bug 29482: Replace the term branch with library

This patch replaces the word "branch" with the word "library" in the
self-checkout template, as per terminology guidelines.

To test, apply the patch and go to Administration -> System preferences.

- Set the "IndependentBranches" preference to "Yes."
- Log into the self checkout system using a staff user with permission
  to do self-checkout but not superlibrarian status.
- Try to check out an item which belongs to a library that's different
  to the one you're logged in with.
- You should see a message, "Item cannot be checked out," including the
  text "This item belongs to another library."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 323428543012e9390c11463256d90a6105352625)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29875: Update wording on maxreserves system preference
Andrew Fuerste-Henry [Thu, 13 Jan 2022 19:17:06 +0000 (19:17 +0000)]
Bug 29875: Update wording on maxreserves system preference

To test:
1 - see the current wording
2 - apply patch
3 - words are changed

Test to confirm accuracy of wording:
1 - set maxreserves to 1
2 - set all/all circ rule to unlimited holds allowed total, holds allowed daily, and holds per record
3 - confirm you can place 1 hold for a patron, but the second is blocked
4 - set maxreserves to 0
5 - confirm you can place and number of holds for the patron
6 - set maxreserves to blank
7 - confirm you can place any number of holds for the patron

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a6e54eea79ae0097aa8936e0a75d63bf52b51951)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28943: (QA follow-up) Fix opac.pref
Fridolin Somers [Sat, 22 Jan 2022 01:57:28 +0000 (15:57 -1000)]
Bug 28943: (QA follow-up) Fix opac.pref

Fix YAML syntax of opac.pref, we must use dash for new lines.

Also removes duplicate text before syspref.
No need to say "code" since it is now a list of categories.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 31fffa6006bf25bfa303fa44f4ae56f461cebb59)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28943: Lower the risk of accidental patron deletion
Marcel de Rooy [Tue, 7 Sep 2021 12:22:05 +0000 (12:22 +0000)]
Bug 28943: Lower the risk of accidental patron deletion

If you do not use a temporary self registration patron category,
you should actually make the preference
PatronSelfRegistrationExpireTemporaryAccountsDelay empty.

As the comment in sysprefs.sql already said, we should not let
a zero value in the pref delete patrons too.

The module is changed now, the test adjusted and
the description of both related sysprefs modified.

Test plan:
Run t/db_dependent/Members.t
Check in Administration the two adjusted OPAC pref descriptions.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8e500c57da0e33b517c13715d3a17271fe47c286)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoUpdate release notes for 21.05.13 release v21.05.13
Andrew Fuerste-Henry [Thu, 24 Mar 2022 18:59:41 +0000 (18:59 +0000)]
Update release notes for 21.05.13 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>