koha.git
2 years agoUpdate release notes for 20.11.11 release v20.11.11
Fridolin Somers [Thu, 28 Oct 2021 20:39:01 +0000 (10:39 -1000)]
Update release notes for 20.11.11 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoIncrement version for 20.11.11 release
Fridolin Somers [Thu, 28 Oct 2021 20:29:13 +0000 (10:29 -1000)]
Increment version for 20.11.11 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoFix translations for Koha 20.11.11
Victor Grousset/tuxayo [Fri, 23 Jul 2021 02:54:44 +0000 (04:54 +0200)]
Fix translations for Koha 20.11.11

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoMerge remote-tracking branch 'translate/20.11.11-translate-20211028' into 20.11.x
Fridolin Somers [Thu, 28 Oct 2021 20:28:09 +0000 (10:28 -1000)]
Merge remote-tracking branch 'translate/20.11.11-translate-20211028' into 20.11.x

2 years agoTranslation updates for Koha 20.11.11
Koha translators [Thu, 28 Oct 2021 20:24:35 +0000 (17:24 -0300)]
Translation updates for Koha 20.11.11

2 years agoBug 29134: (follow-up) Specify which borrowernumber
Nick Clemens [Fri, 8 Oct 2021 14:42:48 +0000 (14:42 +0000)]
Bug 29134: (follow-up) Specify which borrowernumber

When performing a search that includes permissions we need to specify we are comparing
the borrowers tabnle borrowernumber

To test:
1 - Browse to Admin->Funds
2 - Edit a fund
3 - Click '+ Add users'
4 - Attempt a search, no results
5 - Check plack-error.log
    C4::Utils::DataTables::Members::search(): DBI Exception: DBD::mysql::st execute failed: Column 'borrowernumber' in IN/ALL/ANY subquery is ambiguous at /kohadevbox/koha/svc/members/search line 80
6 - Apply patch
7 - Repeat 1-3
8 - search for 'a'
9 - Result!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29244: Compiled CSS
Fridolin Somers [Sat, 23 Oct 2021 02:19:43 +0000 (16:19 -1000)]
Bug 29244: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29244: Add dialog class where missing in print-notices.tt
Martin Renvoize [Thu, 14 Oct 2021 11:45:05 +0000 (12:45 +0100)]
Bug 29244: Add dialog class where missing in print-notices.tt

The print notices template had it's own implimentation of a message
dialog. To make it consistent with other area's, we should add the
dialog class.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d7e94ea0115ee6a5dfb732571b7a57d52ffe943d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29244: Move message inside dialog and remove width
Martin Renvoize [Thu, 14 Oct 2021 11:43:56 +0000 (12:43 +0100)]
Bug 29244: Move message inside dialog and remove width

This patch moves the message css rules inside the dialog ruleset to
clarify their intention and removes the width so it inherits from the
dialog class.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit cde0653deb322c749b6d43d1d67ff38b0d573ab6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29298: Add 'Managing library' column to table settings for histsearch
Jonathan Druart [Thu, 21 Oct 2021 09:46:07 +0000 (11:46 +0200)]
Bug 29298: Add 'Managing library' column to table settings for histsearch

Bug 14669 added the column to the table but forgot to add it to the
table settings yml file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 59143d397facc75c735d66f6bb8905088fb7e10f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29216: Correct --where documentation in update_patrons_category.pl
Caroline Cyr La Rose [Fri, 15 Oct 2021 14:03:52 +0000 (10:03 -0400)]
Bug 29216: Correct --where documentation in update_patrons_category.pl

This patch removes two misleading examples of the --where parameter
documentation in update_patrons_category.pl

To test:

1. Apply patch
2. In your favourite text editor, open misc/cronjobs/update_patrons_category.pl
3. Look for the documentation for the --where parameter (around line 133 or so)
4. Make sure the examples and their explanations make sense
5. Sign off :)

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e85d5b3af14ed3debe38670e270868ed325982a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29225: Don't hide subgroup filter on pag load
Nick Clemens [Thu, 14 Oct 2021 12:28:30 +0000 (12:28 +0000)]
Bug 29225: Don't hide subgroup filter on pag load

When we auto select the last used tab, we hit code that hides the Subgroup
dropdown

Clicking to other tabs shows the dropdown again

There is code on the tab selection to hide subgroups on the 'All' tab,
the other line seems superfluous

To test:
1 - Create a report and assign a group and subgroup, creating if necessary
2 - Browse to "Reports->Use saved"
3 - Click on the tab for the report you just created, see the subgroups dropdown
4 - Reload the page, Subgroups dropdown disappears
5 - Apply patch
6 - Relaod the page
7 - It's back!
8 - Confirm dropdown filters as expected

Signed-off-by: Donna <donna@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 56a98a83e7ef6b070aa1d616eb92ce3be124d273)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29279: Use class for targets
Jonathan Druart [Thu, 21 Oct 2021 08:19:55 +0000 (10:19 +0200)]
Bug 29279: Use class for targets

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 636644bcc3c6dd5bb21f068d3484da44d261768d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29279: Don't sort holds ratio numeric columns as 'natural'
Nick Clemens [Tue, 19 Oct 2021 16:47:50 +0000 (16:47 +0000)]
Bug 29279: Don't sort holds ratio numeric columns as 'natural'

