koha.git
3 years agoBug 24473: Add $raw filter for Syndetics content
Lucas Gass [Tue, 21 Jan 2020 17:53:09 +0000 (17:53 +0000)]
Bug 24473: Add $raw filter for Syndetics content

Syndetics offers enhanced content in the OPAC under the tabs 'Title Notes',
'Excerpt', 'About the author', 'Editions'. They provide this info as HTML
therefore we should filter it as $raw so the content shows up without the markup.

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6b9572e0c8fb9f1ad1e60ed5db50e69c60ac1a00)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25862: Prevent TinyMCE to mangle local url links
Didier Gautheron [Wed, 24 Jun 2020 14:03:16 +0000 (16:03 +0200)]
Bug 25862: Prevent TinyMCE to mangle local url links

To test:
1 create a report 1 if it doesn't exist
2 open /cgi-bin/koha/tools/koha-news.pl
3 create a news
4 add a HTML link with Insert/Edit link tinyMCE dialog box to
  /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1"
5 save
6 on the main page "report 1" link returns a 404 error

Apply patch
7 Modify news' URL
8 Test it works in: tools/koha-new.pl admin/branches.pl and admin/preferences.pl

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2fbe775070637ebdddcc9ea0b455e80dbb85a83d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 24379: Fix failing tests
Jonathan Druart [Mon, 20 Jul 2020 13:16:29 +0000 (15:16 +0200)]
Bug 24379: Fix failing tests

kohadev-koha@kohadevbox:/kohadevbox/koha$ prove t/db_dependent/Koha/Patrons/Import.t
t/db_dependent/Koha/Patrons/Import.t .. 2/159
 #   Failed test 'No warning raised by import_patrons'
 #   at t/db_dependent/Koha/Patrons/Import.t line 171.
 # found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
 # found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
 # didn't expect to find a warning
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
t/db_dependent/Koha/Patrons/Import.t .. 152/159 # Looks like you failed 1 test of 159.
t/db_dependent/Koha/Patrons/Import.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/159 subtests

Test Summary Report
-------------------
t/db_dependent/Koha/Patrons/Import.t (Wstat: 256 Tests: 159 Failed: 1)
  Failed test:  39
  Non-zero exit status: 1
Files=1, Tests=159,  3 wallclock secs ( 0.04 usr  0.01 sys +  2.11 cusr  0.24 csys =  2.40 CPU)
Result: FAIL

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 24379: DBIC changes
Lucas Gass [Fri, 24 Jul 2020 22:13:12 +0000 (22:13 +0000)]
Bug 24379: DBIC changes

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 24379: DBRev 20.05.02.001
Lucas Gass [Fri, 24 Jul 2020 21:55:44 +0000 (21:55 +0000)]
Bug 24379: DBRev 20.05.02.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 24379: Make login_attempts not nullable
Nick Clemens [Wed, 8 Jan 2020 20:59:38 +0000 (20:59 +0000)]
Bug 24379: Make login_attempts not nullable

While the column defaults to 0 in Koha::Object->store we set to NULL if NULLABLE

When trying to reset a patrons password we check that the account is not administratively locked:
login_attempts != -1

This query does not return rows where login_attempts IS NULL. It will return accounts where login_attempts = 0

Let's default to 0 like we intend

To test:
1 - Create a new patron
2 - Note their login_attempts is NULL
    SELECT login_attempts FROM borrowers ORDER BY borrowernumber DESC LIMIT 1
3 - Enable  OpacResetPassword
4 - Attempt to reset password before logging in, you cannot
5 - Apply patch, updatedatabase, restart_all, update schema
6 - Create another patron
7 - Their login attempts should be 0
8 - Attempt to reset password, it works!

Bug 24379: Fix the test

First we create a patron using TestBuilder to get a hashref of valid
info. Then we delete it and create a new patron using Koha::Patron->new
Once stored, we should call discard_changes to make the calculated
values available in the currenct object.

Bug 24379: Don't drop default of 0 for login attempts

When moving the column we drop the default, this means that DBs upgraded form earlier versions
get the wrong values set

To test:
1 - Checkout 16.11.x
2 - Reset all
3 - Checkout master
4 - updatedatabase
5 - SHOW CREATE TABLE borrowers;
6 - Note the column login_attempts defaults to NULL
7 - Apply patch(es)
8 - Repeat
9 - Now it defaults ot 0 (and has NOT NULL if applied all)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7bb31cffae27dc398a7b4a4decf3623ec65478ac)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25868: Fix transfers page to show effective itemtype
Fridolin Somers [Wed, 24 Jun 2020 15:05:30 +0000 (17:05 +0200)]
Bug 25868: Fix transfers page to show effective itemtype

In transfers page /cgi-bin/koha/circ/branchtransfers.pl :
Itemtype is always from biblioitems.itemtype, regardless of system preference item-level_itypes.

Patch also changes template to use the object Koha::Item.

Patch also fixes a small typo : closed <form> tag.

Test plan :
1) Test with both values of system preference 'item-level_itypes'
2) Go to Circulation > Transfert
3) Enter a barcode
4) Enter another barcode
5) Check you see in table all datas and that 'Item type' is correct

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e441cb35fb13670e65b9437706561c17d1311945)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25869: Fix Coce display for lists
Nick Clemens [Wed, 24 Jun 2020 16:17:19 +0000 (16:17 +0000)]
Bug 25869: Fix Coce display for lists

To test:
1 - Enable Coce for Opac
    CoceHost: https://coce.bywatersolutions.com
    CoceProviders: Select all
    OpacCoce: Enable
2 - Do a search on the Opac, confirm you see some covers
3 - Add some of the items with covers to a public list
4 - View the public list
5 - Note no covers display
6 - Apply patch
7 - Success!

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>
(cherry picked from commit f77a377c939080eed36401746b5d722c91ee964b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25950: Remove <client> in X-Forwarded-For from proxy tests
David Cook [Wed, 8 Jul 2020 07:10:50 +0000 (07:10 +0000)]
Bug 25950: Remove <client> in X-Forwarded-For from proxy tests

This patch removes the <client> ip address in the X-Forwarded-For
header from being tested against koha_trusted_proxies.

Without this patch, REMOTE_ADDR will be set to null, if the <client>
ip address matches against koha_trusted_proxies.

To Test:
1. Run the unit test t/Koha/Middleware/RealIP.t

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7b84fda33b23347846ae50016f1e4b38b0fd95f4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25726: make holds to pull ignore holds where found is not null and itemnumber...
Andrew Fuerste-Henry [Fri, 12 Jun 2020 13:51:16 +0000 (13:51 +0000)]
Bug 25726: make holds to pull ignore holds where found is not null and itemnumber is null

To test:
1- place 2 bib-level holds on available items
2- confirm they both show on Holds to Pull
3- edit one hold from the database to set found='T'
4- reload Holds to Pull, confirm it is now empty
5- apply patch
6- Reload Holds to Pull
7- confirm it now shows the hold you did not edit

Signed-off-by: donnab <donna@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Using capitals for SQL reserved words; added a FIXME
Tested with:
    update reserves set found='T', itemnumber=NULL where reserve_id=...
This should be a workaround while we fix the underlying problem.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25944: Schema fix for illrequests route
Martin Renvoize [Tue, 7 Jul 2020 08:27:48 +0000 (09:27 +0100)]
Bug 25944: Schema fix for illrequests route

The illrequests path was missing the `comments` and `status_alias`
embedable relations in the path specification.

Test plan:
1/ Ensure you have the latest Mojolicious + OpenAPI modules installed.
2/ Navigate to the ill requests page and note that the table is empty.
3/ Note that under the networking tab in your browsers developer tools
that the api call fails with a 400 error.
4/ Apply the patch
5/ Refresh the page
6/ The table should now load and the api route should return a proper
200 response.
7/ Signoff

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Applied the patch to a production server that was having the 400
error on the main ILL page, and the error was gone.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40ab030060d6cbacb0be9df981fb28a6ade705ea)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25566: Add option to ignore found holds and use it when checking high holds
Nick Clemens [Thu, 21 May 2020 13:41:23 +0000 (13:41 +0000)]
Bug 25566: Add option to ignore found holds and use it when checking high holds

