koha-ffzg.git
22 months agoCorrect version in Koha.pm v22.05.03-1
Lucas Gass [Tue, 26 Jul 2022 16:52:35 +0000 (16:52 +0000)]
Correct version in Koha.pm

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoRemove atomicupdate file
Lucas Gass [Tue, 26 Jul 2022 16:51:12 +0000 (16:51 +0000)]
Remove atomicupdate file

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
22 months agoUpdate release notes for 22.05.03 release v22.05.03
Lucas Gass [Mon, 25 Jul 2022 16:05:56 +0000 (16:05 +0000)]
Update release notes for 22.05.03 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoIncrement version for 22.05.03 release
Lucas Gass [Mon, 25 Jul 2022 14:48:56 +0000 (14:48 +0000)]
Increment version for 22.05.03 release

22 months agoTranslation updates for Koha 22.05.03
Koha translators [Mon, 25 Jul 2022 14:32:22 +0000 (11:32 -0300)]
Translation updates for Koha 22.05.03

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 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: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 28355: (QA follow-up) Move Note to new line
Katrin Fischer [Fri, 17 Jun 2022 20:10:55 +0000 (22:10 +0200)]
Bug 28355: (QA follow-up) Move Note to new line

There is an existing pattern for the 'Note:' in pref
descriptions, where it's always added on a new line.
This changes the formatting to match that pattern.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 02b029233326742ee11f897ee12a2a431f7ed946)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 28355: Add a note that SMS to email via mobile provider is not recommended
Nick Clemens [Fri, 17 Jun 2022 12:00:34 +0000 (12:00 +0000)]
Bug 28355: Add a note that SMS to email via mobile provider is not recommended

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 5aa603fa301d3109811ddb3c470a9976566babf2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
22 months agoBug 30997: Fix "CGI::param called in list context" warning in detail.pl
Petro Vashchuk [Mon, 20 Jun 2022 14:08:32 +0000 (17:08 +0300)]
Bug 30997: Fix "CGI::param called in list context" warning in detail.pl

CGI param found1 should be explicitly scalar,
or else error log gets flooded with this warning:

CGI::param called in list context from
/usr/share/koha/intranet/cgi-bin/catalogue/detail.pl line 622

This patch fixes it by working with it in a scalar context.
The functionality still remains the same but warning doesn't flood
error log.

To reproduce:
1. Open any biblio (details.pl) page.
2. Check the error log and find the upper mentioned warning,
check the timestamp to ensure that it was added when you loaded the page.
3. Apply the patch.
4. Load the page again, ensure that the same warning doesn't get added
to the log file again.

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 407564e3940ad08030383078fd1ce5c530a19f2d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 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>
22 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>
22 months agoBug 12630: Rebase tests and cover CheckReserves
Nick Clemens [Fri, 10 Jun 2022 14:47:44 +0000 (14:47 +0000)]
Bug 12630: Rebase tests and cover CheckReserves

It turns out we do honor reservedate in CheckReserves, so a hold with a lower priority will
fill before a hold in the future. I add tests to cover this and fix the old tests to pass again

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 12630: Add regression tests
Jonathan Druart [Wed, 5 Nov 2014 09:32:21 +0000 (10:32 +0100)]
Bug 12630: Add regression tests

Verify that the 2 tests failed before applying this patch and return
green after.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2369076f99ce3415bcfe6ced74cc3edb6aef5a09)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 12630: (QA follow-up) - Rename _ShiftPriorityByDateAndPriority to _ShiftPriority
Kyle M Hall [Mon, 25 Aug 2014 14:17:28 +0000 (10:17 -0400)]
Bug 12630: (QA follow-up) - Rename _ShiftPriorityByDateAndPriority to _ShiftPriority

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0ca445fca8262ad3a0e2b44c7516417e81532c43)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 12630: Prioritizing "Hold starts on date" -holds causes all other holds to be...
Olli-Antti Kivilahti [Wed, 23 Jul 2014 05:41:47 +0000 (08:41 +0300)]
Bug 12630: Prioritizing "Hold starts on date" -holds causes all other holds to be prioritized as well!