TO test:
1 - Place a variety of holds on some records
2 - Place more holds on records with low biblionumbers and less on ones with high biblionumbers
3 - Go to Circulation->Holds ratios
4 - Set the ration to 1 and load the report
5 - Sort by the 'Holds ratio' column and note it is incorrect
6 - Apply patch
7 - Confirm sort works correctly on first three columns and call numbers column

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e46dbc180ed64411909fc14fa0773d8279f9e2be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 25030: (QA follow-up) Fix tests
Nick Clemens [Tue, 19 Oct 2021 10:34:38 +0000 (10:34 +0000)]
Bug 25030: (QA follow-up) Fix tests

Fluid is not a valid value for cxn_pool - valid values are:
Sniff,Static,NoPing

AddAuthority call calls index - the indexing call was trying to access
the ES server with mocked values and dying when they were invalid

This patch uses a correct value for cxn_pool and inserts directly into DB
to avoid indexing

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e559c868dcbde7dac52dcda2bd73a4124770691c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 25030: (QA follow-up) Add POD
Nick Clemens [Mon, 18 Oct 2021 11:09:00 +0000 (11:09 +0000)]
Bug 25030: (QA follow-up) Add POD

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7ad06f21cfe258acf6980f5084bfd44bdfb945a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 25030: Implement IncludeSeeFromInSearches with Elasticsearch
Julian Maurice [Tue, 10 Nov 2020 14:22:21 +0000 (15:22 +0100)]
Bug 25030: Implement IncludeSeeFromInSearches with Elasticsearch

Test plan:
1. Create an authority with at least a 1XX$a and a 4XX$a, for instance:
    100 $a Foo
    400 $a Bar
2. Create a biblio and add a link to this authority using the
   cataloguing plugin
3. Disable syspref IncludeSeeFromInSearches
4. Reindex the biblio. You should be able to find it when searching
   'Foo' but not when searching 'Bar'
5. Enable syspref IncludeSeeFromInSearches
6. Reindex the biblio. You should be able to find it when searching
   'Foo' and also when searching 'Bar'
   without the patch, 'Bar' doesn't yeld results. With it, it does.
7. prove t/db_dependent/Koha/SearchEngine/Elasticsearch.t

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a106accfe8d7e4cd380b2e7e316e50466f358e19)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29215: (bug 3137 follow-up) Fix guarantor block toggle
Jonathan Druart [Tue, 19 Oct 2021 09:50:37 +0000 (11:50 +0200)]
Bug 29215: (bug 3137 follow-up) Fix guarantor block toggle

The guarantor template must be kept hidden, always.

Test plan:

Edit a patron with a guarantor, click the legend of the "patron
guarantor" block and confirm that the template is not shown

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b9d34c16e9b0ac83e055356c3680d87724528b57)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 20277: Improve 773 link when $a is present
Katrin Fischer [Sun, 22 Aug 2021 04:07:02 +0000 (04:07 +0000)]
Bug 20277: Improve 773 link when $a is present

At the moment $t (Title) and $a (Main heading - author) are both
searched in ti,phr, which sometimes may work, as ti contains the
full 245 field, including $c with author information. But often
$c will not match what is in 100$a, so the search fails.

This splits the search string so we search for $t in with ti,phr
and for $a in au.

To test:
- Make sure UseControlnumber is deactivated
- Search for a record with an author in 100 in your catalog
  Example from sample data: Programming Perl / Tom Christiansen, Brian D. Foy & Larry Wall.
- Add a child record using New > Add child record
- Verify that in 773 $a and $t are filled in
- Complete mandatory fields and save the record
. In OPAC and staff interface:
- Verify the link in the detail page is doing a search with ti,phr
- Verify the link works/doesn't work (more likely the latter)
- Apply patch
- Verify the link has changed and (now) works

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2c76d01ecafd85392f5512b3e5d4f1abb9a4922e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29157: Date and Datetime attributes cannot be set NULL
Tomas Cohen Arazi [Thu, 7 Oct 2021 18:28:40 +0000 (15:28 -0300)]
Bug 29157: Date and Datetime attributes cannot be set NULL

This patch makes Koha::Object->attribute_from_api allow setting
attributes the undef value. The original implementation passed the value
directly to dt_from_string, which made the attribute be set the current
date.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t \
           t/db_dependent/api/v1/patrons.t
=> FAIL: Tests fail! Our code is buggy!
3. Apply this patch
4. Repeat 2
=> SUCCESS! Fix fixed this thing!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2b93696da19a8a155ee5230b245827c077f8e520)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29157: Regression tests
Tomas Cohen Arazi [Thu, 7 Oct 2021 18:16:01 +0000 (15:16 -0300)]
Bug 29157: Regression tests

This patch implements regression tests for the filed bug.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d12bbb44c4ba4e4d8a8d5ba7ab60a8807726045a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28956: Correct default tax rate on orderreceive
Wainui Witika-Park [Mon, 6 Sep 2021 23:15:39 +0000 (23:15 +0000)]
Bug 28956: Correct default tax rate on orderreceive

