koha.git
2 years agoBug 29065: Accessibility OPAC clear search history link has insufficient contrast
Henry Bolshaw [Mon, 20 Sep 2021 22:27:23 +0000 (22:27 +0000)]
Bug 29065: Accessibility OPAC clear search history link has insufficient contrast

This patch changes the colour of the clear search history link
on the OPAC to increase the contrast ratio, improve accessibility
and makes the text easier to read.

To test:

1. Go to the OPAC homepage
2. Use an accessibility tool (e.g Chrome's
   Lighthouse tool) to check the contrast ratio
3. Confirm that the clear search history link
   has insufficient contrast
4. Apply the patch and rebuild css:
   yarn build --view opac
5. Confirm that the contrast ratio now
   meets minimum accessibility requirements
6. Check the OPAC still looks ok after the changes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29038: Accessibility OPACUserSummary heading doesn't have sufficient contrast
Henry Bolshaw [Mon, 20 Sep 2021 21:10:15 +0000 (21:10 +0000)]
Bug 29038: Accessibility OPACUserSummary heading doesn't have sufficient contrast

This patch changes the colour of the OPAC User Summary heading text to
increase the contrast ratio, improving accessibility and making the
text easier to read.

To test:

1. Log in to the OPAC homepage as a user with items checked out
2. Use an accessibility tool (e.g. Chrome's Lighthouse tool) to test the
   contrast ratio.
3. Confirm the UserSummary heading has insufficient contrast.
4. Apply the patch and rebuild css:
   yarn build --view opac
5. Use the accessibility tool to confirm the contrast ratio now meets
   accessibility requirements
6. Check that the OPAC still looks ok after the changes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29037: Accessibility: OPAC links don't have sufficient contrast
Henry Bolshaw [Thu, 16 Sep 2021 07:55:01 +0000 (07:55 +0000)]
Bug 29037: Accessibility: OPAC links don't have sufficient contrast

This patch changes the colour of links on the OPAC
to improve the contrast ratio and make the link
text easier to read. This accessibility issue was
identified using the WebAIM WAVE accessibility
browser extension and Google Chrome's Lighthouse
tool.

To test:
1. Use an accessibility tool (e.g. Chrome's
   Lighthouse tool) to test the contrast ratio.
2. Confirm that some links (e.g. breadcrumb links
   and title links in search results) have
   insufficient contrast.
3. Apply the patch and rebuild the OPAC CSS:
   yarn build --view opac
4. Use the accessibility tool to confirm the
   contrast ratio meets minimum requirements
5. Check that the OPAC still looks ok after the
   changes.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29035: Accessibility: OPAC masthead_search label doesn't have sufficient contrast...
Henry Bolshaw [Thu, 16 Sep 2021 12:53:12 +0000 (12:53 +0000)]
Bug 29035: Accessibility: OPAC masthead_search label doesn't have sufficient contrast ratio

This patch changes the colour of the masthead
search label to improve accessibility and make it
easier to read.

To test:
1. Use an accessibility tool (e.g. Chrome's
   Lighthouse tool) to test the contrast ratio.
2. Confirm that the search label has insufficient
   contrast.
3. Apply the patch and rebuild the OPAC CSS:
   yarn build --view opac
4. Use the accessibility tool to confirm the
   contrast ratio now meets accessibility
   requirements.
5. Check that the OPAC still looks ok after
   the changes.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29034: Accessibility: OPAC nav links don't have sufficient contrast ratio
Henry Bolshaw [Thu, 16 Sep 2021 08:35:39 +0000 (08:35 +0000)]
Bug 29034: Accessibility: OPAC nav links don't have sufficient contrast ratio

This patch changes the colour of the navigation
links on the OPAC (Cart, Lists etc.) to improve
the contrast ration and make them easier to read.

To test:
1. Use an accessibility tool (e.g. Chrome's
   Lighthouse tool) to check the contrast
   ratio on the OPAC
2. Confirm that the navigation links have
   insufficient contrast
3. Apply the patch and rebuild the OPAC css:
   yarn build --view opac
4. Use the accessibility tool to confirm
   the contrast ratio meets  the minimum
   accessibility requirements
5. Check that the OPAC looks ok after the
   changes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29056: Remove the demo functionality leftovers
Petro Vashchuk [Mon, 20 Sep 2021 09:36:02 +0000 (12:36 +0300)]
Bug 29056: Remove the demo functionality leftovers

Remove forgotten code of the old legacy demo functionality that was
removed from elsewhere except systempreferences, this code not only
serves no purpose but also is causing some troubles for our customers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: Remove reference to optionloop
Jonathan Druart [Tue, 28 Sep 2021 12:17:36 +0000 (14:17 +0200)]
Bug 29049: Remove reference to optionloop

It's no longer used.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: (QA follow-up) Initialize uninitialized variable to prevent warning
Joonas Kylmälä [Sat, 25 Sep 2021 11:15:08 +0000 (11:15 +0000)]
Bug 29049: (QA follow-up) Initialize uninitialized variable to prevent warning

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: (QA follow-up) Remove unused variable
Joonas Kylmälä [Sat, 25 Sep 2021 10:54:44 +0000 (10:54 +0000)]
Bug 29049: (QA follow-up) Remove unused variable

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: (follow-up) Reduce number of line returns in page
Nick Clemens [Fri, 17 Sep 2021 16:18:09 +0000 (16:18 +0000)]
Bug 29049: (follow-up) Reduce number of line returns in page

While moving the dropdown to a block, I noticed the page size was very large when there are many holds

This patch chomps a large amoutn of whitespace, from the block and elsewhere and drecreased the paeg from about 400k lines to 25k lines for a record with ~200 holds

To test:
1 - Apply previous patch
2 - Load holds tab for a biblio
3 - Save the page as html from your browser, note the size of the file
4 - Apply patch this
5 - Reload and repeat
6 - Note the size is much smaller

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: Simplify holds priority dropdown logic on request.pl
Nick Clemens [Fri, 17 Sep 2021 13:59:25 +0000 (13:59 +0000)]
Bug 29049: Simplify holds priority dropdown logic on request.pl

This patch makes a few changes:
1 - If we are not splitting the queue ( HoldsSplitQueue == 'nothing' ) then
    there are no changes for 'virtual' vs 'actual' numbering
2 - If we are splitting the queue you cannot use the dropdown, so we do not need to process the options
3 - If the hold is 'found' we do not need to process the options
4 - We can simply use the 'last priority' to build the options, we do not need to process in the script
5 - We can use a block to build the options
6 - Remove a stray holds.index

To test:
 1 - Place 5 holds on a bib
 2 - 'Find' two of the holds i.e. check them in to set status to 'transit' or 'waiting'
 3 - View the holds page for the biblio
 4 - Inspect the priorty dropdown for the found holds, note they have options for 1-5 but are disabled
 5 - Note the dropdowns for other holds have options 1-5
 6 - Note options 4&5 in the dropdowns have no effect
 7 - Apply patch
 8 - Inspect the priority dopdowns on the found holds
 9 - Note they only show their found status
10 - Note the other dropdowns only show options 1-3
11 - Test with other HoldsSplitQueue options and HoldsSplitQueueNumbering
12 - When holds queue is split, no dropdowns should be active and should show only their current priority
13 - When  HoldsSplitQueueNumbering is 'virtual' the dropdown should be disabled and correctly count the number of unfound holds in the list

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
JK: Fixed grammar in commit title
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
JD: Remove trailing 'i'

Bug 29049: (QA follow-up) Remove excessive whitespace

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27461: Right pad with default elements for too short 008s
Marcel de Rooy [Thu, 19 Aug 2021 13:43:48 +0000 (13:43 +0000)]
Bug 27461: Right pad with default elements for too short 008s

Note that we treat the elements 18-34 as one block of elements,
since its subdivision may vary.
E.g. if you pass 24 characters to the form, it will use the first
18 chars (until the last complete element) and pad with default
elements from position 18-39.

Test plan:
[1] Go to addbiblio. Make sure that 008 is connected to the plugin.
[2] Backspace field 008 a bit, click on the plugin button.
[3] Verify that the last elements come from the default.
[4] Repeat for a few different lengths.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27461: Add tests for biblio_008
Marcel de Rooy [Thu, 19 Aug 2021 11:42:36 +0000 (11:42 +0000)]
Bug 27461: Add tests for biblio_008

Test plan:
Run  t/db_dependent/FrameworkPlugin.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27461: Move hardcoded value to module
Marcel de Rooy [Thu, 19 Aug 2021 09:52:14 +0000 (09:52 +0000)]
Bug 27461: Move hardcoded value to module

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27279: (bug 23916 follow-up) Fix issuer display on "Checkout history"
Jonathan Druart [Mon, 20 Sep 2021 09:07:11 +0000 (11:07 +0200)]
Bug 27279: (bug 23916 follow-up) Fix issuer display on "Checkout history"

Caused by
  commit 61a39b0dd52df4f6d743671823449e265d6add26
  Bug 23916: (QA follow-up) Adapt all the things to the new column and accessor names

- [% INCLUDE 'patron-title.inc' patron=checkout.issued_by %]

+ [% INCLUDE 'patron-title.inc' patron=checkout.issuer_id %]

It must have been patron=checkout.issuer as patron-title.inc is
expecting a Koha::Patron object, not a borrowernumber.

Test plan:
Turn RecordStaffUserOnCheckout on
Check an item out then in
Go to the biblio checkout history and confirm that the "Checked out by"
column contains the logged in librarian's name.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29026: Restore behavior when an empty barcode field is submitted in circulation
Fridolin Somers [Wed, 15 Sep 2021 07:33:47 +0000 (21:33 -1000)]
Bug 29026: Restore behavior when an empty barcode field is submitted in circulation

When preference CircAutoPrintQuickSlip is 'clear the screen', when an empty barcode field is submitted in circulation :

Before Bug 17845, behavior was to display empty circulation page (no patron selected).
Now behavior is displaying the circulation page of current patron.

I think previous behavior was used when scanner is used to clear form and wait for another patron card to be scanned.

Test plan :
1) Set system preference CircAutoPrintQuickSlip to 'clear the screen'
2) Go to a patron circulation page
3) Post form without a barcode
=> Check you go to circulation page with no patron selected
4) Set system preference CircAutoPrintQuickSlip to 'open a print quick slip window'
5) Go to a patron circulation page
6) Post form without a barcode
=> Check you go to print quick slip window with correct datas

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28927: (follow-up) remove rule on id=opacheader in opac CSS
Fridolin Somers [Wed, 8 Sep 2021 09:04:54 +0000 (23:04 -1000)]
Bug 28927: (follow-up) remove rule on id=opacheader in opac CSS