-------------------------
-- REPLICATE LIKE THIS --
-------------------------

0. Enable AllowHoldDateInFuture-system preference!

1. Select a biblio with some holds.
2. Place a hold with the "Hold starts on date"-attribute set to future.
3. More the specific hold up on the priority queue.
4. Add another normal hold, observe how it is prioritized with the "Hold starts on date"-hold, leaving old holds to the prioritization queue tail.

Unfair eh?

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 05ac7e0d4a1d4247df43f4a83ead509cfaffa04c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30989: (QA follow-up) Use uri filter on OPAC tag cloud page
Katrin Fischer [Fri, 17 Jun 2022 22:23:31 +0000 (22:23 +0000)]
Bug 30989: (QA follow-up) Use uri filter on OPAC tag cloud page

This fixes 2 links on the page:
* The tag within the 'all tags' cloud
* The tag shown in the 'your tags' table

Test plan as before: Test with a tag like +++

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30989: (QA follow-up) Use uri filter on staff detail page
Katrin Fischer [Fri, 17 Jun 2022 21:26:55 +0000 (21:26 +0000)]
Bug 30989: (QA follow-up) Use uri filter on staff detail page

This applies the same fix as the first patch but to the staff
interface detail page. With this fix, a tag like +++ can
be clicked and the tagged records will show.

To test:
- Tag some records in the staff interface with something like +++
- Go to the detail page of one of those recods
- Click on the tag
- Verify nothing is found
- Apply patch
- Repeat - all tagged records will show

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6895af827aa04d2cada9449e8e27884abe11ca2d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30989: Use uri filter where tag links are displayed
Lucas Gass [Fri, 17 Jun 2022 19:45:42 +0000 (19:45 +0000)]
Bug 30989: Use uri filter where tag links are displayed

TO test:
1. Turn on:  TagsEnabled.
2. Log in to the OPAC and create a tag like "LGBTQ+"
3. Add that record to a list
3. Now try  clicking on that tag from detail, results, and lists page.
4. If you click on the link for the "LGBTQ+" you will get a 'no results found page'.
5. Apply patch
6. Try clicking on each of the tags in detail, results, and lists. They should work now.

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 997262f6fe7f47b5b6f0fd5cc1032538b3a79b26)

22 months agoBug 30925: Fix category parameter for addbybiblionumber
Marcel de Rooy [Mon, 20 Jun 2022 07:03:17 +0000 (07:03 +0000)]
Bug 30925: Fix category parameter for addbybiblionumber

In bug 28959 category was replaced in favor of public. But
unfortunately a few places were missed.
This fixes the addbybiblionumber templates.

Test plan:
Add a biblio to a list from the search results using the Add to
or Add to list button on OPAC/intranet.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 29963: Do not prefill empty date fields with today's date
Petro Vashchuk [Fri, 3 Jun 2022 16:10:03 +0000 (19:10 +0300)]
Bug 29963: Do not prefill empty date fields with today's date

Revert "Bug 29815: Pre-populate 'Date acquired' field when adding/editing items"
commit bd197c64567fba6899f12e4897d786adf52384d8

Items date fields in MARC framework with dateaccessioned.pl assigned as
plugin automatically prefilled by it with today's date if empty on page
load.

This becomes big problem because it silently changes empty date fields
in single item edit form with today's date. This drastically degrades
UX because user won't noitce that fields were filled.

Also, even when user aware about this problem, user is forced to clean
the field manually each time they edit items with empty fields.

Also in item batch edit tool the probability heavily increases to make
mistake and leave those fields prefilled on mass.

To reproduce problem with single item edit:
1. Edit single item that doesn't have a date set in any of the date
fields where dateaccessioned.pl in MARC framework assigned as plugin,
see that the field got prefilled with today's date.
2. Save the item. See that it overwrote the previously empty date.
3. Apply the patch.
4. Edit single item again, and ensure that the empty date fields don't
get overwriten like it happened previously.

To reproduce problem with bath edit:
1. Edit items in batch for any biblio, see that the date fields where
dateaccessioned.pl in MARC framework assigned as plugin is automatically
 set to current day's date.