When there is more than one tax rate defined in system preferences, and
a vendor has a tax rate that is not 0%, then when you are receiving an
order in a basket for that vendor, the default tax rate should be the
correct non 0 rate. This should be seen in acqui/orderreceive.

To test:
1) Go to staff client
2) Go to Koha administration
3) Search for "tax rate" in system preferences
4) Add 0|0.15 into the preference
5) Create a vendor
6) Set vendor tax rate to 15%
7) Add a new basket to vendor
8) Add to basket
9) Add any sample order to basket - add actual cost
10) Close basket
11) Receive shipment
12) Make invoice
13) Click on Receive in the table
14) Should be on orderreceive.pl page
15) Observe tax rate default is 0%
16) Apply patch
17) Refresh page
18) Observe tax rate default is 15%

Sponsored-by: Catalyst IT
Signed-off-by: Julien Sicot <julien.sicot@univ-rennes2.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 99c2a38c97ca92f25d8163903b3f3fa8d7bef230)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29172: (follow-up) Amend preference text for control fields
Katrin Fischer [Mon, 4 Oct 2021 18:21:02 +0000 (18:21 +0000)]
Bug 29172: (follow-up) Amend preference text for control fields

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1debc3c385c65c392742385b5f4708765a601349)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29172: Make CustomCoverImagesURL compatible with control fields
Jonathan Druart [Tue, 5 Oct 2021 11:57:04 +0000 (13:57 +0200)]
Bug 29172: Make CustomCoverImagesURL compatible with control fields

Bug 22445 added CustomCoverImagesURL that deals with MARC fields, but
control fields were not supported.

Test plan:
Turn CustomCoverImages on
Fill CustomCoverImagesURL with https://covers.openlibrary.org/b/isbn/{006}-M.jpg
Add an isbn in 006 (0596001738 will work)
Go to the detail page of the bibliographic record and confirm that you
see a cover image.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 931ef856f9bf1ed1bdba828a66af5e099b792c3c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 24698: QA fixes
Joonas Kylmälä [Sun, 3 Oct 2021 11:51:22 +0000 (11:51 +0000)]
Bug 24698: QA fixes

This is a squashed patch of the following patches:

Bug 24698: (QA follow-up) Fix errors caused by more strict exports being introduced

The original patch "Bug 24698: Add plugin and template files for
unimarc authority leader" doesn't work without explictly importing the
methods from C4::Auth and C4::Output due to the default exports being
changed in those modules after the patch was made.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Remove debug info being outputted to the template

This is only needed during development.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Align variables with whitespace

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Remove dead code

These were left off from the copy&paste taken from
unimarc_field_100_authorities.pl

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Fix formatting and typos

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Remove passing of authnotrequired parameter

It should only be used when we want to override the default of auth
being required.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Make plugin script executable

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Use spaces instead of tabs

This makes the QA script happy.

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Filter untrusted input to prevent XSS

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Don't specify select element's size if it is 1

This is to make the QA script happy, in order to not to break
Bootstrap CSS rules, see Bug 28066 for more info

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (QA follow-up) Don't specify script type explictly

It's makes the QA script complain because the option doesn't have any
effect nowadays:

https://www.w3.org/TR/2017/REC-html52-20171214/obsolete.html#warnings-for-obsolete-but-conforming-features
Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 24698: (follow-up) remove HTML select option for Series

The IFLA authorities format specification defines only the letters a-l
as possible values for authority leader 000 character position 9 ("Type
of entity"). Therefore, the first option from the HTML select dropdown
menu (" - Series") must be removed.

Mentored-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 049c235527c1e6dfbb7d3fb5375d10155f052223)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 24698: Add plugin and template files for unimarc authority leader
George Veranis [Fri, 12 Mar 2021 11:51:57 +0000 (12:51 +0100)]
Bug 24698: Add plugin and template files for unimarc authority leader

In Unimarc installations when adding/editing an authority record there is no
Tag Editor for the leader field ( 000 ).

This patch fixes that.

Test plan:

1) Try to catalogue a new authoritry and check if on field 000 you can find
the Tag Editor.
2) Apply the patch.
3) In the authorities framework view the subfields of field 000 and select for
plugin option the value unimarc_leader_authorities.pl.
4) Restart memcached / plack if needed.
5) Repeat step 1 and notice if the Tag Editor is visible and click it to open
new window in order to manage the field contents and press OK.
6) Check the value of the generated leader.

Signed-off-by: Esther <estherm@sodapsringsid.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c692a8334c4345a5379005650d9c706dde9eabfc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29131: Row striping breaks color coding on item circulation alerts
Owen Leonard [Tue, 5 Oct 2021 12:12:34 +0000 (12:12 +0000)]
Bug 29131: Row striping breaks color coding on item circulation alerts

The CSS we use for table row "striping," which uses 'tbody
tr:nth-child(odd),' is often difficult to work with because it takes a
lot of increased specificity to override the default. Bootstrap
compounds this by adding its own similar CSS.