To test:
 1 - Find or create a record with 10 items
 2 - Set sysprefs:
     decreaseLoanHighHolds - enable
     decreaseLoanHighHoldsDuration - 2
     decreaseLoanHighHoldsValue - 2
     decreaseLoanHighHoldsControl  - 'over the number of holdable items'/dynamic
 3 - Set circ rules to allow 1 hold per record on the relevant record
 4 - Place 3 holds on the record
 5 - Check one item in and confirm hold to set to waiting
 6 - Issue to the patron with the waiting hold
 7 - Get a notice that loan period is decreased
 8 - Don't confirm the checkout
 9 - Apply patch
10 - Restart all the things
11 - Repeat checkout, no decrease this time!

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 96a871035043c7ffd93c61e756ee1ff89e3da0f0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25850: Add tests for weekday holidays
Martin Renvoize [Fri, 26 Jun 2020 15:24:00 +0000 (16:24 +0100)]
Bug 25850: Add tests for weekday holidays

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>
(cherry picked from commit 4ed4e468d2ceaf4502b817feb791656d5a159fa5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25850: (QA follow-up) use dt_from_string
Nick Clemens [Tue, 7 Jul 2020 12:05:42 +0000 (12:05 +0000)]
Bug 25850: (QA follow-up) use dt_from_string

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 92970a9abad312a07d9efba46cc57b27469a0509)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25850: (QA follow-up) Match logic in is_holiday
Martin Renvoize [Mon, 29 Jun 2020 08:54:58 +0000 (09:54 +0100)]
Bug 25850: (QA follow-up) Match logic in is_holiday

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit afd88e1d21a5cb5f2198c058144065b64098c124)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25850: Adapt day of week in Koha::Calendar::get_push_amt to 0..6 with 0 being...
Andreas Jonsson [Tue, 23 Jun 2020 13:57:29 +0000 (15:57 +0200)]
Bug 25850: Adapt day of week in Koha::Calendar::get_push_amt to 0..6 with 0 being Sunday.

1. Go to tools -> calendar and make sure Sundays are holidays by adding
   a holiday on a Sunday and selecting "Holiday repeated every same day
   of the week" and "Copy to all libraries" and save.
2. Go to administration -> system preferences and select "Use the
   calendar to push the due date to the next open matching weekday
   for weekly loan periods, or the next open day otherwise" for the
   system preference "useDaysMode" and save the system preferences.
3. Put the below code in a file name test.pl and execute it using
   the command "sudo koha-shell -c 'perl test.pl' kohadev"

   use Koha::Calendar;

   my $calendar = Koha::Calendar->new( branchcode => 'CPL' );
   $dt = DateTime->new(
       year       => 2020,
       month      => 06,
       day        => 21
   );

   print "This is a sunday: " .
   $dt->day_of_week . "\n";

   my $ndt = $calendar->next_open_days($dt, 0);

   print "This is a monday: " .
   $ndt->day_of_week . "\n";

4. Without the patch applied, this script
   will freeze after printing "This is a
   sunday ...".  Abort using ctrl-c.
5. Apply patch and run the script again.
   The test script will now complete.

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>
(cherry picked from commit 25127f422821756b030b8f377b3e112b907be5eb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25850: Regression Test
Martin Renvoize [Fri, 26 Jun 2020 15:52:50 +0000 (16:52 +0100)]
Bug 25850: Regression Test

This patch adds a unit test to test for an infinite loop as highlighted
by the bug.

Test plan
1/ Run the test before applying the fix
2/ The test should fail for 'Sundays'
3/ Apply the subsquent patch
4/ Re-run the test
5/ It should now pass

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>
(cherry picked from commit 95c8d19530e8bef20e02be0b74d7927764bf7ed1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25992: Make SIP2 logger subroutines exportable to prevent crash
Joonas Kylmälä [Wed, 15 Jul 2020 11:08:32 +0000 (11:08 +0000)]
Bug 25992: Make SIP2 logger subroutines exportable to prevent crash

If the subroutines are not exportable we get the following crash:

> Undefined subroutine &C4::SIP::SIPServer::set_logger

To test:
 In kohadevbox run for example:
 $ ps -aux # check that no existing sip server is running, kill the process if exists
 $ perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
 $ koha/misc/sip_cli_emulator.pl -su koha -sp koha -l CPL -a 127.0.0.1 -p 6001 --item 3999900000001 -m item_information

 After applying this patch the Undefined subroutine error should be gone.
 Note: when using the sip_cli_emulator.pl the credentials can be anything.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25964: Prevent data loss when editing items from a MARC record
Jonathan Druart [Thu, 9 Jul 2020 08:52:11 +0000 (10:52 +0200)]
Bug 25964: Prevent data loss when editing items from a MARC record

Coming from:
  Bug 23463: Use new method Koha::Object->set_or_blank

We have DB fields that are not mapped with MARC fields, for instance paidfor. They are not handled correctly.

In ModItemFromMarc, we get a MARC record in parameter and update the item in DB. But we are loosing the fields that are not in the MARC record

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 189851fb9bbc831bb2875c2c440877c2562583d0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25443: (follow-up) surround strings with <span>
Bernardo Gonzalez Kriegel [Sun, 24 May 2020 11:51:27 +0000 (08:51 -0300)]
Bug 25443: (follow-up) surround strings with <span>

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 46d3ec264c4e46cc73ee1713b5c39e6c564e5a1a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25443: Improve translation of 'Select the record to link%s to'
Katrin Fischer [Sun, 24 May 2020 00:04:03 +0000 (02:04 +0200)]
Bug 25443: Improve translation of 'Select the record to link%s to'

Before this patch the title was set in italic, which caused the
translation string to be cut off. Removing the italic formatting in
favor of quotes and splitting the string into 2 sentences (dealing
with title existing and not existing:

Select the host record to link to '[% bibliotitle | html %]'
Select the host record to link

To test:
- Activate EasyAnalyticalRecords system preference
- Search for a record in staff
- Use Edit > Link to host record
- Verify the text is shown as above with the reord's title
- The second case is a bit theoretical:
- Delete 245$a from the record or empty out biblio.title using SQL
- Verify the string still shows but without the 'to...' part.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d53b58cab858f06be7f9762b16b89c8bfbce5625)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25890: Update sorting column for checkouts table
Nick Clemens [Mon, 29 Jun 2020 11:04:59 +0000 (11:04 +0000)]
Bug 25890: Update sorting column for checkouts table

Test plan:
- Check some items out, all from different libraries
- Modify the checkout and due dates, like:
    2018-10-22
    2018-01-23
    2018-05-27
- Sort by checkout date, verify it is actually sorting on homebranch
- Apply patch
- Reload page
- Note you can now sort items correctly

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>
(cherry picked from commit 6250c2dc1556dbf0ef87f2bb36f13534cb2e2368)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25695: merge of similar code blocks after circulation_rules update
Slava Shishkin [Thu, 18 Jun 2020 09:11:29 +0000 (12:11 +0300)]
Bug 25695: merge of similar code blocks after circulation_rules update

In onboarding.pl we have second block with adding just one more
rule parameter (maxissueqty) which can be merged to first one
after all parameters now stored in circulation_rules table.

Also this eliminates the need of adding forgotten "warn $@" after
the second eval block.

Mentored-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5c581265abff940350df83a52228085aa0792fe0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoUpdate release notes for the 20.05.02 release v20.05.02
Lucas Gass [Wed, 22 Jul 2020 21:05:42 +0000 (21:05 +0000)]
Update release notes for the 20.05.02 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoIncrement version for 20.05.02 release
Lucas Gass [Wed, 22 Jul 2020 20:59:18 +0000 (20:59 +0000)]
Increment version for 20.05.02 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoTranslation updates for Koha 20.05.02
Koha translators [Wed, 22 Jul 2020 20:41:50 +0000 (17:41 -0300)]
Translation updates for Koha 20.05.02

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25914: Fix incorrect variable name causing relative's checkouts column to be...
Kyle M Hall [Thu, 2 Jul 2020 12:32:51 +0000 (08:32 -0400)]
Bug 25914: Fix incorrect variable name causing relative's checkouts column to be empty in OPAC

In the OPAC, the title column in the relatives checkouts table is always empty.

Test Plan:
1) Enable viewing of relative's checkouts in OPAC
2) Check some items out to a patron
3) Log into the OPAC as a relative of that patron that should be able to
   view them