2. Apply the patch.
3. Check the fields again, they should be empty after that.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 926def44c0e25c0ff6cb634a24dce3014075a3a3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30938: Convert ColumnSettings to TableSettings
Lucas Gass [Fri, 10 Jun 2022 17:27:16 +0000 (17:27 +0000)]
Bug 30938: Convert ColumnSettings to TableSettings

To test:
1. Apply this patch
2. Go to /cgi-bin/koha/acqui/acqui-home.pl
3. The columns button should be restored, make sure you can hide/show columns correctly.
4. Go to Table settings and make sure you can hide columns properly by default.

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 9b3e31222355d2353164ce18e48e31beefa50df0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoModify DBRev permission
Lucas Gass [Wed, 13 Jul 2022 20:23:34 +0000 (20:23 +0000)]
Modify DBRev permission

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30924: DBRev 22.05.02.001
Lucas Gass [Wed, 13 Jul 2022 20:16:58 +0000 (20:16 +0000)]
Bug 30924: DBRev 22.05.02.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30954: (bug 27344 follow-up) Remove background_jobs_update_elastic_index.inc
Jonathan Druart [Mon, 13 Jun 2022 12:47:12 +0000 (14:47 +0200)]
Bug 30954: (bug 27344 follow-up) Remove background_jobs_update_elastic_index.inc

includes/background_jobs_update_elastic_index.inc
vs
includes/background_jobs/update_elastic_index.inc

Both exist and have been added by bug 27344.
The first one is not used.

Test plan:
  git grep background_jobs_update_elastic_index.inc
must not return any occurrences (outside of POs)

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30973: Serials search fix body id
Fridolin Somers [Thu, 16 Jun 2022 07:55:51 +0000 (21:55 -1000)]
Bug 30973: Serials search fix body id

The serials search page serials/serials-search.pl has HTML body id :
  <body id="ser_serials-home" class="ser">
It is the same as serials home page.

This patch replaces with id="ser_serials-search"

Test plan :
1) Go to Serials > Advanced search
2) Look at HTML code
3) Check you see <body id="ser_serials-search" class="ser">

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30974: Set size for indexing jobs to 1
Jonathan Druart [Thu, 16 Jun 2022 08:22:02 +0000 (10:22 +0200)]
Bug 30974: Set size for indexing jobs to 1

job's size is the number of records to index, but when finished the progress is always set to 1.

Wich leads to: finished 1/42

Test plan:
Don't apply this patch
Use the batch item modification tool to update more than 1 item
Notice that the new indexing job has a size of the number of items you
modified
When finished, the job detail shows "Finished. 1/X"
Apply this patch, repeat
Notice that now the progress shows 0/1 before the job is done, then 1/1
when finished

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30409: (QA follow-up) Avoid uninitialized variable warnings
Tomas Cohen Arazi [Tue, 14 Jun 2022 11:21:42 +0000 (08:21 -0300)]
Bug 30409: (QA follow-up) Avoid uninitialized variable warnings

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30409: (QA follow-up) Fix grammar in syspref help text
Joonas Kylmälä [Sun, 12 Jun 2022 08:12:23 +0000 (08:12 +0000)]
Bug 30409: (QA follow-up) Fix grammar in syspref help text

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2538c846f48a86e0d557ec3238b93a850b5a0c58)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30409: barcodedecode() should always trim barcode
Petro Vashchuk [Sat, 2 Apr 2022 21:02:40 +0000 (00:02 +0300)]
Bug 30409: barcodedecode() should always trim barcode

Barcode is trimmed of leading/trailing whitespaces in many instances
before the barcodedecode sub was called. This patch instead makes that
barcodedecode sub is going to trim it itself and removes unnecessary,
and repetitive code that was used before barcodedecode was called.

Steps to test:
1. Edit item with any barcode, add a bunch of whitespaces at the start
and at the bottom of it. Save the item. Ensure that this action ruins
the barcode and ensure that the spaces are still there by editing the
same item again.
2. Apply the patch.
3. Edit the same item again in the same fashion. Ensure that now all
whitespaces are getting trimmed and it doesn't affect the barcode in
any negative way.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30780: Librarians with only "place_holds" permissions can not update holds data...
Johanna Raisa [Tue, 17 May 2022 05:58:15 +0000 (08:58 +0300)]
Bug 30780: Librarians with only "place_holds" permissions can not update holds data via REST API