In order to overcome this I've added '!important' to the CSS embedded in
the item circulation alerts page. I normally would avoid '!important'
but since this CSS is only relevant to this page I think it's
appropriate.

This patch also adds [% FILTER collapse %] around the <style> block and
does some reindenting, so ignore whitespace when using diff to see the
changes clearly.

To test, apply the patch and go to Administration -> Item circulation
alerts.

- Check the "Legend" table. The first cells should be distinct colors:
  red, pink, and green.
- In the "Checkout" table, table cells should be green by default.
  Clicking in one of the cells should turn it red with the text
  "Disabled for all."
- Use the "Select a library" dropdown to pick a library.
- Clicking in any green cell should turn the cell pink and add the text
  "Disabled for XXX" where XXX is the branchcode.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 663d9e3c1dce692ba8102afcffc817546dea54cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29175: finishreceive: Replace , by ;
Marcel de Rooy [Tue, 5 Oct 2021 13:02:38 +0000 (13:02 +0000)]
Bug 29175: finishreceive: Replace , by ;

This certainly is one of my shortest fixes ever ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 18e4eed3e1a84256170b61d23dc290c0463c79ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28930: Keep cardnumber be editable after server side form validation fails during...
Andreas Jonsson [Tue, 31 Aug 2021 12:50:03 +0000 (12:50 +0000)]
Bug 28930: Keep cardnumber be editable after server side form validation fails during self registration.

Test plan:

- Enable the system preference PatronSelfRegistration
- Make sure  PatronSelfRegistrationBorrowerUnwantedField does not
  contain cardnumber.
- Set the system preference  GDPR_Policy to "Enforce".
- In the OPAC click "Log in to your account" and "Register here".
- Fill out the form with valid data, but make sure you leave the
  checkbox under "GDPR consent" unchecked.
- Submit the form
- You will get back the form with the error message "You have not filled
  out all required fields. Please fill in all missing fields and
  resubmit."
- Without patch: cardnumber is not editable, and there is no input
  element for borrower_cardnumber (so the cardnumber will be lost when
  resubmitting the form)
- With patch: cardnumber is editable.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d193fa8b3e657abd66032f9ab7f92d3e92d64e1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28303: Fix plugins system with multiple pluginsdir settings
Michael Hafen [Fri, 7 May 2021 20:13:49 +0000 (14:13 -0600)]
Bug 28303: Fix plugins system with multiple pluginsdir settings

C4/Templates::badtemplatecheck mucks with the config('pluginsdir') array ref.
This makes sure it operates on a copy of the array.

To test:
   1) $ prove t/db_dependent/Templates.t

Signed-off-by: David Nind <david@davidnind.com>
JK: Fix commit message styling and add test plan

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 9b9ac630ed4858d8a2f9c7a0f9e5ac02b9359a17)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28303: Add unit test for badtemplatecheck
Joonas Kylmälä [Sun, 3 Oct 2021 10:53:40 +0000 (10:53 +0000)]
Bug 28303: Add unit test for badtemplatecheck

This tests that pluginsdir value is not modified by the call to
badtemplatecheck to make sure badtemplatecheck operates with its own
copy of pluginsdir configuration value.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d329457a02271e2f43446075d37c33ce534a2969)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29133: Correct select2 strings
Jonathan Druart [Wed, 29 Sep 2021 09:05:04 +0000 (11:05 +0200)]
Bug 29133: Correct select2 strings

We are using 'max'/'min' when the arguments are 'maximum'/'minimum'.
Also using %n, %d when only %s is working in .format()

Have a look at https://github.com/select2/select2/blob/45f2b83ceed5231afa7b3d5b12b58ad335edd82e/src/js/select2/i18n/en.js
It's Select2 v.4.0.13, the one we are using. We should match what's
there.

Test plan:
Bug 29002 is using minimumInputLength, you can see the difference when
selecting a patron:
 "Please enter %s or more characters"
vs
 "Please enter 3 or more characters"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Bug 29133: (follow-up) Fix for argument mismatch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JK: fix typo in commit message
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 500725826f8e21db79b823c5e5f97618bb3e9fe2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29134: Use a subquery to increase performance of patron attributes search
Nick Clemens [Wed, 29 Sep 2021 12:26:59 +0000 (12:26 +0000)]
Bug 29134: Use a subquery to increase performance of patron attributes search

This patch generates a subquery and checks if a borrowrnumber is in the results to add patrons
to search results

To test:
 1 - Generate a bunch of patrons:
    SELECT surname, firstname, branchcode, categorycode FROM ( SELECT surname FROM borrowers ORDER BY rand() ) a,( SELECT firstname FROM borrowers ORDER BY rand() ) b,( SELECT branchcode FROM borrowers ORDER BY rand() ) c,( SELECT categorycode FROM borrowers ORDER BY rand() ) d LIMIT 50000
 2 - Add a patron attribute to the system and make it searchable - I used code 'TEST'
 3 - Add a value for this attribute to many patrons:
   INSERT INTO borrower_attributes (borrowernumber,code,attribute) SELECT borrowernumber, 'TEST','alphabet' FROM borrowers LIMIT 10000;
 4 - In staff client got 'Patrons'
 5 - Open the browser console (F12) and view the netwrok tab
 6 - Perform a patron search for 'a'
 7 - Note the time it takes for 'search' to complete in console
 8 - Apply patch, restart_all
 9 - Repeat search