Actually this rule does nothing, it defines same background color as "body" : #fcf9fc

Test plan :
1) Without patch look at OPAC header
2) With patch OPAC header should have same background color

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28927: Fix id opacmainuserblock used twice in OPAC
Fridolin Somers [Tue, 31 Aug 2021 06:59:27 +0000 (20:59 -1000)]
Bug 28927: Fix id opacmainuserblock used twice in OPAC

Since preference OpacMainUserBlock is now an HTML customization,
there is actually an HTML tags with id="opacmainuserblock" and one with id="OpacMainUserBlock".
Same for OPACNavRight in opac-registration-confirmation.tt

This patch removed id from page to keep the one comming from HTML customization include.

Test plan :
1) Create an HTML customization for OpacMainUserBlock with some text
2) Go to OPAC main page
3) Check HTML code of the page
4) Check you see id="OpacMainUserBlock" once and not id="opacmainuserblock"
5) Same for id="opacnavright" in opac-registration-confirmation.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29025: Don't prefill userid and password in user creation form
Didier Gautheron [Wed, 15 Sep 2021 05:32:34 +0000 (07:32 +0200)]
Bug 29025: Don't prefill userid and password in user creation form

Recent Firefox versions try to prefill userid and password with
logged in user credentials.

To test
1 - Log in staff as user foo password bar
2 - Save user and password in Firefox
3 - Log out
4 - Log in again, log in pop-up must be pre-filled
5 - Open Create a new patron form
6 - At least password field is pre-filled with logged in user's credentials
7 - Apply patch
8 - Redo 4 and 5
9 - Userid and password fields aren't prefilled

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29019: Restore eval call
Jonathan Druart [Tue, 28 Sep 2021 10:43:07 +0000 (12:43 +0200)]
Bug 29019: Restore eval call

But fix it (pass an arrayref). We need the eval to catch possible errors.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29019: Unable to delete HTML customization
Owen Leonard [Thu, 23 Sep 2021 21:14:52 +0000 (21:14 +0000)]
Bug 29019: Unable to delete HTML customization