This patch enables librarians with only "place_holds" permissions to cancel, suspend and resume holds via REST API.

Test plan:
1) Try to cancel or suspend a hold with only "place_holds" permissions
2) See that it is forbidden.
3) Apply the patch
4) Cancel a hold again
5) The cancellation succeeds
6) prove t/db_dependent/api/v1/holds.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 71a95d35574db31e21a6815fc696ee2b446c617e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30780: Regression tests
Tomas Cohen Arazi [Mon, 13 Jun 2022 14:46:20 +0000 (11:46 -0300)]
Bug 30780: Regression tests

This patch lowers the used permissions on the suspend/resume tests, and
adds tests for fine-grained permissions on cancelling a hold.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30904: (bug 24387 follow-up) Fix library modification of additional contents
Jonathan Druart [Wed, 8 Jun 2022 09:56:30 +0000 (11:56 +0200)]
Bug 30904: (bug 24387 follow-up) Fix library modification of additional contents

Modifying an existing element of additional content (News) by changing
the library causes a duplication of the entry on the Additional contents
(News) list.  A subsequent attempt of deleting one of the entries results
in deleting both of them.  This is due to the fact that after
the unwanted duplication all the  entries share the same
additional_contents.code.

Test plan
=========

1. Create a piece of news under Tools > News.
2. After having saved it make a modification by changing the library.
   It should result in two rows in the table.
3. Delete one of the lines with Delete button.  Both lines will
   disappear.
4. Apply the patch.
5. Repeat the steps 1 and 2.  Only the one (the modified) entry should be
   present in the table.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30798: Change column order on account-fines table column settings
Emmi Takkinen [Wed, 18 May 2022 09:16:42 +0000 (12:16 +0300)]
Bug 30798: Change column order on account-fines table column settings

Columns Home library and Checked out from are in wrong order
on table settings. Because of this hiding Home library actually
hides Checkout out from column and vice versa. This patch changes
order of these columns on columns_settings.yml

To test:
1) Navigate to columns settings page and modify
account-fines tables column.
=> Note that if you hide  column checked_out_from, column
home_library is hidden on patrons account page.
2) Apply patch and restart plack etc.
=> Column checked_out_from should now be hidden.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c16e366af58bd41783a478bf9d7d8fc3257bc874)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
22 months agoBug 30924: DBIC Update
Lucas Gass [Wed, 13 Jul 2022 19:19:46 +0000 (19:19 +0000)]
Bug 30924: DBIC Update

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30924: Add missing branchtransfers.reason value for recall cancellation
Tomas Cohen Arazi [Thu, 9 Jun 2022 14:58:44 +0000 (11:58 -0300)]
Bug 30924: Add missing branchtransfers.reason value for recall cancellation

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 54372681bec7e81e044e32644330e38093408f8f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30924: Fix transferstoreceive.pl explosion on recalls
Tomas Cohen Arazi [Thu, 9 Jun 2022 14:09:18 +0000 (11:09 -0300)]
Bug 30924: Fix transferstoreceive.pl explosion on recalls

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 46387c3845b7a22a661e79910eb4787795f3c594)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30399: Make Patron.t pass even if mandatory attributes exist
Jonathan Druart [Wed, 8 Jun 2022 09:39:43 +0000 (11:39 +0200)]
Bug 30399: Make Patron.t pass even if mandatory attributes exist

t/db_dependent/Koha/Patron.t is failing if mandatory attributes already
exist in the DB. We can make it pass easily by deleting all the
attributes before we run the tests.

Test plan:
  prove t/db_dependent/Koha/Patron.t
must return green even if one mandatory patron attribute exists.

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 523a2f297d09015818eec2785de5cc538ff65852)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30585: Fix library options on table settings for course_reserves_table
Katrin Fischer [Mon, 6 Jun 2022 21:02:25 +0000 (21:02 +0000)]
Bug 30585: Fix library options on table settings for course_reserves_table