10 - Note it is much faster
11 - prove -v t/db_dependent/Utils/Datatables_Members.t

NOTE: I tested with 500k patrons and 100k attributes - search returned in ~2 seconds with patch
and did not return before I got impatient without patch

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 173f3e950f192da5c03c58cbf4e7525e3227d567)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28352: Only check authorised values mapped to DB fields
Nick Clemens [Wed, 26 May 2021 11:42:02 +0000 (11:42 +0000)]
Bug 28352: Only check authorised values mapped to DB fields

The errors reported seem to be caused by authorised values mapped to MARC fields
but not mapped to a koha field.

We should additionally make sure to check the Default framework

Also, adding comment to indicate we only check records with items, because we do

TO test:
1 - In a framework that is not the default map a MARC field to an authorised value, but not a koha field
2 - In SQL, force the kohafield to NULL for the mapping you just make
    UPDATE marc_subfield_structure SET kohafield = NULL WHERE frameworkcode='BKS' and authorised_value='HINGS_AS'
3 - perl misc/maintenance/search_for_data_inconsistencies.pl
4 - get the following errors:
Use of uninitialized value $tmp_kohafield in pattern match (m//) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 151.
Use of uninitialized value $tmp_kohafield in substitution (s///) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 154.
Can't call method "get_column" on an undefined value at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 157.
5 - Apply patch
6 - Repeat
7 - No more errors

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 392f673caea98dbafddf562dc76dea5f0ebeda44)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29137: DBRev 20.11.10.002
Kyle Hall [Fri, 8 Oct 2021 13:47:57 +0000 (09:47 -0400)]
Bug 29137: DBRev 20.11.10.002

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29137: Add new syspref to disable AV creation within the cataloguing module
Jonathan Druart [Thu, 30 Sep 2021 06:56:36 +0000 (08:56 +0200)]
Bug 29137: Add new syspref to disable AV creation within the cataloguing module

"I don't like this patch at all!"
"We will see a cataloger revolt if we do not find a way to make this
optional for catalogers."

I imagined a hord of catalogers running behind me and I got scared.

This patch will allow to turn the new feature added by bug 25728 off.

Test plan:
Confirm that the new CreateAVFromCataloguing will permit to turn the
feature off.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4aaf9847c9c9e1a71345da6c691d30c9ba246f23)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28826: DBRev 20.11.10.001
Kyle Hall [Fri, 8 Oct 2021 13:32:21 +0000 (09:32 -0400)]
Bug 28826: DBRev 20.11.10.001

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28826: Add FacetOrder system preference
Nick Clemens [Fri, 6 Aug 2021 18:50:35 +0000 (18:50 +0000)]
Bug 28826: Add FacetOrder system preference

This bug adds a system preference to control ordering of facets and
adds the control to both Zebra and Elasticsearch

To test:
1 - Have a koha that can use both Zebra and ES
2 - Set 'displayFacetCount' to true
3 - Search in ES and Zebra
4 - Note facets in Zebra sorted alphabetically, ES by usage
5 - Apply patch, updatedatabase
6 - Search in ES and Zebra, facets are alphabetically sorted in both
7 - Find new syspref FacetOrder and set to 'by usage'
8 - Search in both engines, facets sorted by usage

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ef40ba17aef792df332a11f7e0269c5684d913ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27155: Include identifier test in Biblio_and_Items_plugin_hooks.t
Marcel de Rooy [Tue, 28 Sep 2021 11:50:22 +0000 (11:50 +0000)]
Bug 27155: Include identifier test in Biblio_and_Items_plugin_hooks.t

The biblio and item action hooks pass a biblionumber or itemnumber now
to the plugin at time of deletion.
This patch adds a tiny refinement to Biblio_and_Items_plugin_hooks.t
and the associated test plugin to be sure of that.

Test plan:
Run t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3d5ea8d426123e190369fafc35576096ebf96a3d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29091: Compiled CSS
Fridolin Somers [Thu, 21 Oct 2021 03:49:30 +0000 (17:49 -1000)]
Bug 29091: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29091: Correct display of lists and tags on search results
Owen Leonard [Thu, 23 Sep 2021 11:54:43 +0000 (11:54 +0000)]
Bug 29091: Correct display of lists and tags on search results

This patch makes a minor change to CSS to fix the display of tags and
lists on the OPAC search results page so that the list doesn't have
extra padding.

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

- To test you should be able to perform a catalog search in the OPAC
  which will return results which have one or more tags and which are on
  one or more lists.
- In the OPAC search results, confirm that there isn't extra padding
  between the "Tags:" and "Lists:" labels and their values.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 03a9cc45c5aa3ab99380dba1856a6977f46aa6d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29078: Resolve division by zero in touch_all scripts
Marcel de Rooy [Wed, 22 Sep 2021 14:06:07 +0000 (14:06 +0000)]
Bug 29078: Resolve division by zero in touch_all scripts