4) Note the title column is empty in the relative's checkouts tab
5) Apply this patch
6) Reload the page
7) Titles should appear in the title column!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0b69ff1ed7a775b6fdca8513d1ec5a692e30bbe9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25752: Stay in cwd after koha-shell
Jonathan Druart [Mon, 15 Jun 2020 14:11:49 +0000 (16:11 +0200)]
Bug 25752: Stay in cwd after koha-shell

After bug 25538, after a koha-shell we are not longer in the current directory:

root@cec7bffd8100:koha(master)$ pwd
/kohadevbox/koha
root@cec7bffd8100:koha(master)$ sudo koha-shell kohadev
kohadev-koha@cec7bffd8100:~$ pwd
/var/lib/koha/kohadev

Test plan:
Repeat the commands above and confirm that with this version of the
script you get /kohadevbox/koha inside the koha-shell

Search for possible regressions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7555ecaafa3bd8bbf0514f3c2672cb41ff7e0aa7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25864: Lower case fields for searching
Nick Clemens [Wed, 24 Jun 2020 12:20:03 +0000 (12:20 +0000)]
Bug 25864: Lower case fields for searching

To recreate:
 1 - Have Koha using ES5 and Elasticsearch as search engine
 2 - Enable DumpTemplateVarsIntranet and DumpSearchQueryTemplate
 3 - Do a search in authorities using 'Search entire record' (abduction if using sample db)
 4 - Note no results
 5 - View the page source and find 'search_query'
 6 - Note the uppercased fields
 7 - curl 'es:9200/koha_kohadev_authorities/data/417?pretty'
 8 - Note all fields lower-cased
 9 - Apply patch
10 - Repeat search
11 - It works!

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2ab6018b6e14ae2153093db148f04f71405f4493)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25864: Unit test adjustment
Nick Clemens [Wed, 24 Jun 2020 12:22:48 +0000 (12:22 +0000)]
Bug 25864: Unit test adjustment

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 579a3c11edf77d36488f352d88ae373cc4cbfa21)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25851: DBRev 20.05.01.003
Lucas Gass [Fri, 17 Jul 2020 19:52:49 +0000 (19:52 +0000)]
Bug 25851: DBRev 20.05.01.003

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string
Jonathan Druart [Wed, 24 Jun 2020 06:37:18 +0000 (08:37 +0200)]
Bug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string

On the interface, if "Hold policy" is "Not set", the rule does not exist
in the table. We should reflect that during the update DB process.

Test plan:
1. Set "Hold policy" to "Not set"
2. Confirm that you can place holds
3. Confirm that the rule does not exist in the DB table
4. Set the value to an empty string (manually)
5. Confirm that you cannot longer place holds
6. Go to the circulation rules page and confirm that the value of "Hold
policy" is "Not set"
7. Execute the update DB entry
8. Confirm that you can place holds
9. Confirm that the rule does not exist in the DB table

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>
(cherry picked from commit c1e1c233ca69fe9f73efb1c939148f8c7afcf11e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 21395: Fix misc/admin/koha-preferences
Julian Maurice [Mon, 29 Jun 2020 13:23:35 +0000 (17:23 +0400)]
Bug 21395: Fix misc/admin/koha-preferences

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 21395: Fix C4/Barcodes/ValueBuilder.pm
Julian Maurice [Mon, 29 Jun 2020 13:13:10 +0000 (17:13 +0400)]
Bug 21395: Fix C4/Barcodes/ValueBuilder.pm

$DEBUG variable was always set to 0, so it was useless

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 21395: Ignore .perlcriticrc in t/Makefile.t
Julian Maurice [Mon, 29 Jun 2020 13:01:25 +0000 (17:01 +0400)]
Bug 21395: Ignore .perlcriticrc in t/Makefile.t

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 21395: Fix creation of PO file
Julian Maurice [Mon, 29 Jun 2020 12:57:11 +0000 (16:57 +0400)]
Bug 21395: Fix creation of PO file

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25440: Fixed list of 'show_rule' forming variables in the template
Andrew Nugged [Wed, 17 Jun 2020 20:18:01 +0000 (23:18 +0300)]
Bug 25440: Fixed list of 'show_rule' forming variables in the template

In smart-rules.tt we have `SET show_rule = ...` section which filled
with 'all used in the loop' variables. Because if historical reasons it
seems that there are some missing, few old, and even doubled ones.
This list is fixed now by:

  - variable names 'article_requests' and 'renewalsallowed' repeated
    so duplicates are removed;

  - 'hardduedatebefore' and 'hardduedateexact' not present in the whole
    site code anywhere anymore;
    IMPORTANT NOTE: these 'hardduedatebefore/hardduedateexact' also
                    exists as remnants in .po-translation files, a lot.

  - 'note', 'hardduedatecompare', 'renewalperiod', 'rentaldiscount'
    template variables were missing from this 'show_rule =' checking
    code so they are added.

Order of fields updated to match with above "SET field = ..." pack.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 25440: (QA follow-up) Correction for typo

'engthunit -> lengthunit

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d11e16aec74ad694bd56ce3810954091b0bf1259)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25440: Fix for "uninitialized $maxsuspensiondays" in smart-rules.pl
Andrew Nugged [Tue, 19 May 2020 08:20:41 +0000 (11:20 +0300)]
Bug 25440: Fix for "uninitialized $maxsuspensiondays" in smart-rules.pl

This warning emitted:

Use of uninitialized value $maxsuspensiondays in string eq
at /admin/smart-rules.pl line 257.

But that not just undef-warning, there is broken logic,
these two lines are mutually contradictory and goes one-by-one:

    $maxsuspensiondays = undef if $maxsuspensiondays eq q||;
    $maxsuspensiondays = '' if $maxsuspensiondays eq q||;

Fix is simple: to make it '' if it comes undef.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cb09303e11b11de2b25852a707211a054fb2b8e1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25440: Fix for "uninitialized value in string eq" in smart-rules.pl
Andrew Nugged [Tue, 19 May 2020 08:03:13 +0000 (11:03 +0300)]
Bug 25440: Fix for "uninitialized value in string eq" in smart-rules.pl

This warning emitted:

Use of uninitialized value in string eq at /admin/smart-rules.pl line 289.