The table on  course-details.pl has columns for both home library and jolding library,
but course_reserves_table in the Table configuration admin area only has a
single toggle for 'library'.

Hiding 'library' hides the home library column. Anything after that is off by one.
Hiding 'staff_note' actually hides the holding library column, 'link' hides
Public note, etc.

To test:
- Add a course and some course reserves
- Go to table configuration and hide 'staff note'
- Look at the list of course reserves for your course
- Verify the wrong column was hidden
- Apply patch
- The configuration area now shows holding_library and home_library
  as separate options.
- Change the settings and verify everything now hides/displays correctly.

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 972330bc9e13e40564885bcf0ef1723abcc51772)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30768: Capitalizing "pin" in 2FA setup
Michal Urban [Wed, 8 Jun 2022 15:40:42 +0000 (11:40 -0400)]
Bug 30768: Capitalizing "pin" in 2FA setup

Change of text from "pin" to "PIN" in the 2FA setup interface.
This slight changes clarifies that "PIN" is an acronym,
 and increases user comprehension

To test:
1) Log in as an Administrator
2) Enable TwoFactorAuthentication
3) Log in to a user with superlibrarian permissions.
4) On the user profile page, click the "More" dropdown button,
click "Manage Two-Factor
5) Check that "pin" is displayed in lowercase, in both instances.
6) Apply patch.
7) Refresh the page and observe that "pin" has changed to "PIN"
8) Sign off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ed4250e7a9c8a83f8a538b5088f8867c630c72a1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 29312: Remove unnecessary dot
Séverine QUEUNE [Tue, 5 Apr 2022 13:09:08 +0000 (13:09 +0000)]
Bug 29312: Remove unnecessary dot

This patch removes an extra point after the number of shown results.

Test plan :
 - don't apply patch
 - run a report that brings you more than 20 results, e.g. SELECT * FROM biblio LIMIT 50
 - see extra ' .' after the number of shown results
 - apply patch
 - run the report again and see the point isn't displayed anymore
 - check the behaviour is still correct when you change the number of rows displayed
 - 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 d491b15c55804500a96ae7065d459d6b84126069)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 27519: Normalize Show/Don't show in system preferences
Shi Yao Wang [Wed, 18 May 2022 14:59:39 +0000 (10:59 -0400)]
Bug 27519: Normalize Show/Don't show in system preferences

Replace Display/Don't display (and some other pairs) by Show/Don't show in system preferences.

Test plan:
1- Go to administration > system preferences
2- View any system preference with Display/Don't display pair of options
(e.g. OPACAcquisitionDetails)
3- Apply the patch
4- Refresh the page and notice it is now a Show/Don't show pair instead
5- Loop the steps with other system preferences until satisfied

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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 ed81d6bac6db499412a22f20ac45003da1aab0b1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30807: Migrate to patron-title in pay and paycollect
Martin Renvoize [Thu, 19 May 2022 11:53:18 +0000 (12:53 +0100)]
Bug 30807: Migrate to patron-title in pay and paycollect

This patch updates the member-flags template to use the patron-title.inc
include wherever patron names are referenced.

Test plan
1) Navigate to a patron and click through to their accounts tab
2) Note how the patron name displays in the title, breadcrumb and
   headings
3) Click through to make a payment
4) Note how the patron name displays in the title, breadcrumb and
   headings
5) Apply the patch and reload the page
6) Confirm the patron name still appears in each location and is
   consistently formatted and linked as you would expect

Note: This patch also removes a superflous hidden title form element
that was simply passed to and from the controller but not actually used
in any way.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30806: Migrate to patron-title in member-flags
Martin Renvoize [Thu, 19 May 2022 11:34:01 +0000 (12:34 +0100)]
Bug 30806: Migrate to patron-title in member-flags

This patch updates the member-flags template to use the patron-title.inc
include wherever patron names are referenced.

Test plan
1) Navigate to a patron and click through to edit their permissions
2) Note how the patron name displays in the title, breadcrump and
   headings