This patch makes some corrections to additional contents to allow
content to be deleted. The wrong parameter was being passed to the
script. The script was also not handling multiple deletions correctly.

The patch also adds a "category" parameter to the delete operation so
that the page is redirected correctly.

The patch also changes some strings which referred to "news"
referencing operations which might be performed on news or on HTML
customizations, e.g.:

"Are you sure you want to delete the selected content?" instead of "Are
you sure you want to delete the selected news?"

To test, apply the patch and go to Tools -> News.

- Create multiple news items if necessary.
- Test the "Delete" button corresponding to a single news item:
  - Clicking the button should ask you to confirm.
  - Check that the wording of the message is correct.
  - After confirming the news item should be deleted.
  - Ideally, test on news items which are on the second page of the
    DataTable of news items.
- Test the process of deleting multiple news items at once:
  - Check the checkbox next to multiple items.
  - Click the "Delete selected" button at the bottom of the page.
  - Check that the wording of the confirmation message is correct.
  - After you confirm, the items should be deleted.
- Repeat these tests under Tools -> HTML customizations to confirm that
  redirects work correctly. After deleting an HTML customization you
  should be redirected back to the list of HTML customizations.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29076: Fetch the zebraqueue entries when not confirm
Nick Clemens [Wed, 22 Sep 2021 12:02:43 +0000 (12:02 +0000)]
Bug 29076: Fetch the zebraqueue entries when not confirm

This patch remove a check for confirm when fetching the entries
for possible deletion from the zebraqueue

Without this we die when we try to access the entries for counting

To test:
1 - perl  misc/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 --list-invites --z3950 --logs 180 --mail 375 -v
2 - Dies
3 - Apply patch
4 - Repeat 1
5 - Success!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29073: DBRev 21.06.00.024
Jonathan Druart [Tue, 28 Sep 2021 13:11:24 +0000 (15:11 +0200)]
Bug 29073: DBRev 21.06.00.024

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate
Nick Clemens [Tue, 21 Sep 2021 15:15:15 +0000 (15:15 +0000)]
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate

DefaultHldexpirationDate is set in the pref screen to 'yes/no'

The code checks if the preference is 'true', 'no' is true

We should instead use 1/0

To test:
0 - Have a fresh devbox
1 - With syspref disabled, place a hold
2 - Note no expiration date set
3 - Enable the preference
4 - Place a hold and note the expiration date is set, good
5 - Disable the pref
6 - Place a hold and note the expiration date is set, bad
7 - Apply patch
8 - Update database
9 - Repeat 1-8, date not set when pref disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28534: DBRev 21.06.00.023
Jonathan Druart [Tue, 28 Sep 2021 13:10:20 +0000 (15:10 +0200)]
Bug 28534: DBRev 21.06.00.023

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28534: Atomic update to fix existing installs
Nick Clemens [Mon, 14 Jun 2021 12:41:50 +0000 (12:41 +0000)]
Bug 28534: Atomic update to fix existing installs

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28534: Fix engine for pending_offline_circulations table
Nick Clemens [Wed, 9 Jun 2021 13:46:16 +0000 (13:46 +0000)]
Bug 28534: Fix engine for pending_offline_circulations table

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 28534: (follow-up) Don't adjust original DB update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28803: (QA follow-up) Reinstate UNKNOWN_ERROR in templates
Martin Renvoize [Tue, 21 Sep 2021 16:08:22 +0000 (17:08 +0100)]
Bug 28803: (QA follow-up) Reinstate UNKNOWN_ERROR in templates

I can't see how this will ever get thrown, but as it's there we should
have the template handling included.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28803: (follow-up) Error details improvement
Martin Renvoize [Mon, 13 Sep 2021 09:18:46 +0000 (10:18 +0100)]
Bug 28803: (follow-up) Error details improvement

This patch updates the exceptions thrown by Koha::Email to include the
parameter that failed email validation and then updates the failure code
to include this parameter and finally display this field in the template.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28803: Add invalid email handling in _send_message_by_email
Martin Renvoize [Thu, 5 Aug 2021 07:00:19 +0000 (08:00 +0100)]
Bug 28803: Add invalid email handling in _send_message_by_email

This patch adds a try/catch block around the call to Koha::Email->create
to catch and handle invalid emails being passed in the parameters.

The message is marked as 'failed' with an error_code of 'INVALID_EMAIL'.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28803: Add unit tests
Martin Renvoize [Thu, 5 Aug 2021 07:43:32 +0000 (08:43 +0100)]
Bug 28803: Add unit tests

This patch updates Letters.t to confirm that invalid email addresses in
the message_queue should not throw an exception when sending mail but
instead set the status to failed and pass error details to the end user.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28870: non-FQDN addresses are valid
Jonathan Druart [Thu, 26 Aug 2021 15:21:32 +0000 (17:21 +0200)]
Bug 28870: non-FQDN addresses are valid

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28870: Use Email::Address->parse
Jonathan Druart [Thu, 26 Aug 2021 15:13:41 +0000 (17:13 +0200)]
Bug 28870: Use Email::Address->parse

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28870: Move email address validation to a specific class method
Jonathan Druart [Thu, 26 Aug 2021 15:12:58 +0000 (17:12 +0200)]
Bug 28870: Move email address validation to a specific class method

To ease testing and future changes if needed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28870: Remove traces of Email::Valid
Tomas Cohen Arazi [Fri, 20 Aug 2021 21:37:37 +0000 (18:37 -0300)]
Bug 28870: Remove traces of Email::Valid

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28870: Use Email::Address to validate email addresses
Tomas Cohen Arazi [Fri, 20 Aug 2021 21:23:30 +0000 (18:23 -0300)]
Bug 28870: Use Email::Address to validate email addresses

This patch adds a new dependency, Email::Address. It is used in
Koha::Email to replace the current use of Email::Valid, which proved to
be problematic when it comes to UTF-8 characters.

Email::Address provides suitable regexes that -when used- keep our
tests passing, but also deal better with UTF-8 data.

To test:
1. Apply the regression tests patch
2. Notice the only change is that it tweaks a couple addresses so they
   contain umlauts and also have the "Description <address>" format that
   is used when sending carts.
3. Run:
   $ kshell
  k$ prove t/Koha/Email.t
=> FAIL: Tests fail! Things die because Email::Valid doesn't like the
   from we passed.
4. Run:
   $ sudo apt install libemail-address-perl