It is solved by one line added to exclude comparison with 'on' string
when variable is 'undef'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5eebfcf68747b4886b23a9d4c8df37ea7d103edb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25440: Fix for "uninitialized value in hash" warning in smart-rules.pl
Andrew Nugged [Sun, 10 May 2020 15:18:35 +0000 (18:18 +0300)]
Bug 25440: Fix for "uninitialized value in hash" warning in smart-rules.pl

This warning emitted:

Use of uninitialized value in hash element
at /admin/smart-rules.pl line 569.

that happened because we have NULLs in SQL results for 'categorycode'
and 'itemtype' which later used as 'any' kind of category/item in the
template, so for the template it passed this way:

    $rules->{ $r->{categorycode} }->{ $r->{itemtype} }->...

but undef will stringify as "" to become a hash key ("Hashes are
unordered collections of scalar values indexed by their associated
string key" https://perldoc.perl.org/perldata.html),

that's why "undef warning". To prevent warning here is the simple fix:

    $rules->{ $r->{categorycode} // '' }->{ $r->{itemtype} // '' }->...

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b48162f1be1853a89e0ffc898bc0927edef93f95)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25440: Fix for "CGI::param called in list context" in smart-rules.pl
Andrew Nugged [Sun, 10 May 2020 10:28:40 +0000 (13:28 +0300)]
Bug 25440: Fix for "CGI::param called in list context" in smart-rules.pl

This warning emitted:

CGI::param called in list context from /admin/smart-rules.pl line 262,
this can lead to vulnerabilities. See the warning in "Fetching the value
or values of a single named parameter" at CGI.pm line 412.

Explained here: https://metacpan.org/pod/CGI#Fetching-the-value-or-values-of-a-single-named-parameter

And because all these params are not multi-params, so simple "scalar .."
forcing for CGI->param is the fix. Changes are transparent and same
values should be assigned as before, just no more warnings.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit eb8a0ffcc1bb4d751daa4221bd37faa815904db8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25440: Extra duplicated call to CGI->param method removed
Andrew Nugged [Sun, 10 May 2020 10:54:29 +0000 (13:54 +0300)]
Bug 25440: Extra duplicated call to CGI->param method removed

In code CGI param 'no_auto_renewal_after_hard_limit' assigned to
"$no_auto_renewal_after_hard_limit" var, and then just in the next line
again variable "$no_auto_renewal_after_hard_limit" reassigned with
call to same "$input->param('no_auto_renewal_after_hard_limit')".

Fixed. No logic or results should be changed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b9ba7151667bc6481bc97335b94e44487c9701bd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 21395: Remove 'variable $DEBUG masks earlier declaration in same scope' warning
Jonathan Druart [Mon, 29 Jun 2020 11:42:55 +0000 (13:42 +0200)]
Bug 21395: Remove 'variable $DEBUG masks earlier declaration in same scope' warning

% prove t/db_dependent/Serials.t
t/db_dependent/Serials.t .. 8/49 "my" variable $DEBUG masks earlier declaration in same scope at /kohadevbox/koha/C4/Barcodes/ValueBuilder.pm line 45.
"my" variable $DEBUG masks earlier declaration in same scope at /kohadevbox/koha/C4/Barcodes/ValueBuilder.pm line 87.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 21395: (QA follow-up) POD fixes
Martin Renvoize [Thu, 25 Jun 2020 12:48:36 +0000 (13:48 +0100)]
Bug 21395: (QA follow-up) POD fixes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b9e526a12fb338736e149934526e38da782f048f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 21395: (QA follow-up) Remove some introduced issues
Martin Renvoize [Thu, 25 Jun 2020 10:31:49 +0000 (11:31 +0100)]
Bug 21395: (QA follow-up) Remove some introduced issues

This patch removes some new error cases introduced during rebase

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e968af43777d47c9134ea1875270af9661ef2f5a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 21395: Fix QA errors
Julian Maurice [Mon, 27 Apr 2020 08:31:19 +0000 (10:31 +0200)]
Bug 21395: Fix QA errors

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1682341b5849c34e59597cda780d4c877d6f3278)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 21395: Make perlcritic happy
Julian Maurice [Fri, 21 Sep 2018 16:05:42 +0000 (18:05 +0200)]
Bug 21395: Make perlcritic happy

This patch adds a .perlcriticrc (copied from qa-test-tools) and fixes
almost all perlcrictic violations according to this .perlcriticrc
The remaining violations are silenced out by appending a '## no critic'
to the offending lines. They can still be seen by using the --force
option of perlcritic
This patch also modify t/00-testcritic.t to check all Perl files using
the new .perlcriticrc.
I'm not sure if this test script is still useful as it is now equivalent
to `perlcritic --quiet .` and it looks like it is much slower
(approximatively 5 times slower on my machine)

Test plan:
1. Run `perlcritic --quiet .` from the root directory. It should output
   nothing
2. Run `perlcritic --quiet --force .`. It should output 7 errors (6
   StringyEval, 1 BarewordFileHandles)
3. Run `TEST_QA=1 prove t/00-testcritic.t`
4. Read the patch. Check that all changes make sense and do not
   introduce undesired behaviour

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b168f4a2e9a03ed56ce857353d4dde940980caba)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25322: fix for not selected "relationship" defaults to father
Petro Vashchuk [Wed, 17 Jun 2020 13:44:42 +0000 (16:44 +0300)]
Bug 25322: fix for not selected "relationship" defaults to father

When a user creates a patron's guarantor on /cgi-bin/koha/members/memberentry.pl but doesn't select the relationship from a dropdown, the relationship defaults to first value, which in default sysprefs is "father". This may or may not be correct as this is not a conscious choice from the user.

The solution is to make the "Relationship" field mandatory when there is no empty entry in the system preferences, always starting with an empty option but not allowing the user to save an empty entry.
And if there is an empty option in sysprefs, it allows to save empty, as well as makes it default choice.

To reproduce with default system preferences:
    1) Create a new patron who is assumed to have a guarantor or modify the existing one.
    2) Under "Guarantor Information" click on "Search to add" button. After performing the search, select a user to act as guarantor. Don't use the dropdown menu to select a relationship. Save your changes.
    3) Observe that relationship is set as "father".
    4) Apply the patch.
    5) Repeat steps 1 and 2.
    6) Observe that it doesn't allow you to save the form until you pick a relationship type.

To reproduce with empty entry added to system preferences:
    1) Add an empty entry to borrowerRelationship at /cgi-bin/koha/admin/preferences.pl?tab=patrons in Patron relationships section (example: "|father|mother").
    2) Create a new patron who is assumed to have a guarantor or modify the existing one.
    3) Under "Guarantor Information" click on "Search to add" button. After performing the search, select a user to act as guarantor. Don't use the dropdown menu to select a relationship. Save your changes.
    4) Observe that relationship is set as "father".
    5) Apply the patch.
    6) Repeat steps 1, 2 and 3.
    7) Observe when you save the empty entry it does set the relationship as empty.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 029f41a667da8f054633432997bc818c1b26a27f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 22672: Change <i> to <em> and <b> to <strong> in templates, includes, xslt
Lucas Gass [Wed, 27 May 2020 21:35:16 +0000 (21:35 +0000)]
Bug 22672: Change <i> to <em> and <b> to <strong> in templates, includes, xslt

This patch attempts to replace <i> with <em> AND <b> with <strong> in
order to more accessible to screen readers. This patch makes no attempt
to change Font Awesome icons which typically use <i>. I found templates,
includes and XSLT by using 'git grep ‘<b>’
koha-tmpl/opac-tmpl/bootstrap/en/' and git grep ‘<i>’
koha-tmpl/opac-tmpl/bootstrap/en/