Illegal division by zero at misc/maintenance/touch_all_biblios.pl line 102.

Trivial fix.
Funny that the percentage is not even shown without verbose flag ;)

Test plan:
Run misc/maintenance/touch_all_biblios.pl -where 'biblionumber<0'
You should now see:
Good: 0, Bad: 0 (of 0) in 0 seconds

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3e0d6100314c3c6536f6145110796ed91ceb2c62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28940: In spinelabel-print.tt call IntranetUserJS only once
Lucas Gass [Wed, 1 Sep 2021 19:16:15 +0000 (19:16 +0000)]
Bug 28940: In spinelabel-print.tt call IntranetUserJS only once

1. In IntranetUser add some JS that will target spinelabel-print.tt, I used this:
    if ( $('#labels_spinelabel-print').length ) {
      $('#labels_spinelabel-print').append('<div>TEST</div>');
      console.log('TEST');
    }
2. Generate a quick spine label
3. Once you have entered a barcode the JS will go off 2x. With the jQuery added you will see 2 div's with the word 'TEST'. Look at the console and you will also see TEST console logged 2x.
4. Apply patch
5. Try seto 2 and 3 again, the JS should only be called once.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 41b8d6c1ffb4ea36dd6ccf5736bb6635dfa40bb9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28510: Remove marking of closed branches as 'disable_transfer'
Kyle M Hall [Thu, 3 Jun 2021 10:57:52 +0000 (06:57 -0400)]
Bug 28510: Remove marking of closed branches as 'disable_transfer'

We no longer need to act as if closed branches were marked as
disable_transfer. This allows us to clean up a nice bit of code.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 28510: Remove unused variable

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 15373c26f060aa9dba30854096fdce32664946ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28510: Skip processing holds queue items from closed libraries when HoldsQueueSki...
Kyle M Hall [Thu, 3 Jun 2021 10:44:59 +0000 (06:44 -0400)]
Bug 28510: Skip processing holds queue items from closed libraries when HoldsQueueSkipClosed is enabled

Right now we skip closed branch's items as we iterate over all items looking for ones to fill a hold. If HoldsQueueSkipClosed is enabled, no items held be a closed library can be targeted, so it would be more efficient if we never selected the items from those branches to begin with. This is how the holds queue works if we are not using the transport cost matrix, so we should make it work the same way if we *are* using the matrix.

Test Plan:
1) Apply this patch
2) prove prove t/db_dependent/HoldsQueue.t
3) All tests should continue to pass

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4b825ce3a53d7fceedd4118554c91eaf9e360793)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ed99f0fa0295a488a5cb27e6e80cce063147b1db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1803e69b2f59b29fc1ea153054944cfecbcec909)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
(cherry picked from commit 218c44c395e05ce3815c6eef0fb0ae34c6f729f8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
(cherry picked from commit 24d2e08c94ed6e25d7666d6fe2ae342645eb9232)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 841cb7839498cf69d59d3b7861ced42f8aba9d45)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28927: Compiled CSS
Fridolin Somers [Sat, 9 Oct 2021 02:23:18 +0000 (16:23 -1000)]
Bug 28927: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 41b741223167b2972e4b57f5e7e39bec055e9cbf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ae1511debb4737b5242ed99e0601f2101bb9ef4d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 89e2aa5a9bf5144672f38214869a8161561d410f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 619e60fd55fefedaea96113525373094c426c880)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7b1dc9d5f977aeb606cd2f766f3c3b8043d7a3f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3fe3b1864a2934b969175fe00b70c9b79fc8c03c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ad5db004e4ca08c37ebfb31a455568613c1d25a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c1e62798f1269080c190dd3956ece93e42cf11f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2c4e29795a10ffb2d4835803ca6fa6fd44812c2f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit aa474bf12e75a6a7d5ba1cfcb25251af1385b3e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c663876e105324feb7fce616ea19a6a1e1d421fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d1ad355d33a93e28cb6e286f226f3bc58978c2bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b16f66abd1bc35a34f6ed0337f08ae87d6d8adbd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a14b3fbcfe9edff8a4b110b8c675086973b91b21)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d26e754f03bd21857f768911c1373c80cc14476b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d1bf0469d873b01b457f0f6d897443403cdbebbb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5abd74c805cecb13c740cbcdf7764bfd1eb4cda8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c09ac22e4e28874991b8337516ddaefd72e6fbfb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit fc0cfd29377df00951c7c8da0caf472bb1fbee26)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c46cefb7c505e31bf3c0683f1f5ce3e08a1cd6f4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 869f1c758cb78454c48e180f1533893b5dcb5d11)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c3ef810a546ac35557484e12d7c2ff10c471b62d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoUpdate release notes for 20.11.10 release v20.11.10
Fridolin Somers [Wed, 22 Sep 2021 20:50:34 +0000 (10:50 -1000)]
Update release notes for 20.11.10 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoIncrement version for 20.11.10 release
Fridolin Somers [Wed, 22 Sep 2021 20:45:23 +0000 (10:45 -1000)]
Increment version for 20.11.10 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoFix translations for Koha 20.11.10
Victor Grousset/tuxayo [Fri, 23 Jul 2021 02:54:44 +0000 (04:54 +0200)]
Fix translations for Koha 20.11.10

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoMerge remote-tracking branch 'translate/20.11.10-translate-20210922' into new/securit...
Fridolin Somers [Wed, 22 Sep 2021 20:43:24 +0000 (10:43 -1000)]
Merge remote-tracking branch 'translate/20.11.10-translate-20210922' into new/security-release-20.11.10