3) Apply the patch and reload the page
4) Confirm the patron name still appears in each location and is
   consistently formatted and linked as you would expect

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 8b460db131f83e361788d53b3a101565eab302db)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30789: Improve performance of AddBiblio
Nick Clemens [Thu, 19 May 2022 19:21:27 +0000 (19:21 +0000)]
Bug 30789: Improve performance of AddBiblio

AddBiblio calls TransformMarcRecordToKoha. We are only interested in getting biblio and biblioitems info, so we can pass 'no_items' to save some field lookups

Benchmarking saw a ~75% increase in the performance of this call

To test:
1 - Stage and import some records
2 - Confirm it works the same before and after patch
3 - Add a biblio via cataloguing, confirm it works

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30677: Cleanup
Martin Renvoize [Tue, 28 Jun 2022 11:29:05 +0000 (12:29 +0100)]
Bug 30677: Cleanup

This patch cleans up the regular expression to remove the superflous
double check and use standard delimiters

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30677: Use lookahead in regex for biblioitem replacement
Martin Renvoize [Wed, 11 May 2022 15:47:59 +0000 (16:47 +0100)]
Bug 30677: Use lookahead in regex for biblioitem replacement

This patch takes Andrew's suggested fix using a lookahead regex to
correct our biblio vs biblioitem table name replacements.

Please use the preceeding unit test patch proposed by Jonathan to test.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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 be3bd8af8b1f2dbff33d2228eb64fa77fe9362f7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30677: Add tests
Jonathan Druart [Fri, 6 May 2022 11:53:01 +0000 (13:53 +0200)]
Bug 30677: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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 de4fcc91f02e7d8da645388c7287ed942fa4bae8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30738: Log warnings for background MARC import
David Cook [Thu, 12 May 2022 04:09:58 +0000 (04:09 +0000)]
Bug 30738: Log warnings for background MARC import

This change logs warnings from the CGI background MARC import.

Test plan:
0) Apply patch
1) Export a record with an item
2) Update the 952$f subfield to "Circulation" (any value over 10 chars)
3) Import the record and try to add the item
4) The import will stay stuck with "Importing" status and 0% job
progress
5) Check the /var/log/koha/kohadev/intranet-error.log file
and notice there's an error with the following text:
"Data too long for column 'coded_location_qualifier' at row 1"

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 9d8d9321e800e0ccfda895a9060b2800947982e8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30923: Remove EXPERIMENTAL mark on RESTOAuth2ClientCredentials
Tomas Cohen Arazi [Tue, 7 Jun 2022 19:56:34 +0000 (16:56 -0300)]
Bug 30923: Remove EXPERIMENTAL mark on RESTOAuth2ClientCredentials

The feature is not experimental at all.

To test:
1. Search for the RESTOAuth2ClientCredentials syspref
=> FAIL: It says it is an experimental feature
2. Apply this patch and reload
3. Repeat 1
=> SUCCESS: No longer marked as experimental
4. 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 556a910021883e4d27d499747559dc2ee102ce05)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30877: use List::MoreUtils::uniq from recalls_to_pull.pl
Jonathan Druart [Wed, 1 Jun 2022 12:04:47 +0000 (14:04 +0200)]
Bug 30877: use List::MoreUtils::uniq from recalls_to_pull.pl

Test plan:
Confirm that "Recalls to pull" is still working correctly

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30539: (bug 24161 follow-up) Fix typo in DBrev
Jonathan Druart [Tue, 31 May 2022 05:58:59 +0000 (07:58 +0200)]
Bug 30539: (bug 24161 follow-up) Fix typo in DBrev

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30057: Move virtualshelf-related exceptions to a separate library
Tomas Cohen Arazi [Wed, 9 Feb 2022 13:05:12 +0000 (10:05 -0300)]
Bug 30057: Move virtualshelf-related exceptions to a separate library

This patch moves the not-generic virtualshelf-related exceptions to
their own file. Callers are adjusted as required.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Virtualshelves.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass
4. Check virtualshelves work as expected
5. 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 7704f51d5131d3f1104244a705294db614eae76e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30891: (QA follow-up) Add check to patron details page
Katrin Fischer [Mon, 6 Jun 2022 11:16:33 +0000 (13:16 +0200)]
Bug 30891: (QA follow-up) Add check to patron details page