TEST PLAN:
There should be no visible difference on the changed pages. The files
changed are:
koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-MARCdetail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browser.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/xslt/OAI.xslt

Read the changes and make sure everything looks correct, try to visit as
many pages as possible and confirm that everything looks as it should.
grep around for cases of <b> or <i> that I could have missed.

Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d3036d46ba4b26df040a25f960c3bc3081734c26)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25875: Unit test
Nick Clemens [Thu, 25 Jun 2020 10:38:16 +0000 (10:38 +0000)]
Bug 25875: Unit test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a804d4be437a5df3641f854a506642afe3501046)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25875: Move check for module_bit and code to the JOIN
Nick Clemens [Thu, 25 Jun 2020 10:38:26 +0000 (10:38 +0000)]
Bug 25875: Move check for module_bit and code to the JOIN

If we limit the JOIN to rows with the correct subpermission we won't
duplicate the returned patrons

To test:
 1 - Give a patron full acquisitions permissions
 2 - Also give them several subpermissions on other areas
 3 - Go to Acquisitions
 4 - Edit a fund
 5 - Add a user to the fund
 6 - Search for user above
 7 - They return multiple times in results
 8 - Apply patch
 9 - Restart all the things
10 - Repeat search
11 - Patron appears once

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>
(cherry picked from commit 721876785142fea84f02c7dbe4f325e2a605bd0f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25793: OAI 'Set' and 'Metadata' dropdowns broken by OPAC jQuery upgrade
Owen Leonard [Mon, 22 Jun 2020 23:57:29 +0000 (23:57 +0000)]
Bug 25793: OAI 'Set' and 'Metadata' dropdowns broken by OPAC jQuery upgrade

This patch modifies the OAI XSLT file, correcting the path to jQuery
assets and adds a link to jquery-migrate.

To test, apply the patch and make sure the "OAI-PMH" system preference
is enabled.

1. Go to: <OPACBaseURL>/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marc21
   e.g.
   localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marc21
2. Click on the 'Sets' and 'Metadata' links. The corresponding
   panels with set and metatdata information should be shown.

Tested against master, works as described.
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 23ed2e110e16f04a34c01ac866b470ec725b7522)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25807: Add Template 3.008 to the exclude list
Martin Renvoize [Wed, 24 Jun 2020 10:34:32 +0000 (11:34 +0100)]
Bug 25807: Add Template 3.008 to the exclude list

This patch adds version 3.008 of Template to the excludes list in our
cpanfile. It also adds support for displaying this version on the about
page.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit eb8d23f47d5fd204b48749ac03faca8244e84264)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25491: Fix for "Use of uninitialized value" in InstallAuth.pm
Slava Shishkin [Wed, 13 May 2020 17:20:27 +0000 (20:20 +0300)]
Bug 25491: Fix for "Use of uninitialized value" in InstallAuth.pm

This warning was thrown:
    Use of uninitialized value $info{"invalid_username_or_password"}
    in numeric eq (==) at /home/vagrant/kohaclone/C4/InstallAuth.pm
    line 387.

There is the case when hash key can be undefined in numeric comparison.

Fixed by adding additional precheck for
$info{"invalid_username_or_password"} being Perl's "true".

To test:
    1) Go to the first page of the web-installer where it asks to login.
    2) Observe the warning in the log file.
    3) Apply patch.
    4) Repeat step 1.
    7) Check that previous warning suppressed.

Mentored-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d81438e143273a538c09cd16e7f92a83beed4027)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25858: Use bitwise OR for setting a bit in borrowers.flag
Julian Maurice [Fri, 26 Jun 2020 06:55:44 +0000 (10:55 +0400)]
Bug 25858: Use bitwise OR for setting a bit in borrowers.flag

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Thanks-to: Didier Gautheron <didier.gautheron@biblibre.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25858: (bug 25858 follow-up) Don't attempt to set flag if already set
Nick Clemens [Wed, 24 Jun 2020 10:06:57 +0000 (10:06 +0000)]
Bug 25858: (bug 25858 follow-up) Don't attempt to set flag if already set

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e38634ceb8ae5d30d43055711b97395f580f0310)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25232: DBRev 20.05.01.002
Lucas Gass [Mon, 13 Jul 2020 15:41:05 +0000 (15:41 +0000)]
Bug 25232: DBRev 20.05.01.002

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25232: Add ability to specify multiple notforloan values to skip
Kyle M Hall [Thu, 7 May 2020 13:16:37 +0000 (09:16 -0400)]
Bug 25232: Add ability to specify multiple notforloan values to skip

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 326c0159a016c25394acde03c379bfea5bb3b820)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25232: Add ability to skip trapping items with a given notforloan value
Kyle M Hall [Tue, 21 Apr 2020 17:52:40 +0000 (13:52 -0400)]
Bug 25232: Add ability to skip trapping items with a given notforloan value

This is a companion/alternative to bug 25184, in that it allows an
explicit workflow for placing returned books into temporary storage for
a few days for decontamination purposes.

The idea here is to create a specific notforloan value for "In
Decontamination" or something along along those lines. This notforloan
value would never be trappable. At the end of decon,
UpdateNotForLoanStatusOnCheckin  could be used to remove the
notforloan status and allow checkins to be trapped to fill holds.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Give an item a negative notforloan value
4) Place a hold on the item
5) Check the item in
6) Note the item is trapped for hold
7) Set SkipHoldTrapOnNotForLoanValue to the same notforloan value
   you used in step 3
8) Check the item in again
9) Note Koha did not ask you to trap the item for hold!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 465e5562fc2f852282f7dcc4683dd0e87b0633eb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 24986: DBIC
Lucas Gass [Mon, 13 Jul 2020 15:29:31 +0000 (15:29 +0000)]
Bug 24986: DBIC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 24986: DBRev 20.05.01.001
Lucas Gass [Mon, 13 Jul 2020 15:21:55 +0000 (15:21 +0000)]
Bug 24986: DBRev 20.05.01.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 24986: Modify some borrowers DB fields to (TINY|MEDIUM)TEXT
Jonathan Druart [Thu, 4 Jun 2020 10:12:23 +0000 (12:12 +0200)]
Bug 24986: Modify some borrowers DB fields to (TINY|MEDIUM)TEXT

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 16a5197aa9f96ee8a7fb6c63e15a6c7f9342f773)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25805: Return empty strings instead of undef in C4::SIP::ILS::Item::hold_patron_name
Kyle M Hall [Thu, 18 Jun 2020 13:01:36 +0000 (09:01 -0400)]
Bug 25805: Return empty strings instead of undef in C4::SIP::ILS::Item::hold_patron_name

This bug is basically the same as bug 24966, but for hold_patron_name instead of hold_patron_bcode.
The subroutine hold_patron_bcode should always return an empty string, not undef.

Test Plan:
1) Using the SIP cli emulator, checkin an item that is not checked out
2) Note the DA field contains someting like "C4::SIP::SIPServer=HASH(0x88175c8)"
   The hex number will almost certainly be different from this example
3) Apply this patch
4) Restart the SIP server
5) Run the SIP checkin again
6) Note the DA field is no longer present!

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>
(cherry picked from commit 017b67e6c52ab7b79a0187b1ca9fea220117f7ef)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25805: Regression tests
Tomas Cohen Arazi [Thu, 18 Jun 2020 19:54:42 +0000 (16:54 -0300)]
Bug 25805: Regression tests

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>
(cherry picked from commit 115eeada2b6f959997d21d0e0dd73606f1ca7324)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 4985: Fix Plack scope errors
Emmi Takkinen [Thu, 19 Mar 2020 07:12:19 +0000 (09:12 +0200)]
Bug 4985: Fix Plack scope errors