5. Apply this patch
6. Repeat 3
=> SUCCESS: Tests pass!
7. Try what is described in comment 1
=> SUCCESS: Things are back to normal
8. Sign off :-D
9. Send cookies

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28870: Regression tests
Tomas Cohen Arazi [Fri, 20 Aug 2021 21:22:58 +0000 (18:22 -0300)]
Bug 28870: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28412: Add information about supported authentication methods
Tomas Cohen Arazi [Thu, 27 May 2021 20:02:35 +0000 (17:02 -0300)]
Bug 28412: Add information about supported authentication methods

This patch adds an initial text explaining the valid authentication
mechanisms Koha has for the API.

My first approach included information about the controlling sysprefs,
but I decided to remove it, as it is not usual for API consumers to be
presented such detailed internal information which is probably
confusing. We could add a link to the manual, but that's not the point I
think.

I've added an entry about error messages and how we thougth about them.
It is copied from Docker Engine's API docs.

This is my 2 cents.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28536: Move translatable strings into overdrive.js
Owen Leonard [Tue, 8 Jun 2021 15:03:29 +0000 (15:03 +0000)]
Bug 28536: Move translatable strings into overdrive.js

This patch takes strings defined as variables in opac-bottom.inc for use
in overdrive.js and moves them to overdrive.js, wrapped in the
double-underscore translation function.

To test you must have valid credentials entered in system preferences
for the OverDrive API. Ideally you should test using a patron who has
holds and current checkouts in OverDrive.

Apply the patch and log in to the OPAC.

- On the "Your summary" page, open the "OverDrive Account" tab.
  - Log in to your OverDrive account.
  - The contents of the tab should display correctly, with correct
    labels for controls like "Log out of your OverDrive account", "Check
    in", "On hold", etc.
- Perform a catalog search which will return results also found in your
  OverDrive collection.
  - Open the OverDrive results page.
  - The page should display correctly, with correct labels on controls
    like "Check out" and "Place hold."

To test that the correct strings are translatable. In this example I'm
testing fr-FR:

 - Update a translation:

  > gulp po:update
  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for the strings pulled from
  JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from bootstrap/js/overdrive.js for
  translation, e.g.:

  koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js:124
  msgid "OverDrive account page"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing)
- Install the updated translation:

  > perl translate install fr-FR

In the OPAC, switch to the language you're testing. Confirm that your
translated strings appear. In the above example, the string should
appear at the top of the "Overdrive Account" tab.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28356: Consolidate catalogue search box code
Nick Clemens [Fri, 14 May 2021 15:04:38 +0000 (15:04 +0000)]
Bug 28356: Consolidate catalogue search box code

To test:
1 - Apply patch
2 - Confirm searchign the catalog works from:
    Administration->Budgets
    Cataloging
    Circulation->Check in
    Administration->Cities and towns
    Acquisitions->{Vendor}->Contracts
    Administration->Currencies
    Administration->Circulation desks (requires  UseCirculationDesks preference)
    Home
    Tools->Notices and slips
    Patrons
    Adminstration
    Serials
    Acquisitions->Suggestions
    Administration->Z39.50/SRU servers

Signed-off-by: hakam <hakam@inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28022: Only show subfield "9" if subfield "a" is visible
Thomas Klausner [Mon, 29 Mar 2021 11:59:50 +0000 (13:59 +0200)]
Bug 28022: Only show subfield "9" if subfield "a" is visible

Amend the workaround (from but 2206) to only show subfield "9" in editor if
subfield "a" has the editor-visibility bit set.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28898: (follow-up) Add context to some more occurrences of Term in course reserves
Katrin Fischer [Sat, 28 Aug 2021 13:01:01 +0000 (15:01 +0200)]
Bug 28898: (follow-up) Add context to some more occurrences of Term in course reserves

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28898: (follow-up) Remove comment lines before PROCESS statements
Katrin Fischer [Sat, 28 Aug 2021 12:54:29 +0000 (14:54 +0200)]
Bug 28898: (follow-up) Remove comment lines before PROCESS statements

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28898: Context for translation: term (word) vs. term (semester)
Caroline Cyr La Rose [Wed, 25 Aug 2021 20:23:02 +0000 (16:23 -0400)]
Bug 28898: Context for translation: term (word) vs. term (semester)

This patch add context to the term Term in the context of course reserves.

To test:
0- Apply patch
Set up course reserves
1- Enable UseCourseReserves
2- Create at least one authorized value for DEPARTMENT
3- Create at least one authorized value for TERM
4- Create a course
5- Add at least one item to the course

Check the terms:
6- Go to the OPAC
7- Go to Course reserves
** 8- In the list of courses, check the Term column heading
9- Go to the staff interface
10- Go to Course reserves
** 11- In the list of courses, check the Term column heading
12- Click on the course name
** 13- Check the Term line in the course description

Add a new language (fr-CA in the example, change for whatever language code you want)
14- In a terminal, run
gulp po:create --lang fr-CA
15- Then, run
gulp po:update --lang fr-CA
16- In system preferences, enable the new language in language and OpacLanguages
17- Switch the language in staff interface and OPAC

Change the translations
18- In your favourite text editor, open fr-CA-messages.po
19- Find the string 'msgctxt Semester'
20- Enter a word in msgstr
21- Save the file
22- In a terminal, go to misc/translator
23- Run
./translate install fr-CA