2 years agoTranslation updates for Koha 20.11.10
Koha translators [Wed, 22 Sep 2021 20:41:01 +0000 (17:41 -0300)]
Translation updates for Koha 20.11.10

2 years agoBug 28772: Fix Koha/Object.t
Jonathan Druart [Tue, 21 Sep 2021 08:59:22 +0000 (10:59 +0200)]
Bug 28772: Fix Koha/Object.t

Koha::ApiKeys is no longer the simple object we need to test
Koha::Object->store, let use Koha::Library::Groups

2 years agoBug 28772: Fix auth_authenticate_api_request.t
Tomas Cohen Arazi [Tue, 21 Sep 2021 16:18:52 +0000 (13:18 -0300)]
Bug 28772: Fix auth_authenticate_api_request.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28772: DBRev 20.11.09.002
Victor Grousset/tuxayo [Mon, 20 Sep 2021 06:44:59 +0000 (08:44 +0200)]
Bug 28772: DBRev 20.11.09.002

2 years agoBug 28772: Make validate_secret return 1|0
Jonathan Druart [Fri, 10 Sep 2021 08:34:41 +0000 (10:34 +0200)]
Bug 28772: Make validate_secret return 1|0

Not an empty string

2 years agoBug 28772: (QA follow-up) Apply change to other dbrev too [STABLE]
Marcel de Rooy [Thu, 9 Sep 2021 12:42:01 +0000 (12:42 +0000)]
Bug 28772: (QA follow-up) Apply change to other dbrev too [STABLE]

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28772: Update existing keys [STABLE]
Tomas Cohen Arazi [Mon, 30 Aug 2021 14:08:30 +0000 (11:08 -0300)]
Bug 28772: Update existing keys [STABLE]

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28772: (QA follow-up) Fix wrong message
Tomas Cohen Arazi [Thu, 9 Sep 2021 11:53:07 +0000 (08:53 -0300)]
Bug 28772: (QA follow-up) Fix wrong message

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28772: Make secret validation use the new method
Tomas Cohen Arazi [Thu, 9 Sep 2021 11:38:25 +0000 (08:38 -0300)]
Bug 28772: Make secret validation use the new method

This patch makes the Koha::OAuth library use the new validation method

To test:
1. In master, enable RESTOAuth2ClientCredentials and have your
   superlibrarian patron a client_id/secret pair generated
2. Use Postman to gain an access token with the client_id/secret pair
=> SUCCESS: This works in Koha
3. Use the access token to GET /api/v1/patrons
=> SUCCESS: It works
4. Apply this patchset up to the regression tests
5. Run:
   $ updatedatabase
   $ koha-plack --restart kohadev
=> SUCCESS: All good
6. Repeat 2
=> FAIL: You get an error trying to acquire an access token. Boo
7. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/oauth.t
=> FAIL: Tests fail!
8. Apply this patch
9. Run:
   $ koha-plack --restart kohadev
   $ kshell
  k$ prove t/db_dependent/api/v1/oauth.t
=> SUCCESS: Tests pass!
10. Repeat 2
=> SUCCESS: Your original client_id/secret pair works!
11. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28722: Regression tests
Tomas Cohen Arazi [Thu, 9 Sep 2021 11:23:48 +0000 (08:23 -0300)]
Bug 28722: Regression tests

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove tt/db_dependent/api/v1/oauth.t
=> FAIL: Tests fail!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=28772

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28772: Display API secret once
Tomas Cohen Arazi [Mon, 30 Aug 2021 15:07:56 +0000 (12:07 -0300)]
Bug 28772: Display API secret once

This patch makes the apikeys.pl display the generated API secret once,
when generated. After that, it won't be displayed by the UI.

To test:
1. Generate a new API key
=> FAIL: The secret is displayed in the API keys table
2. Visit some other page, and go back to the API keys page
=> FAIL: The API key secret is there
3. Apply this patch
4. Go to More > Manage API keys
=> SUCCESS: It no longer displays the secret
5. Generate a new API key
=> SUCCESS: The API key details (including the secret) are displayed.
=> SUCCESS: A message telling to copy the secret because it won't be
            displayed again is shown.
6. Repeat 4
=> SUCCESS: The secret is no longer displayed
7. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28772: Add a warning about hash_password usage in updatedatabase.pl
Tomas Cohen Arazi [Mon, 30 Aug 2021 14:08:57 +0000 (11:08 -0300)]
Bug 28772: Add a warning about hash_password usage in updatedatabase.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28772: Make Koha::ApiKey->store encrypt the secret
Tomas Cohen Arazi [Thu, 26 Aug 2021 23:24:43 +0000 (20:24 -0300)]
Bug 28772: Make Koha::ApiKey->store encrypt the secret