This patch 'ours' several variables to fix Plack scope errors
in exceptionHolidays.pl.

This also adds '@holidays_list' as parameter to 'edit_holidays'.

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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ee3f5d5a85d93dc36d6bdeab5f092c0098d604e1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 4985: Edit a calendar entry for all branches
Emmi Takkinen [Fri, 7 Feb 2020 10:43:54 +0000 (12:43 +0200)]
Bug 4985: Edit a calendar entry for all branches

This patch adds functionality to calendar tool to
make edits or deletes to all branches at once.

To test:
-Apply patch
-Add holiday for a library and copy it to all or some
libraries
-Edit previosly made holiday (edit, delete etc.) and
check out "Copy changes to all libraries." checkbox
=> Changes are made to all libraries sharing changed
holiday

Sponsored by: Koha-Suomi Oy

Signed-off-by: Christofer <christofer.zorn@ajaxlibrary.ca>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ce2219425d9b97952f5904024fb7575a0809487b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 18911: (follow-up) We should save changes with a POST
Marcel de Rooy [Wed, 17 Jun 2020 11:50:26 +0000 (11:50 +0000)]
Bug 18911: (follow-up) We should save changes with a POST

Test plan:
Verify if changes to messaging table and language are still saved.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ef947ff42fb5959d421038ac2a413e9cc6488474)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 18911: Add the ability to set the preferred lang for notice at the OPAC
Jonathan Druart [Wed, 17 Jun 2020 10:20:36 +0000 (12:20 +0200)]
Bug 18911: Add the ability to set the preferred lang for notice at the OPAC

Patron should be allowed to modify this setting without asking a staff
member.

The setting is not configurable and cannot be hidden via a syspref.

Test plan:
- Turn the pref TranslateNotices on
- Install some languages
- Edit your messaging settings at the OPAC
=> Notice the "Preferred language for notices" dropdown list
- Select one
=> Confirm that the value is saved in DB

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0ab27fe6da01095ec3303e35b5736f9ed9bbc07e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25097: Add option to message_queue to allow for only specific sending notices
Kyle M Hall [Thu, 9 Apr 2020 15:23:04 +0000 (11:23 -0400)]
Bug 25097: Add option to message_queue to allow for only specific sending notices

The message_queue.pl currently will send all the messages queued up.  It would be nice to have some control over which messages are to be sent.

Example: We have libraries who only wanted to send 'hold notices' but not overdue, advance notice, etc during the covid-19 quarantine.  And some that were the opposite - turn off hold notices, but send other generated notices.

Test Plan:
1) Apply this patch
2) Enqueue some messages with different letter codes
3) Run process_message_queue.pl with the new -c parameter using one of the letter codes enqueued
4) Note that only the messages with the selected code were processed!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b48869f1b865ae1f172557274062e932318427db)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 22807: Compile CSS
Lucas Gass [Fri, 10 Jul 2020 17:31:08 +0000 (17:31 +0000)]
Bug 22807: Compile CSS

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 22807: (follow-up) Update style of skip button
Owen Leonard [Wed, 10 Jun 2020 18:30:50 +0000 (18:30 +0000)]
Bug 22807: (follow-up) Update style of skip button

This patch updates the markup and style of the skip button, adapting
(i.e. stealing) the style of the skip link at https://webaim.org.

To test, apply the patch and rebuild the OPAC CSS:
https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client

Go to any page in the OPAC and hit the tab key. The "Skip to main
content" link should appear. Tabbing away from it should cause the link
to hide. Hitting the ENTER key when the link is highlighted should cause
the page to scroll to the main content.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2e94cb26a8267df72f657fb7c1097d08318e8a21)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 22807: (follow-up) Add .maincontent class to libraries page
Owen Leonard [Wed, 10 Jun 2020 18:42:06 +0000 (18:42 +0000)]
Bug 22807: (follow-up) Add .maincontent class to libraries page

This patch adds a missing "maincontent" class to the "all libraries"
view. Previously it was only present on the single library view.

To test, apply the patch and go to the "Libraries" page in the OPAC.

 - Hit the "tab" key to highlight the "Skip to main content" link.
 - Hit "Enter."
 - The page should scroll to the top of the list of libraries.
 - Open one of the library detail pages and confirm that the "Skip to
   main content" link works on that page too.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 78cfac8dd5d089960e7d34068415b8c7f0bd7775)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 22807: Ensure .maincontent appears on all pages
Martin Renvoize [Wed, 10 Jun 2020 15:56:40 +0000 (16:56 +0100)]
Bug 22807: Ensure .maincontent appears on all pages

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c5b173f7dec5d94c29249dfa00e61861d5645998)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 22807: Ensure only one maincontent on searcresults
Martin Renvoize [Wed, 10 Jun 2020 12:57:42 +0000 (13:57 +0100)]
Bug 22807: Ensure only one maincontent on searcresults

Prior to this patch, if you entered a search that returned zero results,
you would end up with two 'maincontent' classes on the page

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6b0887f76e2f561187f6eae78f932987520a9cb6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 22807: Add 'Skip to content' option
Martin Renvoize [Tue, 9 Jun 2020 13:10:53 +0000 (14:10 +0100)]
Bug 22807: Add 'Skip to content' option

This patch adds a 'Skip to content' link to the header bar which will
only appear upon the first use of 'tab' to navigate after any fresh page
load in the OPAC.

Test plan
1/ Load any page in the OPAC
2/ Hit the `tab` key
3/ Note the new 'Skip to main content' link appears at the top left of
the screen.
4/ Hit `Enter` or Click the button
5/ Note the page scrolls to the area of the page that has the first block
   containing a .maincontent class.
6/ Note that the next available focusable element after the first .maincontent
   block has been given focus.
7/ Note that the link has been hidden

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c36560a1ad731af955c005306c2c2800057cd890)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25151: Fixing semantic headings in opac-basket.tt
Hayley Mapley [Wed, 10 Jun 2020 23:48:54 +0000 (11:48 +1200)]
Bug 25151: Fixing semantic headings in opac-basket.tt

Test plan:
1) Apply the patch
2) Add items to your cart/folder/basket
3) Open up the basket and check that the main heading is now an h1
4) Check that the page looks fine

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f002bd17105bab2d16aee8db8ed4f6d688192fc3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25154: Add heading where content is introduced in opac-results.tt
Martin Renvoize [Thu, 11 Jun 2020 12:23:32 +0000 (13:23 +0100)]
Bug 25154: Add heading where content is introduced in opac-results.tt

Prior to this patch, the search results page did not contain a
semantically accurate heading to introduce he main content of the page.

Test plan
1/ Perform a search in the OPAC that yields results
2/ Inspect the page and note that the 'title' stating how many results
   are found is not semantically marked up as a heading to introduce the
   content.
3/ Apply the patch
4/ Reload the page
5/ Inspect the page and note that the 'title' stating how many results
   are found is now properly marked up as a second level heading and
   appropriately designated as the start of the 'maincontent' block with an
   associated '.maincontent' class.
6/ Perform a search which yields zero results
7/ Note that the 'No results found' title is properly marked up as a
   second level heading.
8/ Signoff

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>
(cherry picked from commit 972aeaa0143dcdedc7ae23314a72991d5e4a6490)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25236: Compile CSS
Lucas Gass [Fri, 10 Jul 2020 17:05:31 +0000 (17:05 +0000)]
Bug 25236: Compile CSS

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25236: Fix semantic heading for opac-full-serial-issues.tt
Martin Renvoize [Thu, 11 Jun 2020 10:54:22 +0000 (11:54 +0100)]
Bug 25236: Fix semantic heading for opac-full-serial-issues.tt