Check the translations
24- Redo the steps to check the terms (6-16) and make sure the terms in steps 8, 11, and 13 are changed for the word you put in step 20.
25- Optionally, check the following pages to make sure the terms are not the word you put in step 20 (these pages shouldn't have been changed)
- opac-tags (your account > your tags)
- opac-authorities (search for an authority in Authority search)
- review (tags in staff interface)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28340: Alphabetise metadata for notices
Andrew Isherwood [Thu, 13 May 2021 09:31:08 +0000 (10:31 +0100)]
Bug 28340: Alphabetise metadata for notices

This commit sorts metadata by key prior to preparing a notice with it

Test plan:

- Do not apply patch
- Create a report with the following SQL:
  SELECT * FROM message_queue;
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is in random order

- Apply the patch
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is now sorted alphabetically by key

Signed-off-by: Jill Tivey <Jill.Tivey@sasa.gov.scot>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28340: Unit test
Nick Clemens [Fri, 30 Jul 2021 15:52:18 +0000 (15:52 +0000)]
Bug 28340: Unit test

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
JD amended patch: remove commented line

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27170: Fix bug fix
Andrew Isherwood [Fri, 18 Jun 2021 10:10:01 +0000 (11:10 +0100)]
Bug 27170: Fix bug fix

<sigh> This commit fixes the incorrect bug fix from the previous commit

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27170: Fix bug with undefined 'links'
Andrew Isherwood [Fri, 18 Jun 2021 09:59:01 +0000 (10:59 +0100)]
Bug 27170: Fix bug with undefined 'links'

If a row object doesn't have a 'links' property, calling 'length' on it
will fail. This commit fixes this.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27170: Add support for new 'links' property
Andrew Isherwood [Tue, 8 Dec 2020 12:21:43 +0000 (12:21 +0000)]
Bug 27170: Add support for new 'links' property

This commit adds support for the new 'links' property that will allow an
availability plugin to return an array of links for a result. These
links are parsed and appended to the title field of a results record.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24190: (QA follow-up) record unchanged bookfund and fix typo
Nick Clemens [Mon, 2 Aug 2021 13:44:31 +0000 (13:44 +0000)]
Bug 24190: (QA follow-up) record unchanged bookfund and fix typo

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24190: (follow-up) Rename AcqLog
Andrew Isherwood [Wed, 16 Jun 2021 13:27:30 +0000 (14:27 +0100)]
Bug 24190: (follow-up) Rename AcqLog

As requested in comment #49, renamed uses of AcqLog to AcquisitionLog

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
JD amended patch: replace one missing occurrence in Budgets.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24190: (follow-up) Modify order of logging
Andrew Isherwood [Mon, 26 Oct 2020 11:44:50 +0000 (11:44 +0000)]
Bug 24190: (follow-up) Modify order of logging

Basket creation involves two steps in Koha, creating the basket then
modifying its header. We were logging these two steps in the wrong
order. This commit fixes that.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24190: (follow-up) Add tests
Andrew Isherwood [Mon, 28 Sep 2020 14:12:45 +0000 (15:12 +0100)]
Bug 24190: (follow-up) Add tests

In response to Jonathan's request for tests, I have now added additional
tests for the methods in C4/Budgets.pm that do logging

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24190: (follow-up) Respond to QA feedback
Andrew Isherwood [Mon, 28 Sep 2020 09:41:16 +0000 (10:41 +0100)]
Bug 24190: (follow-up) Respond to QA feedback

This commit makes changes in response to Jonathan's feedback in comment

- Moved from using zero padded strings to store log data to a JSON
object
- Stopped storing formatted dates in logged data

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24190: (follow-up) Cancel order del item bug
Andrew Isherwood [Tue, 19 May 2020 11:06:47 +0000 (12:06 +0100)]
Bug 24190: (follow-up) Cancel order del item bug

If an order is cancelled but the associated bib / items are unable to be
removed, we go into error handling. We still need to log the
cancellation though. So this fix moves the logging to just after the
cancellation, so it will be logged regardless of the outcome with
associated things.

Signed-off-by: Maura Stephens <maura.stephens@gmit.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 24190: Add acquisition logging
Andrew Isherwood [Wed, 16 Jun 2021 13:22:30 +0000 (14:22 +0100)]
Bug 24190: Add acquisition logging

Signed-off-by: Maura Stephens <maura.stephens@gmit.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 22614: Migrate original request
Andrew Isherwood [Mon, 1 Apr 2019 13:09:10 +0000 (14:09 +0100)]
Bug 22614: Migrate original request

This patch changes an active request's backend and initiates the
migration on that request, rather than creating another and migrating
that.

The majority of the work to accomplish this bug is being carried out in
the backends, since Koha delegates migrations to them.

Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Assumpta Byrne <abyrne@ait.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29072: Move reference route /cities spec to YAML
Tomas Cohen Arazi [Tue, 21 Sep 2021 12:52:19 +0000 (09:52 -0300)]
Bug 29072: Move reference route /cities spec to YAML

This patch moves the /cities routes spec and related files into YAML so
devs can use it as a reference for future routes.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29032: Pre-load ILL backends to speed up response
Tomas Cohen Arazi [Wed, 15 Sep 2021 15:12:33 +0000 (12:12 -0300)]
Bug 29032: Pre-load ILL backends to speed up response

Bug 22440 will rewrite the route and make it even more efficient by
prefetching the related data instead of performing several queries in
loops.

In the meantime, we can make this controller perform better with a
simple intervention: load backends once, and use the
$request->_backend() setter to pre-set it before using the objects.

To test:
1. Perform any usual ILL requests listing, try having several
=> FAIL: Notice it takes a weird amount of time to load
2. Apply this patch
3. Restart all
4. Repeat 1
=> SUCCESS: It feels fast enough!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 17600: Fix overdrive_proxy and recordedbooks
Jonathan Druart [Mon, 20 Sep 2021 14:14:13 +0000 (16:14 +0200)]
Bug 17600: Fix overdrive_proxy and recordedbooks

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28972: Fix failing tests
Jonathan Druart [Mon, 20 Sep 2021 14:11:35 +0000 (16:11 +0200)]
Bug 28972: Fix failing tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 17600: Remove wrong C4::Context imports
Jonathan Druart [Mon, 20 Sep 2021 12:25:48 +0000 (14:25 +0200)]
Bug 17600: Remove wrong C4::Context imports

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28653: Add new method RefreshIssuesTable
Emmi Takkinen [Fri, 2 Jul 2021 12:05:27 +0000 (15:05 +0300)]
Bug 28653: Add new method RefreshIssuesTable

On patrons check out or details page, after renewing
loans they don't sort correctly when clicking on "Date due"
tab. Page has to be reloaded so that sorting works.
This patch adds new method RefreshIssuesTable to
checkouts.js. When loans are renewed or checked in, issues
table is reloaded to and due dates are sorted correctly.

To test:
1. Add 3 loans for patron.
2. Change due dates so you they are e.g. 07/01, 07/02, 07/04
3. Make sure you have renewal period set e.g. 5 days and
check your RenewalPeriodBase syspref (I use current date there)
4. Renew loan with date due on 07/01, it should now be 07/07
5. Sort loans by date due
=> Note that order from top to bottom is 07/04->07/02->07/07
or 07/07->07/02->07/04, not 07/02->07/04->07/07 as one would
assume.
6. Apply patch and repeat.
=> Note that issues table is reloaded ("Loading..." pop-up is displayed)
and that due dates are in correct order.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: kelly <kelly@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 28653: (QA follow-up) Remove debug message used during development

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 18747: Select All in Add Patron Option in Patron Lists only selects the first...
Owen Leonard [Fri, 27 Aug 2021 16:06:02 +0000 (16:06 +0000)]
Bug 18747: Select All in Add Patron Option in Patron Lists only selects the first 20 entries

This patch corrects the JavaScript functions for the "select all" and
"clear all" action when viewing patrons in a list. Before this
correction, checkboxes which were previously in hidden table rows would
not be checked.

To test, apply the patch and go to Patrons -> Patron Lists

- View a patron list
- If necessary, add multiple patrons to the list so that the number
  exceeds 20.
- Change the number of entries shown by the DataTable: Show [ 50 ]
  entries.
- Click "Select all." All visible checkboxes should be checked.
- Click "Clear all." All checkboxes should be unchecked.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28992: Resolve warning on BIG_LOOP
Marcel de Rooy [Fri, 10 Sep 2021 07:39:40 +0000 (07:39 +0000)]
Bug 28992: Resolve warning on BIG_LOOP

Argument "" isn't numeric in numeric gt (>) at
/usr/share/koha/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/
addbiblio.tt line 896.

Came across it when testing 28608. Could have been a QA follow-up.

Test plan:
If you run QA tools on this patch, you should see the warning only
when processing files before patches.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28972: DBIC schema changes
Jonathan Druart [Mon, 20 Sep 2021 12:02:15 +0000 (14:02 +0200)]
Bug 28972: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28972: DBRev 21.06.00.022
Jonathan Druart [Mon, 20 Sep 2021 12:01:08 +0000 (14:01 +0200)]
Bug 28972: DBRev 21.06.00.022

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28972: Make DB rev idempotent
Jonathan Druart [Mon, 20 Sep 2021 11:57:06 +0000 (13:57 +0200)]
Bug 28972: Make DB rev idempotent

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28972: Add missing foreign key constraints to holds queue table
Kyle M Hall [Wed, 8 Sep 2021 12:02:05 +0000 (08:02 -0400)]
Bug 28972: Add missing foreign key constraints to holds queue table

The table tmp_holdsqueue is missing a couple key constraints that should
be there, one for biblio and one for borrowers.

Test Plan:
1) "SHOW CREATE TABLE tmp_holdsqueue;" should show no FKs for biblio or borrowers
2) Apply this patch
3) Run updatedatabase.pl
4) "SHOW CREATE TABLE tmp_holdsqueue;" should now show FKs for biblio or borrowers

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28316: (QA follow-up) Make clean_search_term public
Martin Renvoize [Wed, 1 Sep 2021 14:58:04 +0000 (15:58 +0100)]
Bug 28316: (QA follow-up) Make clean_search_term public