Adds a similar check to the patron details shown when selecting
the details tab in the patron account in the staff interface.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3f784ea61318818188a102a4d81e2aece1899e74)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30891: SMS provider shows on staff side even if SMS::Send driver is not set to...
Kyle M Hall [Thu, 2 Jun 2022 14:23:08 +0000 (10:23 -0400)]
Bug 30891: SMS provider shows on staff side even if SMS::Send driver is not set to "Email"

It appears that in my original submission ( Bug 9021 ),
I hid the SMS provider selector unless the SMS::Send
driver was set to "Email", but only on the OPAC,
not on the staff interface!

Test Plan:
1) Set SMSSendDriver to anything except "Email"
2) Note the SMS Provider pulldown shows in the patron editor
3) Apply this patch
4) Reload the page, SMS Provider id should now be gone
5) Set SMSSendDriver to "Email"
6) Reload the page, SMS Provider should now be shown

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 29607: Store the discount amount correctly when importing and order from a file
Christophe TORIN [Wed, 1 Jun 2022 12:14:38 +0000 (14:14 +0200)]
Bug 29607: Store the discount amount correctly when importing and order from a file

This bug fixes how the discount amount for an order is stored, when an order is added to a basket using "From staged MARC records".

Test plan:
1. Export a record (without the items) (Tools > Catalog > Export data).
2. Delete the record from the catalog (including any items).
3. Stage the record for import (Tools > Catalog > Stage MARC records for import).
4. Create a new vendor with a discount of 25%. (Or select and existing vendor that has a discount). (Acquisitions > New vendor)
5. Create a new basket for the vendor. (Acquisitions > Manage orders > search for vendors > New > Basket).
6. Add to the basket using "From a staged file":
   . select "Add orders" next to the staged file
   . select the record to add to the order
   . enter a price
   . leave the discount field blank
   . select a fund
   . select "Save"
   ==> The order is created!
7. Modify the order - note that the discount is showing on the form as .25% instead of 25%, also note that the discount amount is calculated correctly.
8. Check what is recorded in the database:
   . koha-mysql kohadev
   . select * from aqorders;
   ==> discount field for the basket item shows as 0.2500
9. Change the discount to 25%. Run step 8 again - discount amount will be correctly shown as 25.0000
10. Apply the patch.
11. Repeat steps 1-9 - discount amount is shown and calculated correctly.
12. Test modifying the discount amount - should be calculated and shown correctly.
13. Sign off!

See additional comments in the bug description.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 29871: Remove marcflavour param in Koha::Biblio->get_marc_notes
Fridolin Somers [Thu, 13 Jan 2022 07:05:29 +0000 (21:05 -1000)]
Bug 29871: Remove marcflavour param in Koha::Biblio->get_marc_notes

Test plan :
Display a biblio record with some MARC notes in details page and basket,
OPAC and staff
Run prove t/db_dependent/Koha/Biblio.t

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30026: Quick fix for SmsAlert Hint
Florian Bontemps [Fri, 4 Mar 2022 14:49:19 +0000 (14:49 +0000)]
Bug 30026: Quick fix for SmsAlert Hint

Just modifying the hint provided in patrons' messaging preferences to
allow either + or 00 for international formats.
No test plan needed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 26e8642f3fd04f5be850b87f8ad8cad5e60424a4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30026: SMSAlert regex fixed for international
Florian Bontemps [Fri, 4 Feb 2022 15:40:33 +0000 (15:40 +0000)]
Bug 30026: SMSAlert regex fixed for international

When registering a phone number for SMS alerts, the number goes through
a regex filter to make sure the number is valid. One of the formats used
in Europe is 00 AAA XXXXXXXXX (A = country indicator) and it is not
supported.

This patch adjusts the regex to either accept 00 AAA XXXXXXXXX or
+AAAXXXXXXXXX in this case. (Note : +AAA and 00AAA are mutually exclusive).

To test:
1) You need to have installed a SMSAlert plugin. Make sure the
   SMSSendDriver syspref is also set up with your SMS plugin of choice.