Prior to this patch, the opac-full-serial-issues side navigation box contained
semantically incorrect headings.

Test plan
1/ Search for a serial with many linked issues
2/ Navigate to the detailed view of that serial
3/ Click on the 'More details' link after all the listed issues
4/ Inspect the 'Refine your search' elements on the left side of the screen.
   Note that the headings are H1 (Koha page title) > H4 (Refine your search)
3/ Apply this patch
4/ Reload the page
5/ Re-inspect the 'Refine your search' elements and note the heading
   semantics are now H1 (Title of page) > H2 (Refine your search)
6/ Note the appearance of the box is improved and consistent with elsewhere
7/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0550e0b7f788b65b50ed4689d677600be3f9c7c2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25236: Fix semantic heading for opac-topissues.inc
Martin Renvoize [Thu, 11 Jun 2020 10:44:53 +0000 (11:44 +0100)]
Bug 25236: Fix semantic heading for opac-topissues.inc

Prior to this patch, the opac-topissues side navigation box contained
semantically incorrect headings.

Test plan
0/ Enable 'OpacTopIssues'
1/ Navigate to the top issues page via the 'Most popular' link
2/ Inspect the 'Refine your search' elements on the left side of the screen.
   Note that the headings are H1 (Koha page title) > H4 (Refine your search)
3/ Apply this patch
4/ Reload the page
5/ Re-inspect the 'Refine your search' elements and note the heading
   semantics are now H1 (Title of page) > H2 (Refine your search)
6/ Note the appearance of the box is still reasonable
7/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 62795521eedc02e11bef520c8b980d480b7e02ae)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25236: Fix semantic heading for opac-facets.inc
Martin Renvoize [Thu, 11 Jun 2020 10:37:26 +0000 (11:37 +0100)]
Bug 25236: Fix semantic heading for opac-facets.inc

Prior to this patch, the opac-facets side navigation box contained
semantically incorrect headings.

Test plan
1/ Perform a search which yields some results in the OPAC
2/ Inspect the 'Refine your search' elements on the left side of the
screen. Note that the headings are H1 (Koha page title) > H4 (Refine
your search) > H5 (Headings within 'Refine your search' box)
3/ Apply this patch and follow
https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client
4/ Reload the page (Flushing the cache to ensure the CSS change load)
5/ Re-inspect the 'Refine your search' elements and note the heading
semantics are now H1 (Title of page) > H2 (Refine your search) > H3
(Headings within 'Refine your search')
6/ Note the appearance of the box is still reasonable
7/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f88d56f689e514b47930d617049358fdf9b68608)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25238: Fix semantic heading for opac-details
Martin Renvoize [Thu, 11 Jun 2020 11:15:21 +0000 (12:15 +0100)]
Bug 25238: Fix semantic heading for opac-details

Prior to this patch the opac-details view contained multiple h1 level
headings.

Test plan
1/ Perform a search in the OPAC that will yield results
2/ Navigate to any results detailed view
3/ Inspect the page and note that two H1 level headings are present
(Page title + Item title)
4/ Apply the patch
5/ Reload the page
6/ Inspect the page and ntoe that the 'Item title' is now a level 2
heading
7/ Note the page still appears nicely
8/ Signoff

Bonus points: Check with XSLT views enabled and disabled, MARC21,
UNIMARC and NORMARC variations.

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>
(cherry picked from commit 3e18402c240814d7f00a62c3f2359bd9b9d0a098)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25239: Fix semantic heading for opac-reserve.tt
Martin Renvoize [Thu, 11 Jun 2020 12:05:31 +0000 (13:05 +0100)]
Bug 25239: Fix semantic heading for opac-reserve.tt

Prior to this patch, the opac-reserve contained semantically incorrect headings.

Test plan
1/ Perform a search which yields some results in the OPAC
2/ Attempt to place a hold on an item.
3/ On the resulting screen, note that the headings are:
   H1 (Koha page title) > H3 (Confirm holds for) > H5 (Hold levels)
4/ Apply this patch and reload the page
5/ Re-inspect the elements in question note the heading semantics are now:
   H1 (Title of page) > H2 (Confirm holds for) > H3 (Hold levels)
6/ Note the appearance of the box is still reasonable
7/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1a96ede5f114bd90fe1735702ca4bab77dfed9d4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25402: (QA follow-up) Remove unused downloadBasket function
Owen Leonard [Thu, 18 Jun 2020 11:31:40 +0000 (11:31 +0000)]
Bug 25402: (QA follow-up) Remove unused downloadBasket function

This patch removes the now-unused downloadBasket function from
basket.js. The patch should have no effect on the functionality of the
download process.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6d73c08e7351a772a388b1e1c6157b307fcbc1a8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25402: Put OPAC cart download options into dropdown menu
Owen Leonard [Wed, 6 May 2020 20:30:32 +0000 (20:30 +0000)]
Bug 25402: Put OPAC cart download options into dropdown menu

This patch modifies the process of downloading a cart so that it doesn't
involve a separate popup window.

To test, apply the patch and add some titles to the cart in the OPAC.

 - Open the cart
 - The "Download" button should now be a dropdown menu.
 - Selecting any of the download options should trigger a download
   prompt.
 - Test with and without some CSV profiles which have been configured
   for use in the OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 174ea44dccd8f0a151a82ba5f8c70e3194065539)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25471: Add DataTables to MARC subfield structure admin page
Owen Leonard [Tue, 12 May 2020 21:27:05 +0000 (21:27 +0000)]
Bug 25471: Add DataTables to MARC subfield structure admin page

This patch adds DataTables sorting and filtering to the table of
subfields shown on the MARC subfield structure administration page.

To test, apply the patch and go to Administration -> MARC bibliographic
framework.

 - From the 'Actions' menu, select 'MARC structure.'
 - From the 'Actions' menu, select the 'View subfields' link for a tag
   with multiple subfields.
 - On the page showing all the subfields for the tag, confirm that the
   table is sorted by default by subfield and that sorting works
   correctly.
 - Confirm that the search form at the top of the table works.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7ff774509d8c3fc4747857dcfeee7a2cf7557921)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25699: Add edition information to "Holds to pull" report
Petro Vashchuk [Wed, 10 Jun 2020 12:36:01 +0000 (15:36 +0300)]
Bug 25699: Add edition information to "Holds to pull" report

Added a feature that displays edition information of the book
together with title in "Holds to pull" report.

Edition information is fetched from "biblioitem" table
as "editionstatement" and transferred to template.

Those changes don't have performance impact as all tables
including "biblioitem" were already used and joined in this request.