With all the work that's gone into improving the internal
_clean_search_term method I feel we should expose it publically as it's
going to be more widely helpful

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28316: escape ES ranges if QueryAutoTruncate is enabled
Petro Vashchuk [Mon, 6 Sep 2021 13:46:45 +0000 (16:46 +0300)]
Bug 28316: escape ES ranges if QueryAutoTruncate is enabled

if QueryAutoTruncate enabled we will have any special operators ruined
for example: "test [6 TO 7]" will be converted to "test* [6* TO* 7]"
so no reason to keep ranges when QueryAutoTruncate set to "enabled"

1) enable QueryAutoTruncate at your sysprefs.
2) perform a search using range, for example: "[1999 TO 2020]",
it shouldn't work the way it's supposed to.
3) apply the patch.
4) perform the same search with range, ensure that it works correctly.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28316: avoid messing up regexes in the search queries
Petro Vashchuk [Mon, 14 Jun 2021 13:38:51 +0000 (16:38 +0300)]
Bug 28316: avoid messing up regexes in the search queries

This patch ensures that the behavior with
QueryRegexEscapeOptions set to values other than
"Escape" still will works as expected.

It does so by storing the contents of regexes
before escaping special characters and
then restores the contents of regexes back to how
it was before, ensuring that searching with regex is possible.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28316: escape exclamation signs in the query
Petro Vashchuk [Fri, 18 Jun 2021 07:44:56 +0000 (10:44 +0300)]
Bug 28316: escape exclamation signs in the query

Currently having exclamation sign at the end of the query makes ES
search fail, and when you try to search for a book that has exclamation
sign in the tittle (something like "Words! words") won't show results
correctly as it tries to negate everything that is after exclamation
sign, making it impossible to search for books that have in in the title

This patch escapes exclamation signs if it's at the end of the query or
has a space after it, resolving both of the issues listed above.

To reproduce:
1) with ES enabled, search for the book with title that contains
exclamation sight at the end, like "book!", this search should result
 in error.
2) do another search, but this time find/prepare beforehand book with a
title that has exclamation sign with a space after it,
e.g "exclamation! sign", it shouldn't find it as ES treats everything
after that exclamation sign as negation.
2) apply the patch.
3) perform searches from the steep one and two again.
Search from step one should no longer fail, while search from the step
two should find that book.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28316: escape brackets in the search query
Petro Vashchuk [Tue, 13 Jul 2021 09:13:03 +0000 (12:13 +0300)]
Bug 28316: escape brackets in the search query

This patch screens square and curly brackets which have no special
language meaning.

To reproduce:
1) using ES, search for the book with title that contains
square and/or curly brackets, like "book [second edition]", which will
result in error.
2) apply the patch.
3) search for that book again, ensure that it works now.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28316: screen unquoted semicolons and all followup colons
Petro Vashchuk [Fri, 18 Jun 2021 07:43:14 +0000 (10:43 +0300)]
Bug 28316: screen unquoted semicolons and all followup colons

Currently searches like: "book:", ":book" and "host-item:test:n"
cause internal server errors.

This patch adds additional regexes that remove the colons at the start
and end of the query, and another regex that screens all follow-up
colons that go after the first colon to avoid errors when searching for
"host-item:test:n".

To reproduce:
1) using ES, search for the book with title that contains
semicolon at the start or at the end of the line, separated with spaces,
this should cause internal server error.
2) try doing the same with something like "host-item:test:n", it should
result in error as well.
3) apply the patch.
4) repeat steps 1-2, ensure that it works now.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28316: add tests
Petro Vashchuk [Tue, 15 Jun 2021 07:40:27 +0000 (10:40 +0300)]
Bug 28316: add tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28985: Force positive numbers for itemtype charge fields
Nick Clemens [Fri, 10 Sep 2021 12:12:07 +0000 (12:12 +0000)]
Bug 28985: Force positive numbers for itemtype charge fields