2) Pick a patron and edit its profile.
3) In the messaging preferences fieldset, under SMS number, enter any
   number with the format 00 AAA XXXXXXXXX (ie : 00111123456789).
   Try to save the modification : you should have an error message.
4) Try instead a number with the format +AAAXXXXXXXXX (ie :
   111123456789), that one should be accepted.
5) Save your modification then check that the number has been changed.
6) Apply patch.
7) Repeat step 3 to 5.
8) Observe the error is gone.
9) Try it once more with the format +00 AAA XXXXXXXXX (+00111123456789),
   that format should not be accepted: this is intentional.
10) Sign off.

    Thanks-to: Didier Gautheron <didier.gautheron@biblibre.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3dc883a1cc493a1208b16782f9b43a318de43ce8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30713: Patron entry should limit date of birth selection to dates in the past
Owen Leonard [Fri, 6 May 2022 15:21:43 +0000 (15:21 +0000)]
Bug 30713: Patron entry should limit date of birth selection to dates in the past

This patch adds to the configuration of the date of birth field in the
patron entry form so that the calendar widget prohibits the selection of
a date in the future.

To test, apply the patch and open a patron record for editing. Try to
select a birth date in the future using the calendar widget. You should
be limited to a selection of today or before.

Confirm that clicking the "Yesterday" and "Today" shortcuts in the
calendar widget works correctly.

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 4d16ca1069760f32df4c8bb8267fd24e21f812aa)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30864: Add validation to password_expiry_days
Jonathan Druart [Wed, 1 Jun 2022 12:29:59 +0000 (14:29 +0200)]
Bug 30864: Add validation to password_expiry_days

When creating a patron category or editing an existing one, there is no validation for the "Password expiration" field.

If letters or other characters are entered, there is no error message and if not a number whatever is entered is not saved.

To test:
1. Go to Administration > Patrons and circulation > Patron categories.
2. Add a new patron category (or edit an existing category).
3. For the "Password expiration" field, enter letters or characters such as L$%.
=> Note that you are prompted to "Please enter only digits"

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 79396ae625ac772e4a6c01f2649a7147a07cc7b7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 29260: 210a is reported to Autor (meeting/conference) when upgrading an authority...
Marion Durand [Fri, 10 Sep 2021 14:25:34 +0000 (16:25 +0200)]
Bug 29260: 210a is reported to Autor (meeting/conference) when upgrading an authority through Z3950

When upgrading an authority with Z39.50, the field 2XX is sent into the
research grid.

The field 210a is sent into the search field "Author
(meeting/conference)". Or a collective authority is more often a
corporation than and meeting so librarian has to copy and paste this
data. (In unimarc field 210a is used both for corporation and meeting.)

This patch makes 210a field be sent into the search field "Author
(corporate)" instead of the "Author (meeting/conference)" one.

1- Find an authority with collectivity type (with a field 210a).
2- Click on "Edit" then on "Edit record"
3- Click on "Replace record via Z39.50/SRU search"
4- See that the field 210 is reported in the search grid in "Author
(meeting/conference)" field
5- Apply the patch
6- Go throug step 1 to 3 again
7- See that the field 210 is now reported in the search grid in "Author
(corporate)" field

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 7306f945ce9cba653c298e0c84016b9c8a7bd582)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30778: Remove ModAuthInBatch
Nick Clemens [Mon, 16 May 2022 19:51:41 +0000 (19:51 +0000)]
Bug 30778: Remove ModAuthInBatch

1 - git grep ModAuthInBatch
2 - Confirm none of these occurences are calls
3 - Apply patch
4 - git grep ModAuthInBatch
5 - No occurences

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
22 months agoBug 30778: Remove ModBiblioInBatch
Nick Clemens [Mon, 16 May 2022 19:50:20 +0000 (19:50 +0000)]
Bug 30778: Remove ModBiblioInBatch

To test:
1 - git grep ModBiblioInBatch
2 - Confirm these occurences are not calls
3 - Apply patch
4 - git grep ModBiblioInBatch
5 - No occurences

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 46fabf9bb52375db38268031ca9409a734fe7ce0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>