Mentored-by: Andrew Nugged <nugged@gmail.com>
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>
(cherry picked from commit 2e14a0a3fa317191bf0ee735988a83b8f59d4ed5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25747: Don't display a comma when patron has no firstname
Owen Leonard [Mon, 15 Jun 2020 11:14:22 +0000 (11:14 +0000)]
Bug 25747: Don't display a comma when patron has no firstname

This patch adds a check for the existence of "firstname" to
patron-title.inc so that if the patron has no firstname the "invert
name" setting doesn't cause an unnecessary comma to appear.

To test, apply the patch and locate or create a patron with no first
name.

- When checking out to the patron, examine the page title. It should say
  "Checking out to <lastname> (<cardnumber>).
- When checking out to a patron with first and last name it should show
  as before, "Checking out to <lastname>, <firstname> (<cardnumber)

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d2f136713e814d4e33e18d1cdad88f3675a9ec3a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25789: Don't allow past date as holds expiration date
Emmi Takkinen [Thu, 18 Jun 2020 06:36:55 +0000 (09:36 +0300)]
Bug 25789: Don't allow past date as holds expiration date

When editing existing holds expiration date it's possible to select
past date from datepicker. This patch changes expiration inputs class
as "datepickerto" to make past dates unselectable.

To test:
1.  Find item with holds
2.  Edit holds expiration date
=> Note that past dates are selectable
3. Apply patch
4. Edit again
=> Past dates are no longer selectable

Sponsored-by: Koha-Suomi Oy
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>
(cherry picked from commit c3365a35963742b294a4c8631b22aa34dac228d9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25756: remove erroneous hyphen
Andreas Roussos [Mon, 15 Jun 2020 14:58:38 +0000 (16:58 +0200)]
Bug 25756: remove erroneous hyphen

In the Staff Client, the OPAC "Appearance" preferences table has an
extra, empty HTML table row at the end.

Test plan:
0) Observe the empty HTML table row at the end of the table that lists
   OPAC "Appearance" system preferences.
1) Apply this patch.
2) Observe that the empty table row is now gone.

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>
(cherry picked from commit 251197ad73ba2be88ac2154db46748b58a0597f8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25611: Use selected vendor when creating a basket
Jonathan Druart [Fri, 5 Jun 2020 09:15:33 +0000 (11:15 +0200)]
Bug 25611: Use selected vendor when creating a basket

We did not take into account the vendor selected.

Test plan:
1. Choose Vendor
2. Create Basket
3. Assign a new vendor
Without the patch this new vendor is not changed
With the patch applied the vendor is changed

4. Edit the basket, change the vendor

Reported-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cd716269a7b2b1b6165154ea7e85844201402a8d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 11994: (follow-up) Make things work when LibraryName is empty
Katrin Fischer [Fri, 1 May 2020 20:11:29 +0000 (20:11 +0000)]
Bug 11994: (follow-up) Make things work when LibraryName is empty

When LibraryName system preference was not set, the installation
of the plugin would fail with:

Firefox could not download the search plugin from: ...

Now if the pref is empty, the description 'Library catalog'
will be used instead.

To test:
- Empty your LibraryName pref
- Verify the search plugin can still be installed
  (see first patch for further instructions)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1e0dd6d0783a66514fc92cc0a34ca0882a5ce62f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 11994: OpenSearch plugins needs to be delivered with Content-Type application...
Katrin Fischer [Fri, 1 May 2020 17:20:43 +0000 (17:20 +0000)]
Bug 11994: OpenSearch plugins needs to be delivered with Content-Type application/opensearchdescription+xml

https://developer.mozilla.org/en-US/docs/Web/OpenSearch
Your server should serve OpenSearch plugins using
Content-Type: application/opensearchdescription+xml.

To test:
- Verify the Content-Type the file is delivered with
  is correct, for example using wget
  http://127.0.0.1:8080/cgi-bin/koha/opac-search.pl?format=opensearchdescription

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f090c1d2cb9253d77c5bac3b8fa03c775af2f0f6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 11994: Fix OpenSearch discovery in the OPAC
Owen Leonard [Tue, 28 Apr 2020 14:41:47 +0000 (14:41 +0000)]
Bug 11994: Fix OpenSearch discovery in the OPAC

This patch corrects the markup for the OpenSearchDescription XML
document and adds (back) the link in the OPAC header which points to it.
This will enable compatible browsers to offer the addition of the OPAC's
keyword search as a search engine option.

I've found documentation suggesting this feature is available (or at
least was at one time) in Chrome and Safari, but in my test it only
works in Firefox.

To test, apply the patch and make sure the OPACBaseURL preference is
set correctly.

 - Open the OPAC in Firefox (these instructions assume the latest
   version, currently v.75).
 - On the right side of the address bar you should see ". . ." Click it
   to trigger the menu.
 - You should see an "Add search engine" entry with your OPAC's icon.
 - Click to add the search engine.

 - Type a keyword to search in the address bar
 - A box should pop up below the address bar showing icons at the bottom
   for performing a search in various search engines. One of these icons
   should be the icon for your Koha OPAC.
 - Click the Koha OPAC icon and confirm that it triggers a keyword
   search in your OPAC.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0ef7b3db4cab73797ba3386b4951c0d86addf871)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 24352: Correct location and collection labels in OPAC search results
Owen Leonard [Tue, 16 Jun 2020 19:48:48 +0000 (19:48 +0000)]
Bug 24352: Correct location and collection labels in OPAC search results

This patch modifies the OPAC's MARC21 search results XSLT so that
OPAC search result information is correctly labeled
based on the OpacItemLocation preference.

Previously, search results showed the label "Location(s)" whether the
setting was "collection code" or "location."

To test, apply the patch and set the OPACXSLTResultsDisplay system
preference to 'default.'

On the OPAC search results page, each result with items should show
information in this format:

   With the OpacItemLocation preference set to 'call number only,'
    - "Availability: Items available for loan: {library} [Call number:
      {call number} ]

   With the OpacItemLocation preference set to 'collection code,'
     - "Availability: Items available for loan: {library}
        Collection(s): {collection description} [{ call number }]"

   With the OpacItemLocation preference set to 'location,'
     - "Availability: Items available for loan: {library}
        Location(s): {shelving location} [{ call number }]"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 897948cff5812a67144355829cf8915af17465d0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25189: Don't create authority if results found
Nick Clemens [Tue, 28 Apr 2020 15:34:20 +0000 (15:34 +0000)]
Bug 25189: Don't create authority if results found

Automatic authority creation assumes that if we don't match we need a new authority.

Using the Default linker, however, we don't match if there exists more than one match.
This leads to repeatedly generating authorities once there is a duplicate in the system

We shoudl instead only create a new authority if there are no results

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 a heading for that authority to a bib record
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: 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>
(cherry picked from commit 980419ed15cd4e5ae8be552218f939f5faea18c4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25189: Unit tests
Nick Clemens [Tue, 28 Apr 2020 13:29:52 +0000 (13:29 +0000)]
Bug 25189: Unit tests

Adds new test for not adding authority if some already exist

Also replaces use of 'SearchAuthorities' as it is Zebra specific

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>
(cherry picked from commit 258d0b0ecd6450fea09677f0607efdedb33cc16c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25509: Remove useless libjs-jquery dependency
David Cook [Fri, 15 May 2020 04:55:49 +0000 (14:55 +1000)]
Bug 25509: Remove useless libjs-jquery dependency

We don't use the libjs-jquery package, so we should remove
the dependency.

To Test:
1) Build package (out of scope of test plan)
2) Install package
3) Note that libjs-jquery is marked by apt as no longer required
4) Remove libjs-jquery package from system and note how it
doesn't take koha-common with it

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9e923e57ed18a104c33cc10a4704450ec4c71c28)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25570: (follow-up) Fix tests
Tomas Cohen Arazi [Thu, 21 May 2020 21:25:46 +0000 (18:25 -0300)]
Bug 25570: (follow-up) Fix tests

This patch fixes the libraries tests, that expected the old behaviour

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b115dfeca649f2f35e0290ead85f2626eabd0829)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
3 years agoBug 25570: Paginate results by default in objects->search
Tomas Cohen Arazi [Thu, 21 May 2020 21:23:01 +0000 (18:23 -0300)]
Bug 25570: Paginate results by default in objects->search

This patch makes the helper paginate the resultsif no pagination
parameters are passed.

Page number defaults to 1, and the page size to the RESTdefaultPageSize
syspref value.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Pagination is not enforced by default
3. Apply this patch
4. Repeat 2
=> SUCCESS: Results are paginated
5. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 451ae76431d3d580494f917ed397f259cd96a876)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>