This patch adds a min attribute to the fields on this page and adds
other cost related fields to validator

To test:
1 - Apply patch
2 - Browse to Administration->Item types
3 - Edit or create an item type
4 - Attempt to place a negative or non numeric value in:
    Daily rental charge
    Hourly rental charge
    Default replacement cost
    Processing fee
5 - You should not be able to

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28847: Remove dead code and make regex consistent
Nick Clemens [Mon, 13 Sep 2021 11:53:39 +0000 (11:53 +0000)]
Bug 28847: Remove dead code and make regex consistent

This updates the regex code to match throughout the routine and removes
code that would no longer be reached.

Note that the code to update library name in the query descruiption was
broken before this patch, so removal does not change behaviour

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28847: (follow-up) Handle branch_group_limit
Nick Clemens [Sat, 11 Sep 2021 15:12:31 +0000 (15:12 +0000)]
Bug 28847: (follow-up) Handle branch_group_limit

To test:
1 - Create a library group as an OPAC search group
2 - Enable OpacAddMastheadLibraryPulldown
3 - Browse to:
    http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=t&branch_group_limit=multibranchlimit-1&weight_search=1
4 - Confirm search works and returns correct results
5 - Confirm dropdown is correctly populated

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28847: Only apply JS to branch/multibranch selection if there are search groups
Nick Clemens [Fri, 13 Aug 2021 19:48:48 +0000 (19:48 +0000)]
Bug 28847: Only apply JS to branch/multibranch selection if there are search groups

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28847: Cleanup of branch limitsand fix OPAC_SEARCH_LIMIT
Nick Clemens [Thu, 12 Aug 2021 11:13:46 +0000 (11:13 +0000)]
Bug 28847: Cleanup of branch limitsand fix OPAC_SEARCH_LIMIT

The opac had 'branch_group_limit' parameters which can be simplified to more
closely match intranet code.

Adjust C4::Auth for chaneg above to ensure dropdowns correctly populate

Expand JS to prevent selection of single and multibranch limits

To test:
1 - Enable OpacAddMastheadLibraryPulldown system preference
2 - Ensure branches and groups show as before patch
3 - Ensure single and multibranch limits from masthead apply as expected
4 - Test advanced search page, ensure you cannot select both single and multibranch limit
5 - Follow test plan on 28845 - ensure multibranch limit still correctly pre-selected

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28847: Unit tests
Nick Clemens [Thu, 12 Aug 2021 11:11:54 +0000 (11:11 +0000)]
Bug 28847: Unit tests

Note: tests are very similar between ES and Zebra, however, ES requires the uppercase
OR and doesn't use '=' in the same way. I feel having test coverage in each module is fair and more future
proof in case of changes to search engine

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28847: Move SearchLimitLibrary code to QueryBuilder Modules
Nick Clemens [Thu, 12 Aug 2021 11:02:39 +0000 (11:02 +0000)]
Bug 28847: Move SearchLimitLibrary code to QueryBuilder Modules

This patch removes the code from the search scripts into QueryBuilder
modules.

To test:
1 - Have a library group defined as a search group for both staff and opac
2 - Search on staff client and opac with that group limit and a single branch limit
3 - Note your results/counts
4 - Note the visuals of the search description
5 - Apply patch
6 - Repeat searches
7 - All should work as before

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 21093: In additem.pl set the right stickyduedate for fast add
Lucas Gass [Tue, 7 Sep 2021 22:37:39 +0000 (22:37 +0000)]
Bug 21093: In additem.pl set the right stickyduedate for fast add

To test:
-1 Set the specify due date option to a date, don't check the checkbox
-2 Enter an unknown barcode
-3 Click on fast add
-4 Add a record
-5 Add an item (don't change the barcode!)
-6 The item is checked out to the patron
-7 Verify: The checkbox is "Remember for session" is checked now
-8 APPLY patch
-9 Do steps 1-6 again, this time "Remember for session" should be unchecked
-10 Do steps 1-6 again but this time do check the "Remember for session" checkbox.
-11 It should be properly checked

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28464: Remove useless check that gives the incorrect error message
Kyle M Hall [Wed, 26 May 2021 15:16:13 +0000 (11:16 -0400)]
Bug 28464: Remove useless check that gives the incorrect error message

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28464: Add unit tests
Kyle M Hall [Wed, 26 May 2021 15:13:44 +0000 (11:13 -0400)]
Bug 28464: Add unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 28464: (QA follow-up) Correct test plan

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28228: Supress plugin related error message
Kyle M Hall [Tue, 30 Jun 2020 16:20:39 +0000 (12:20 -0400)]
Bug 28228: Supress plugin related error message

Use of uninitialized value in subroutine entry at /usr/share/koha/lib/Koha/Plugins/Base.pm line 182.

Test Plan:
1) Install the Kitchen Sink plugin ( it does not have a max versio defined )
2) Note the warning in your logs
3) Apply this patch
4) Restart all the things
5) No warning!

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28914: Fix wording in authentication forms
Fridolin Somers [Fri, 27 Aug 2021 18:37:03 +0000 (08:37 -1000)]
Bug 28914: Fix wording in authentication forms

In most authentication forms we see :
Fields "Login:" and "Password:" with a submit button "Log in".

In some places submit button contains "Login", which is confusing for translation.
It is not correct according to terminology https://wiki.koha-community.org/wiki/Terminology#L
Also in opac-user.pl ":" is missing, it generates new translation entries.

Test plan:
1) Log out if you are logged in
2) Go to staff interface
3) Check you see button "Log in"
4) Go to OPAC page /cgi-bin/koha/opac-user.pl
5) Check you see fields "Login:" and "Password:"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28829: Remove single quote escaping in value_builder/unimarc_field_4XX.pl
Fridolin Somers [Sat, 7 Aug 2021 02:02:09 +0000 (16:02 -1000)]
Bug 28829: Remove single quote escaping in value_builder/unimarc_field_4XX.pl

Since Bug 23777 added To.json, single quote escaping in value_builder/unimarc_field_4XX.pl is useless.