This patch refactors the Koha::ApiKey class so:
- It encrypts the generated secret
- Allows accessing the plain text secret only immediately after the key
  creation (this implies that it won't be accessible if the key is
  fetched from the DB).
- It implements an allow list for attributes, that are not read only.
  Changing any other of them will make ->store throw an exception.
- A method for validating plain text secrets against the encrypted one
  is added.
- A method for accessing the plain text secret is added. Returns undef
  if the object is not 'fresh'.

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28759: limit accessibility for "Manage API keys"
Petro Vashchuk [Tue, 10 Aug 2021 15:08:53 +0000 (18:08 +0300)]
Bug 28759: limit accessibility for "Manage API keys"

This patch limits the accessibility for "Manage API keys" section only
to superlibrarians and the owner of that said API key account.

The way it does it is by checking if user is superlibrarian or if
logged-in user is the same as a patron id/borrower number is the same
as logged-in user number both in template and apikeys.pl and making sure
the link is inaccessible or redirects to the 403 page if user tries to
go there directly.

To reproduce:
1) create/pick existing patron, set Staff access, allows viewing
of catalogue in staff interface (catalogue)" and "Add, modify and
iew patron information (borrowers)" permissions on;
2) enable "RESTOAuth2ClientCredentials" in sysprefs;
3) login with that user into staff interface;
4) check any other patron, go to the "More"->"Manage API keys" and
check that you can see, add delete their API keys;
5) apply patch;
6) with that same user try to access "Manage API keys" page again.
Ensure that you can't access that page of other patrons but can
access your own page and manage your own API keys.
7) log in with superlibrarian now and ensure that you can access every
"Manage API keys" page of every patron and apply changes there.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 28941: Deal with OPACSuggestionUnwantedFields
Jonathan Druart [Fri, 10 Sep 2021 09:33:18 +0000 (11:33 +0200)]
Bug 28941: Deal with OPACSuggestionUnwantedFields

Remove fields from OPACSuggestionUnwantedFields before creating the
suggestion

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: remove useless sort

2 years agoBug 28941: Filter suggestion inputs at the OPAC
Jonathan Druart [Thu, 2 Sep 2021 09:51:48 +0000 (11:51 +0200)]
Bug 28941: Filter suggestion inputs at the OPAC

The following sequence is bad:
46 my $suggestion      = $input->Vars;

181         &NewSuggestion($suggestion);

All columns can be set when we insert the suggestion into the DB
We definitely want to avoid the following fields to be set by the final
user: acceptedby, accepteddate, STATUS, etc...

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2 years agoBug 28935: (QA follow-up) Use BorrowerUnwantedField on staff client
Nick Clemens [Mon, 13 Sep 2021 12:56:30 +0000 (12:56 +0000)]
Bug 28935: (QA follow-up) Use BorrowerUnwantedField on staff client

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28935: No filtering on patron's data on member entry pages
Marcel de Rooy [Wed, 1 Sep 2021 14:04:31 +0000 (16:04 +0200)]
Bug 28935: No filtering on patron's data on member entry pages

Security patch. Follow-up for 28929.
Including correction for gonenoaddress and two others.
Includes unwanted fields too now.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2 years agoBug 28947: Prevent OPAC user to create new users
Jonathan Druart [Fri, 3 Sep 2021 10:01:12 +0000 (12:01 +0200)]
Bug 28947: Prevent OPAC user to create new users

This patch prevents an existing user from exploiting the patron edit form in order to
force create new patrons

To test:
Try all combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
with and without this patch.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2 years agoBug 28929: Add selenium tests
Jonathan Druart [Tue, 31 Aug 2021 15:12:22 +0000 (17:12 +0200)]
Bug 28929: Add selenium tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 28929: (follow-up) Add exec flag to tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28929: Prevent flags to be sent during patron's edition
Jonathan Druart [Tue, 31 Aug 2021 13:55:15 +0000 (15:55 +0200)]
Bug 28929: Prevent flags to be sent during patron's edition

* selfreg and selfmod for OPAC
* patron's edition on staff

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested OPAC and staff side. Prevents mangling flags column.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 28392: make streettype and B_streettype work with BorrowerUnwantedField
Lucas Gass [Wed, 1 Sep 2021 14:17:21 +0000 (14:17 +0000)]
Bug 28392: make streettype and B_streettype work with BorrowerUnwantedField

To test:
1. Add values to the AV ROADTYPE
2. Go to the BorrowerUnwantedField system preference and attempt to hide streettype and B_streettype.
3. It doesn't work, the fields still show.
4. Apply patch
5. Repeat step 2, it should work now.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5c262d4511428446ae46594792e0190db5130d4d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 21794: (QA follow-up) Separate city and country with a comma
Joonas Kylmälä [Sat, 4 Sep 2021 18:23:16 +0000 (18:23 +0000)]
Bug 21794: (QA follow-up) Separate city and country with a comma

If only the city and country address information was provided they ended
up being glued together like this: CityCountry. (AddressFormat=US style)

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 52c9eec25d5ac44da265ef9eb8930d0b78aa4e30)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>