Test plan:
1) Use UNIMARC database
2) Define value builder unimarc_field_4XX on 463$t
3) Create a record B1 with 200$a : L'avion
4) Create a record B2
5) Click on value builder in 463$t
6) Search for record B1
7) Click on "Choose"
=> Without patch 463$t contains : L\'avion
=> With patch 463$t contains : L'avion

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28472: (follow-up) add unit test for the case where location = NULL
Andreas Roussos [Fri, 17 Sep 2021 13:51:51 +0000 (15:51 +0200)]
Bug 28472: (follow-up) add unit test for the case where location = NULL

This patch adds an extra unit test, to cover the case where the
UpdateItemLocationOnCheckin System Preference is set to "_ALL_: CART"
and the item being returned has no shelving location set.

Test plan:

1) Apply the patch provided earlier
2) prove -v t/db_dependent/Circulation/issue.t
   ...and sign off if all tests pass.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
JD amended patch: use 'is' instead of 'ok'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28472: handle items with NULL shelving location
Andreas Roussos [Fri, 2 Jul 2021 11:12:21 +0000 (13:12 +0200)]
Bug 28472: handle items with NULL shelving location

The UpdateItemLocationOnCheckin System Preference can be set to update the
location of ALL items during check in, regardless of their shelving location.
However, this does not currently work 100% as it is excluding items with no
shelving location (i.e. value of NULL in the corresponding database field).

This patch, based on the comment made by Nick Clemens, fixes that.

Test plan (based on the original Bug Description by Andrew Fuerste-Henry):

1) Have a shelving location CART
2) In UpdateItemLocationOnCheckin, enter "_ALL_: CART" (without the quotes)
3) Check in an item that has a shelving location, confirm it changes to CART
4) Check in an item with a NULL shelving location, confirm it doesn't go to CART
5) Apply this patch
6) Repeat step 4): this time the item should move to the CART shelving location

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28986: Remove (All) notation to correctly select rule for editing
Nick Clemens [Thu, 9 Sep 2021 15:21:10 +0000 (15:21 +0000)]
Bug 28986: Remove (All) notation to correctly select rule for editing

This patch updates the JS comparison code to remove the '(All)' hint before comparing
to the current value

To test:
1 - Go to Administration -> Item types
2 - Edit a type to have a parent of another type
3 - Go to Administration -> Circulation and fines rules
4 - Add a rule for all categories for the child itemtype
5 - Add a rule for all categories for the parent itemtype
6 - Click edit on child type, note itemtype dropdown in editor correctly selected
7 - Click edit on parent type - note itemtype dropdown menu refers to 'All' itemtypes
8 - Apply patch
9 - Reload page and edit parent type rule
10 - Itemtype dropdown is correctly populated

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28845: (follow-up) Retain selection when using advanced search
Nick Clemens [Tue, 7 Sep 2021 11:57:48 +0000 (11:57 +0000)]
Bug 28845: (follow-up) Retain selection when using advanced search

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28845: Match against the full limit string, not just the group id
Nick Clemens [Wed, 11 Aug 2021 15:30:36 +0000 (15:30 +0000)]
Bug 28845: Match against the full limit string, not just the group id

To test:
1 - Add to OPAC virtual host in apache conf:
   SetEnv OPAC_SEARCH_LIMIT branch:multibranch-1
   SetEnv OPAC_LIMIT_OVERRIDE 1
   RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT branch:multibranchlimit-1"
   RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1"
2 - Enable system preference OpacAddMastheadLibraryPulldown
3 - Create a library group enabled as OPAC search group (or make sure existing group 1 is an OPAC search group)
4 - Load the opac - dropdown does not pree-select the search group
5 - Apply patch
6 - Relaod opac - group is pre-selected!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28676: Cache and retrieve match_count when searching a cached heading
Nick Clemens [Wed, 7 Jul 2021 15:39:43 +0000 (15:39 +0000)]
Bug 28676: Cache and retrieve match_count when searching a cached heading

We use match_count to determine if a new authority record should be created, however,
we were not adding this count to the cache, so if a record returned too many matches on first
lookup, we would create a new record on the second lookup

To test:
1 - Set Linker Module to 'Default'
2 - Enable  AutoCreateAuthorities  and  BiblioAddsAuthorities and  CatalogModuleRelink and LinkerRelink
3 - Add two copies of a single authority via Z39
4 - Add two headings for that authority to a bib record (e.g. a 610 and 710)
5 - Save the record and note a new authority is generated
6 - Repeat and see another is generated
7 - Apply patch
8 - Restart all the things
9 - Save the record again, no new authority created

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28676: Unit test
Nick Clemens [Wed, 7 Jul 2021 15:39:21 +0000 (15:39 +0000)]
Bug 28676: Unit test

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28960: Explicitly call get_column
Martin Renvoize [Tue, 7 Sep 2021 11:14:03 +0000 (12:14 +0100)]
Bug 28960: Explicitly call get_column

This patch adds get_column to ensure we are returning a string value of
a field rather than accidentally triggering a relationship accessor.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 17600: Fix opac/svc/overdrive
Jonathan Druart [Tue, 14 Sep 2021 16:22:13 +0000 (18:22 +0200)]
Bug 17600: Fix opac/svc/overdrive

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28946: (bug 23271 follow-up) Missing occurrence in add_user_search.pl
Jonathan Druart [Fri, 10 Sep 2021 08:03:05 +0000 (10:03 +0200)]
Bug 28946: (bug 23271 follow-up) Missing occurrence in add_user_search.pl

commit f6e0b04f48e8f0a02dbb8d48152646257d9accba
Bug 23271: Replace search_limited with search_with_library_limits

We were modifying the occurrences of:
  Koha::Patron::Categories->search_limited;
with:
  Koha::Patron::Categories->search_with_library_limits;

But between the patch submission and the push, another occurrence has
been added by bug 23590.

Test plan:
Create a new suggestion from staff and click "select manager"
Without the patch, notice the error:
  The method Koha::Patron::Categories->search_limited is not covered by tests!
With the patch applied everything is working correctly

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28921: Remove warning from html_helpers.inc
Didier Gautheron [Mon, 30 Aug 2021 14:26:05 +0000 (16:26 +0200)]
Bug 28921: Remove warning from html_helpers.inc

Argument "" isn't numeric in numeric gt (>) at /home/koha/src/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc line 23.

To test:
1 - Open OPAC main page
2 - Check opac-error.log or plack-opac-error.log for message as above
3 - Apply patch
4 - Open OPAC main page
5 - Check opac-error.log again, there should be no more warnings

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>