koha.git
3 years agoBug 25641: [19.11.x] Fix XSLT_Handler.t failures on U20 19.11.x
Jonathan Druart [Wed, 19 Aug 2020 12:50:23 +0000]
Bug 25641: [19.11.x] Fix XSLT_Handler.t failures on U20

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26162: [19.11] Fix DT info label
Jonathan Druart [Wed, 19 Aug 2020 05:25:06 +0000]
Bug 26162: [19.11] Fix DT info label

There is an inconsistency in 19.11:
% grep Showing koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc koha-tmpl/intranet-tmpl/prog/js/datatables.js
koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc:    var MSG_DT_INFO = _("Showing _START_ to _END_ of _TOTAL_");
koha-tmpl/intranet-tmpl/prog/js/datatables.js:        "sInfo"             : window.MSG_DT_INFO || "Showing _START_ to _END_ of _TOTAL_ entries",

The "entries" is not always displayed.

datatables.inc has been removed from 20.05 by
Bug 24662: Remove global variables MSG_* from datatables.inc

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26162: Don't fall into an infinite loop
Jonathan Druart [Wed, 19 Aug 2020 05:19:09 +0000]
Bug 26162: Don't fall into an infinite loop

If something went wrong we do want to stop the script!

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26000: Make exception_holidays cache with branch in key
Nick Clemens [Fri, 17 Jul 2020 11:31:29 +0000]
Bug 26000: Make exception_holidays cache with branch in key

In light of 25723 offering a simpler solution here.
This would just let us avoid backporting larger changes, but this can be
marked as a duplicate if 25723 is preferred to this change

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26000: Unit test
Nick Clemens [Thu, 16 Jul 2020 19:30:28 +0000]
Bug 26000: Unit test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26012: Correctly format "paid for" info on the item details view
Jonathan Druart [Wed, 29 Jul 2020 14:49:14 +0000]
Bug 26012: Correctly format "paid for" info on the item details view

The string is built controller side, which does not let the template
format the info nicely.
We want to display patron's info using patron-title.inc and the date
with the KohaDates plugin

Test plan:
- Make sure there is a replacement cost in the item
- check it out
- Mark it lost
- Pay the lost item fee
- Go to the detail page and look on the items tab for the item
- It will show an entry with "Paid for?" label
The patron's info and date must be correctly formatted

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f16934384efe502a6247b1c4cb981d2684e6dee3)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26165: Fix duplication of large saved reports
Jonathan Druart [Fri, 7 Aug 2020 10:44:28 +0000]
Bug 26165: Fix duplication of large saved reports

If the combined character length of a saved report's
title, notes and SQL is too long then pressing the
'duplicate' button will lead to an error:

"Request-URI Too Long
The requested URL's length exceeds the capacity limit
for this server."

Test plan:
1. Create a simple SQL report and add a lot of text
   into the notes field (the combined URL lenth must be
   >8225 characters)
2. Save the report
3. Press the duplicate the report from the saved reports page

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 81f06881a45d7647481aa8a21354a772f3daff88)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 50cbaa3262b11f9b4541464371477200ed84ca8a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 23542: Fix SRU import encoding
Fridolin Somers [Mon, 29 Jun 2020 13:07:10 +0000]
Bug 23542: Fix SRU import encoding

When importing records from a SRU server, the diacritics have bad encoding.
I reproduce with BNF server so it may be a UNIMARC issue.

Tests show that difference between Z39.50 server and SRU is that leader contains 'a' at postion 9.
Looking at MARC::Record->encoding() shows that encoding depends on leader even for UNIMARC.
So this patch adds a call to MARC::Record->encoding('UTF-8') in case of a SRU server in C4::Breeding.

Same use exists in Koha::MetadataRecord::Authority::get_from_breeding().

In case of import via Z3950, MarcToUTF8Record() is called,
 which calls SetMarcUnicodeFlag(),
 which calls MARC::Record->encoding('UTF-8')

Test plan :
1) Use a UNIMARC database
2) Configure a connexion to a UNIMARC SRU, for example BNF,
   see https://doc.biblibre.com/koha/autour_de_koha/serveurs_z3950_sru#serveur_de_la_bnf
3) Go to cataloguing module
4) Click on 'New from Z39.50/SRU'
5) Choose only the SRU target
6) Search for ISBN 2266072889
7) Confirm you see good encoding : diacritic on 'a' of title 'Strate-a-gemmes'
8) Click on 'Marc preview'
9) Confirm you see good encoding
10) Click import
11) Confirm you see good encoding
12) Check also Authorities import via SRU
13) Check also SRU imports on a MARC21 database

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Removed change to new_from_xml call. We should respect syntax.
But the added MARC::Record encoding does the tric! Which is implicit
for Z3950 targets where MarcToUTF8Record does the same.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 79855e9f5bdbcb3bdaedd33bed574b35eee5501d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25882: Remove phr indicator from limits when processing
Nick Clemens [Fri, 26 Jun 2020 13:19:47 +0000]
Bug 25882: Remove phr indicator from limits when processing

We assume all limits from advanced search to be a phrase and quote them
when doing this we should remove the phrase marker to avoid doulbe quoting

To test:
 1 - Have koha using ES
 2 - Go to advanced search
 3 - Limit by a single itemtype that exists
 4 - Get some results
 5 - Limit by a different itemtype that exists
 6 - Get some results
 7 - Limit by both itemtypes
 8 - Get only the results for the second itemtype
 9 - Enable DumpTemplateVarsIntranet and DumpSearchQueryTemplate
10 - Repeat search
11 - View page source and find 'search_query'
12 - See limit looks like itype:("("BK")" OR "("CR")")
13 - Apply patches
14 - Restart all the things
15 - Repeat search for both itemtypes
16 - Note results now include both types

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.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 a2b2426de842ac86048cbf71e3760b6483fc0b3c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 455acf686d7e74aa5582bc700e856935e852573a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25882: Unit test
Nick Clemens [Fri, 26 Jun 2020 13:19:32 +0000]
Bug 25882: Unit test

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.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 1a2d7f1eacc0722ea0723577823ee6a477a46b0a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dbc7f861d4695a8538602b01d0e9402dff01ff02)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25336: Show checkouts/fines to guarantor is in the wrong section of the patron...
David Roberts [Sun, 3 May 2020 23:48:09 +0000]
Bug 25336: Show checkouts/fines to guarantor is in the wrong section of the patron file

This patch moves the "Show checkouts to guarantor" and "Show fines to
guarantor" data to display under the Contact information block

To test:

1) Enable the AllowStaffToSetCheckoutsVisibilityForGuarantor and AllowStaffToSetFinesVisibilityForGuarantor system preferences to Allow
2) View a patron record.
3) The "Show checkouts to guarantor" and "Show fines to guarantor" field
will be on the right hand side of the screen under the Library use
block.
4) Apply patch
5) Check that this data has now moved to the Contact information block
on the left hand side of the patron record.

Works for me!

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2478ba03f064b70e03da9c6ca3667c8b5fd37403)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25853: Fix file permissions for update_patrons_category script
Katrin Fischer [Sat, 18 Jul 2020 01:53:34 +0000]
Bug 25853: Fix file permissions for update_patrons_category script

The permissions for this were -rw-r--r-- and need to be -rwxr-xr-x.

To test:
- Verify the file permissions before and after applying the patch.

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 74354d414467e4cba61a1114bc777ad37174ae8b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26009: (QA follow-up) It does not harm to test more
Josef Moravec [Thu, 6 Aug 2020 19:15:44 +0000]
Bug 26009: (QA follow-up) It does not harm to test more

Test plan:
prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t
--> should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 877cc214f0be2aa7df5a066f34ef543db8e72ab2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26009: Add facet size to home/holdingbranch
Nick Clemens [Fri, 17 Jul 2020 16:23:42 +0000]
Bug 26009: Add facet size to home/holdingbranch

To test:
0 - Set DisplayLibraryFacets to 'both' and FacetMaxCount to 20
1 - Have more than 10 branches
2 - Have items in each of those branches
3 - Enable ES, set system preference SearchEngine to Elasticsearch
4 - Search for '*'
5 - Expand homebranch/holdingbranch facets
6 - Note you only get 10
7 - Apply patch
8 - Repeat search
9 - Now you get all your facets

Signed-off-by: Michael Springer <mspringer@mylakelibrary.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 18215fbc575c62d4f6410743fe82d199abd0c69f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25683: (follow-up) Use COALESCE instead of IFNULL
Nick Clemens [Tue, 4 Aug 2020 18:28:42 +0000]
Bug 25683: (follow-up) Use COALESCE instead of IFNULL

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6bea771b8048282c61b260699e1b62d8944a7f90)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25683: Fix grouping of results
Nick Clemens [Wed, 10 Jun 2020 12:26:06 +0000]
Bug 25683: Fix grouping of results

DBIX doesn't seem to work as I expected - if trying to group by we can only
get the columns we grouped by, otherwise the queries are much more complicated
and come out wrong

This patch removes the 'amountoutstanding' from the query. Note that we do return patron
object, however, to access all the columns we must discard_changes (or refetch)

Also fixes a typo 'verbosse'

To test:
1 - charge a $1 fine to a patron
2 - pay off the fine
3 - perl misc/cronjobs/update_patrons_category.pl -f J -t J -fu=5 -v
4 - Note the patron is returned twice
5 - export DBIC_TRACE=1
6 - repeat 3 - view the SQL query and see how odd it is
7 - Apply this patch
8 - repeat 3 - simpler query
9 - patron returned only once

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 41f73194c42d306f3aa9893a01d01938489546bd)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25683: Patron with no accountlines should have 0 outstanding (not NULL)
Nick Clemens [Tue, 9 Jun 2020 10:52:26 +0000]
Bug 25683: Patron with no accountlines should have 0 outstanding (not NULL)

Test plan:
- Have a patron with nothing in accountlines
- run update_patron_categories to find patrons with fines under $5 (-fu=5)
  - Your patron is not found
  - Give your patron a manual charge of $1
  - rerun the cron, your patron is found
  - pay off your patron's fine, putting their balance at $0
  - rerun the cron, your patron is found

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 09146f4a995d50206c7f1c2d80e797b3cb1175c5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6ae42c8c3c7e402db20f424d16950a6162951ac1)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26098: Fix JS error on the fund list view when no fund displayed
Jonathan Druart [Thu, 30 Jul 2020 08:51:26 +0000]
Bug 26098: Fix JS error on the fund list view when no fund displayed

TypeError: this.data(...) is undefined
in jquery.treetable.js

Test plan:
Go to the fund list view
Select a filter that will return no result
=> With this patch applied there is no JS error in the console

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 052d5d5568190396d096df528bdc5aed7558e38c)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25893: Use wildcards when searching logs
Nick Clemens [Mon, 29 Jun 2020 18:15:39 +0000]
Bug 25893: Use wildcards when searching logs

The restores the wildcards that were used in the past

To test:
 0 - Ensure cataloguing logs and issues logs are enabled
 1 - Edit an item
 2 - Circulate that same item
 3 - Browse to tools-> log viewer
 4 - Put the itemnumber in the 'info' box
 5 - You see only the circulation
 6 - Put the itemnumber in the object box
 7 - You see only the cataloging modification
 8 - Apply patch
 9 - Put itemnumber in info box
10 - you see both actions
11 - Put the itemnumber in the object box
12 - You see only the catalogiong modification

Signed-off-by: Jason Robb <jrobb@sekls.org>

Bug 25893: Don't wildcard object

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 25893: (follow-up) Undo unrelated changes

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 30229e383cd3c2f92894449598a1433f52072c24)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26162: Wait for the table to be refreshed
Jonathan Druart [Mon, 10 Aug 2020 09:59:58 +0000]
Bug 26162: Wait for the table to be refreshed

The previous patch did not work as expected. We still got a
StaleElementReference exception.
But this time on
10:43:47 selenium_1   | Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//*[@id=\"branchname\"]"}
Because we found the one that existed on the page, not the one sent back
in AJAX.

The idea of this patch is to search for the "Showing 1 to X of Y entries" info and wait for X == Y

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ce8a819b5fb77a8df59f131b4af96e24106bd32e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26162: Make Selenium click action more robust
Jonathan Druart [Thu, 6 Aug 2020 13:08:48 +0000]
Bug 26162: Make Selenium click action more robust

See
https://stackoverflow.com/questions/12967541/how-to-avoid-staleelementreferenceexception-in-selenium
https://www.selenium.dev/exceptions/
https://developer.mozilla.org/en-US/docs/Web/WebDriver/Errors/StaleElementReference

This patch will fix the following failure we get under D11:
18:47:07 selenium_1   | 09:47:07.478 WARN - Exception: Element not found in the cache - perhaps the page has changed since it was looked up
18:47:07 selenium_1   | For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html
18:47:07 selenium_1   | Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
18:47:07 selenium_1   | System info: host: '78b9a07f51f2', ip: '192.168.16.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.0-9-amd64', java.version: '1.8.0_91'
18:47:07 selenium_1   | Driver info: driver.version: unknown
18:47:07 koha_1       |
18:47:07 koha_1       | STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
18:47:07 koha_1       |  /usr/local/share/perl/5.26.1/Selenium/Remote/Driver.pm:353 in Try::Tiny::try
18:47:07 koha_1       |  (eval 1571):1 in Selenium::Remote::Driver::__ANON__
18:47:07 koha_1       |  (eval 1573):2 in Selenium::Remote::Driver::__ANON__
18:47:07 koha_1       |  (eval 1546):17 in Selenium::Remote::Driver::_execute_command
18:47:07 koha_1       |  /usr/local/share/perl/5.26.1/Selenium/Remote/WebElement.pm:63 in Selenium::Remote::WebElement::_execute_command
18:47:07 koha_1       |  /kohadevbox/koha/t/lib/Selenium.pm:184 in Selenium::Remote::WebElement::click
18:47:07 koha_1       |  /kohadevbox/koha/t/lib/Selenium.pm:172 in t::lib::Selenium::click_when_visible
18:47:07 koha_1       |  t/db_dependent/selenium/administration_tasks.t:131 in t::lib::Selenium::click

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d8ead7bac5642ba1d98691d1fd48c266403451df)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26143: Make the API handle per_page=-1
Tomas Cohen Arazi [Wed, 5 Aug 2020 15:09:40 +0000]
Bug 26143: Make the API handle per_page=-1

This patch introduces handling for per_page=-1 and actually adds a
missing feature to the API: being able to request all resources on a
route.

To test this:
1. Visit the libraries admin page
2. On the table, choose to display 'All' rows
=> FAIL: it doesn't refresh, the browser console displays a 500 error
code and so the logs
3. Apply the tests patches
4. Run:
   $ kshell
  k$ prove t/Koha/REST/Plugin/Pagination.t \
           t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail loudly
5. Apply this patch
6. Restart plack
7. Repeat 2
=> SUCCESS: choosing to display all, works
8. Repeat 4
=> SUCCESS: Tests pass now!
9. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 72bcf69f425a92ce4adfb4919a412d7797a82df2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26143: Regression tests
Tomas Cohen Arazi [Wed, 5 Aug 2020 15:04:47 +0000]
Bug 26143: Regression tests

This patch introduces tests for the per_page=-1 handling use case. From
now on per_page=-1 means 'all resources'.

On writing this I noticed that we always paginate results no matter
what, but there was a weird condition under which on pagination headers
were sent back to the API consumer. This is highlighted in the precedent
patch, which is not the -1 situation this one tries to tackle.

Both pagination and searching are broken with per_page=-1, which is a
standard, and we actually didn't explicitly set a way to request all
resources.

To verify this:
1. Apply the previous tests patch and this one
2. Run:
   $ kshell
  k$ prove t/Koha/REST/Plugin/Pagination.t \
           t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Things are damn broken

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9a4910812f03fade73d27db8ce975dc0a15fe9e7)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26143: The API is always paginated
Tomas Cohen Arazi [Wed, 5 Aug 2020 14:55:28 +0000]
Bug 26143: The API is always paginated

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd3c09e8486eb79f709dd5ea484f1c09c1805289)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26043: Fix random failure from Holds.t
Jonathan Druart [Wed, 22 Jul 2020 12:11:03 +0000]
Bug 26043: Fix random failure from Holds.t

 #   Failed test 'Test ModReserveMinusPriority()'
 #   at t/db_dependent/Holds.t line 202.
 #          got: undef
 #     expected: '1605'
 # Looks like you failed 1 test of 66.

It is coming from Koha::Patron->holds that is ordering by reservedate,
so "sometimes" they are ordered in reverse (at least it's my
understanding of the problem).

Test plan:
Run the test file several times (from 20 to 60x), it must never fail
with this patch

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 80a611797bf67b263b6b84a6e931833ea336b6a5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c98a283d118bb936dc44db1b73cfeb8e45f89a22)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25762: Typo in linkitem.tt
Owen Leonard [Wed, 29 Jul 2020 12:21:29 +0000]
Bug 25762: Typo in linkitem.tt

This patch corrects the same typo in two different templates:

&rsquo; -> &rsaquo;

If you want to test beyond examining the patch, apply the patch
and go to Tools -> Rotating collections.

- Add an item to a rotating collection.
- In the browser's title bar (or the tab title if the title bar isn't
  shown) the separator between the rotating collection name and "Add or
  remove items" should be ">" instead of "`"
- Enable the EasyAnalyticalRecords system preference.
- View the detail page for a bibliographic record.
- From the "Edit" menu, choose "Link to host record"
- Check the title bar as you did previously.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a8a7d8667edbe6d8b9ab19c33a6cd4ce1a8ca4f6)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25873: Ignore malformed data for Elasticsearch integer fields
Julian Maurice [Thu, 25 Jun 2020 07:25:41 +0000]
Bug 25873: Ignore malformed data for Elasticsearch integer fields

If we try to put malformed data into an integer field, Elasticsearch
rejects the whole document.
Setting 'ignore_malformed' to true allows to ignore malformed data and
process the other fields of the document normally

https://www.elastic.co/guide/en/elasticsearch/reference/7.8/ignore-malformed.html

Test plan:
* Without the patch
  1. In search engine configuration, change the type of a text field to
  'Number' (for instance 'title')
  2. misc/search_tools/rebuild_elasticsearch.pl -d -b
  3. See that the index is empty (unless you have titles consisting only
  of digits)
* With the patch
  1. misc/search_tools/rebuild_elasticsearch.pl -d -b
  2. Now records are correctly indexed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 056eb8c74e0b01386a0a1127ed5fff5ef59390b1)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26111: Add "Serials" (SER) to the reports dictionnary
Jonathan Druart [Fri, 31 Jul 2020 09:53:53 +0000]
Bug 26111: Add "Serials" (SER) to the reports dictionnary

It's missing in the template

Test plan:
Go go Home › Reports › Guided reports wizard › Dictionary
At step 2, notice that with this patch you have "Serials" in the
dropdown list (instead of an empty entry)

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3c6155b669e9891307e417cf7b73cd63b57fb624)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25887: Keep library filter on the fund list view
Jonathan Druart [Thu, 30 Jul 2020 08:57:53 +0000]
Bug 25887: Keep library filter on the fund list view

The problem:
When filtering funds by library, the pull down for libraries resets to "empty" when the page is reloaded,
although the filter criteria is visible in the URL.

Test plan:
Create a fund for library A
Create a fund for library B
Go to the fund list view
=> All funds are listed
Select library A in the library filter, click "Go"
=> Funds for library A are listed
=> Library filter has "library A" selected
Edit fund for library B
=> The edit form has "library B" selected

Signed-off-by: Holly Cooper <hc@interleaf.ie>

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 09ed4c0dd7277931c1e631c5b1329463fc9751e5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd86d4fe7f2953057f8b608cf8c3893585ab1dde)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25852: Add tests
Jonathan Druart [Thu, 30 Jul 2020 09:59:44 +0000]
Bug 25852: Add tests

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 57e3f2ed7b69e815743d817ac094600d3a40bec8)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25852: Improve C4::Creators::Lib reliability under plack
Jonathan Druart [Thu, 30 Jul 2020 10:00:03 +0000]
Bug 25852: Improve C4::Creators::Lib reliability under plack

This is certainly a major issue that leads to many side-effects.
Under plack, the structure of the default values are not handled
correctly.
Package variables are used to store stuff like the "layout type". They
are complex structures (arrays of hashes) and returned without being
copied.
When the caller (the controller script) retrieve them then modify the
returned structures, it actually modifies the package's variables.

One of the issue is:
Create a new layout
The script retrieve a structure with all "selected" flags are set to 0
It select the first one as default (BAR as selected => 1)
The user creates the new layout and will selected BIBBAR (for instance)
If you then edit this new layout, the script will retrieve the
"label_types" and set "selected" for BIBBAR. However BAR is still
selected!
The UI receives 2 selected and display the first selected one that has
the selected option.

Test plan:
1. Create a layout type for Barcode/Biblio
2. Choose fields to print and size of font
3. Save
4. Edit existing Layout
=> Withtout this patch "Barcode" is the preselected option
=> With this patch applied, the correct "Barcode/Biblio" option is
selected

Signed-off-by: Kelly McElligott <kelly@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 0a9d3f17d9e44b5326a42d14420d30243031629d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e2c9fdb5bd702e358aa5b7f86e1ddf80525a4128)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25599: Fix default value placeholders for UseACQFrameworkForBiblioRecords
Jonathan Druart [Tue, 26 May 2020 08:50:31 +0000]
Bug 25599: Fix default value placeholders for UseACQFrameworkForBiblioRecords

The feature was there but a condition disabled it.

Test plan:
- modify the default value for 008@ or another subfield in the ACQ framework using one or more of the placeholders above
- activate UseACQFrameworkForBiblioRecords
- create a basket
- create an order from a new record
- verify the values have been replaced

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 b16e463173e8125396eaef3159d08df5d0d2cfb6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 34b5cd5267243867042325550ba50bd7a0ee46aa)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26070: DBRev 19.11.08.003
Aleisha Amohia [Fri, 7 Aug 2020 02:22:05 +0000]
Bug 26070: DBRev 19.11.08.003

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26070: Remove GoogleIndicTransliteration system preference
Owen Leonard [Mon, 27 Jul 2020 19:16:07 +0000]
Bug 26070: Remove GoogleIndicTransliteration system preference

The Google Transliterate API was deprecated on May 26, 2011. This patch
removes the feature and associated system preference.

To test, apply the patch and run the database update process.

 - Go to Administration -> System preferences and search for
   'GoogleIndicTransliteration.' There should be no results.
 - Search the Koha codebase for references to
   'GoogleIndicTransliteration.' There should be no current references..

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.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 9b9e8fd32852acceb10cfc54d4a5a3acc0f6e232)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cde498344dcb2739bd703b53bdbcdf728d5b5f0a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25982: OPAC shelves RSS link output is xml
Didier Gautheron [Sun, 12 Jul 2020 12:09:15 +0000]
Bug 25982: OPAC shelves RSS link output is xml

Output rss feed as text/xml

Test plan:
1) have books entered
2) log in create a list
3) add books to list
4) display list in OPAC
5) click the RSS link button.
   -- output is displayed as html text
6) apply patch
7) repeat steps 4&5
   -- output is displayed as xml tree

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.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 3d0da68d5ada37b40099fbc11b63202ccf7a48b2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 549cc995b2796b9e413c2860fe2d09fef5d97778)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js
Owen Leonard [Thu, 18 Jun 2020 13:10:35 +0000]
Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js

This patch adds the necessary JavaScript includes to the OPAC to
enable translation of strings in JavaScript. It also updates the
translation of cart-related strings by removing the strings from
opac-bottom.inc and putting them in basket.js where they are used.

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

 - Update a translation:

   > cd misc/translator
   > perl translate update fr-FR

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

   #: koha-tmpl/opac-tmpl/bootstrap/js/basket.js:89
   msgid "Your cart is currently empty"
   msgstr ""

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

   > perl translate install fr-FR

In the OPAC, switch to the language you're testing. Confirm that your
translated string appears. In the above example, by clicking the "Cart"
icon in the header when there are no items in the cart.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 46710cfc0018d7107a68a1e6da847262bfb2470c)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25499: Fix fund code column when closing a budget
Katrin Fischer [Fri, 22 May 2020 23:12:22 +0000]
Bug 25499: Fix fund code column when closing a budget

When closing a budget the fund code column in the table is
always empty. This is due to a TT variable not being correct.

To test:
- Create a budget and fund
- Order anything, leave basket open or not, but don't receive
- Duplicate your existing budget
- Close the first budget in order to move the pending orders
- Verify the fund code is not showing in the table
- Apply patch and reload the patch
- Verify fund codes are now showing correctly

Bonus: Changes the column heading Fund id to Fund ID.

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6ad9baace2099650a14c0ee478130ca3c01c673a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25920: Add liblocale-codes-perl package to fix ubuntu-stable (focal)
Mason James [Fri, 3 Jul 2020 11:42:02 +0000]
Bug 25920: Add liblocale-codes-perl package to fix ubuntu-stable (focal)

to test on ubuntu-20...

1/ install koha-common pkg
 $ sudo apt install koha-common

2/ confirm liblocale-codes-perl pkg is not installed :(
 $ apt-cache policy  liblocale-codes-perl | grep Installed
 Installed: (none)

3/ apply patch

4/ build and install new koha-common pkg

5/ confirm liblocale-codes-perl pkg is now installed :)
 $ apt-cache policy  liblocale-codes-perl | grep Installed
 Installed: 3.62-1

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 43aa7f36bf40692e2f71ebea6b122079a73522bd)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 24379: Fix failing tests
Jonathan Druart [Mon, 20 Jul 2020 13:16:29 +0000]
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>
(cherry picked from commit c0e665aeccbc028f4289e7b1c144f844c05b5198)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 24379: DBIC
Aleisha Amohia [Wed, 5 Aug 2020 00:08:00 +0000]
Bug 24379: DBIC

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 24379: DBRev 19.11.08.002
Aleisha Amohia [Wed, 5 Aug 2020 00:07:40 +0000]
Bug 24379: DBRev 19.11.08.002

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 24379: Make login_attempts not nullable
Nick Clemens [Wed, 8 Jan 2020 20:59:38 +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>
(cherry picked from commit 6d675b61ad2dfd8fa6cfd0f58a9ebb8d534bd358)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 20882: DBIC
Aleisha Amohia [Wed, 5 Aug 2020 00:00:37 +0000]
Bug 20882: DBIC

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 24640: DBIC
Aleisha Amohia [Tue, 4 Aug 2020 23:55:20 +0000]
Bug 24640: DBIC

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25709: DBRev 19.11.08.001 - fixing output message
Aleisha Amohia [Tue, 4 Aug 2020 23:46:48 +0000]
Bug 25709: DBRev 19.11.08.001 - fixing output message

3 years agoBug 25709: DBRev 19.11.08.001
Aleisha Amohia [Thu, 30 Jul 2020 15:39:32 +0000]
Bug 25709: DBRev 19.11.08.001

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25709: Rename systempreference to NotesToHide
Nick Clemens [Mon, 6 Jul 2020 17:56:35 +0000]
Bug 25709: Rename systempreference to NotesToHide

In an effort to use more inclusive language we have added a new coding guideline:
https://wiki.koha-community.org/wiki/Coding_Guidelines#TERM3:_Inclusive_Language

This patchset renames a syspref to be clearer and follow the guideline

To test:
1 - Apply patch and updatedatabase
2 - git grep NotesBlacklist
3 - Note all remaining occurrences are translations, db updates, and release notes
4 - Add a field (e.g. '520' ) to the NotesToHide systempreference
5 - View a record with a 520 field on the opac
6 - Confirm the field does not show in the 'Title notes' tab

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f00ce94d94b079a9e8e326ea3bad99e5567d93f2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 23086: Search for collection is broken
Kyle M Hall [Wed, 18 Sep 2019 14:28:33 +0000]
Bug 23086: Search for collection is broken

It appears that we are quoting the ccode values deep in the search code.
Under ICU chains this breaks searching by limits

To recreate
 1 - Setup Koha using Zebra and icuchains
 2 - Add ccode to AdvancedSearchTypes
 3 - In koha-conf.xml set zebra debug level to include request
  <zebra_loglevels>none,fatal,warn,request,info</zebra_loglevels>
 4 - Set some items into different ccodes
 5 - On opac perform a search for:
    ccode:NFIC
 6 - It works
 7 - tail -n 50 /var/log/koha/kohadev/zebra-output.log
 8 - Note search request like:
    Search biblios OK 26 1 1+0 RPN @attrset Bib-1 @attr 1=8009 NFIC
 9 - On opac go to advanced search, select Collection, and limit to smae code a s above
10 - No results
11 - Check the zebra-output.log:
    Search biblios OK 0 1 1+0 RPN @attrset Bib-1 @attr 1=8009 'NFIC'
12 - Apply patch
13 - Restart all
14 - Repeat search by collection limit
15 - Success!
16 - Check the zebra-output.log:
    Search biblios OK 0 1 1+0 RPN @attrset Bib-1 @attr 1=8009 NFIC
17 - Add a new ccode value: N)N
18 - Set some items to that ccode
19 - Confirm searching by that ccode works

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4733a2a4215c9351a398945ea2546542e4027d43)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 23086: Unit test
Nick Clemens [Wed, 15 Jul 2020 15:33:18 +0000]
Bug 23086: Unit test

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1a6e51934df7f21f9b64f52606edb84180b5be2d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25940: Check for reserve_id before Dopop
Lucas Gass [Mon, 6 Jul 2020 20:38:42 +0000]
Bug 25940: Check for reserve_id before Dopop

TEST PLAN:
1. Have an item belonging to a different branch and check it in.
2. When the modal pops up hit 'Yes, print slip' or 'Print slip' if  AutomaticItemReturn is set to 'don't'
3. The first print dialog should appear with a URL like '/cgi-bin/koha/circ/transfer-slip.pl?transferitem=18&&branchcode=CPL&op=slip'
4. Close that print dialog and you will immediately see another one that says 'No slip template found'.
5. Notice the URL of the second pop-up is:  /cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=
6. There is no reserve id so the template is not found.
7. Apply patch
8. Repeat 1-6
9. You should no longer have two print dialogs

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
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>
(cherry picked from commit 0ec7ba72861f21c2ce83d3a98446af7db7a3e321)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 25f91e5f431f8a8f06ac3710d776c7ed57d3bd20)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25724: Do not call ModReserveStatus when completing transfer
Nick Clemens [Fri, 12 Jun 2020 10:51:36 +0000]
Bug 25724: Do not call ModReserveStatus when completing transfer

I can not see how this code is useful here. It checks for a reserve with priority 0 and found = NULL
That is not a status that should occur when filling a transfer. Either the found is 'T' if we are transferring due
to the hold, or the hold was placed after the transfer was initiated, and so the priority is not 0

Additional, AddReturn checks for reserves later and asks the staff to confirm waiting status.

ModReserveStatus also calls CartToShelf regardless of what happens here.

To test:
1 - Set  UpdateItemLocationOnCheckin  to:
    _ALL_: CART
2 - SetAutomaticItemReturn = Do
3 - Check an item in at a different branch than it's homebranch to create a transfer
4 - Check the item in at it's homebranch
5 - View the item details page
6 - Item is not in CART location
7 - Apply patch
8 - Repeat
9 - Item is in CART location after completion of transfer

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

Signed-off-by: Jason Robb <jrobb@sekls.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 e025cd76437b212746717ad54b5da22e410bbe8f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 51cd56ddb37dbb3c92105d948b8a83b98ad6bcfb)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25724: Unit tests
Nick Clemens [Fri, 12 Jun 2020 11:11:26 +0000]
Bug 25724: Unit tests

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

Signed-off-by: Jason Robb <jrobb@sekls.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 028e9a07db625845482eff1b550a9bbe86ec6fbc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bc1e7669bd2b1abccba7b1975b66adac0de550d2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25729: Prevent Charges/Fees.t to fail on slow server
Jonathan Druart [Mon, 27 Jul 2020 13:15:44 +0000]
Bug 25729: Prevent Charges/Fees.t to fail on slow server

We must use t::lib::Dates::compare to compare dates

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ddfec0a706c2233ea60bbdb990b5368ceebc982f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 26033: Use pic.infini.fr instead of framapic
Jonathan Druart [Tue, 21 Jul 2020 10:36:17 +0000]
Bug 26033: Use pic.infini.fr instead of framapic

https://framapic.org/ is closing
"""
Framapic will be closing its doors on Tuesday, January 12, 2021. You will find a similar service on this page.
Uploading images is now disabled, but you can still retrieve your images on the My images page.
"""

https://framablog.org/2019/09/26/lets-de-frama-tify-the-internet/
https://framablog.org/2020/03/03/10-bonnes-raisons-de-fermer-certains-services-framasoft-la-5e-est-un-peu-bizarre/
(French)

We can still use another service. However we may think about hosting the
service ourself!

Test plan:
Modify a selenium script to make it fail (for instance modify the path
for a find_element call)
Run it
Confirm that the screenshot has been uploaded correctly and that the
link works

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e51c7a73c00b28d2e5091b021ced867fc5942b3b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25984: Compile CSS
Aleisha Amohia [Thu, 30 Jul 2020 14:49:20 +0000]
Bug 25984: Compile CSS

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25984: Add minimum height and width to shelf browser covers
Owen Leonard [Mon, 13 Jul 2020 15:18:23 +0000]
Bug 25984: Add minimum height and width to shelf browser covers

This patch adds a class to the shelf browser cover image links and a
style for these links defining a minimum height and width. This allows
the browser's default tab focus outline to be visible.

This patch also adds a check for an enabled cover image service before
displaying the cover image links.

This patch introduces whitespace changes so diff accordingly.

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

- Enable the OPACShelfBrowser system preference.
- Enable at least one cover image service (Amazon, Google, Coce, etc).
- Locate a title in the OPAC which has items attached.
- On the bibliographic detail page, click the "Browse shelf" link in the
  table of holdings to display the shelf browser.
- Use the tab key to move the focus to cover images in the shelf
  browser.
- Confirm that the focus outline moves through each cover link whether
  or not there is a cover image available.
- Diable all cover image services.
- Test the shelf browser again and confirm that it's not necessary to
  tap through an empty row.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 84caea12382e24fcfa6429a7e1a69e4a3043d70d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25244: Add specific aria-label to search results
Martin Renvoize [Mon, 29 Jun 2020 14:55:17 +0000]
Bug 25244: Add specific aria-label to search results

This patch adds an arai-lebel to the select checkboxes on the search
results page of the OPAC.

Test plan
1/ Perform a search that will yield some results
2/ Inspect the 'checkbox' on the left side of the results table
3/ Note that there is no arai-label
4/ Apply patch
5/ Refresh the search results page
6/ Inspect the 'checkbox' on the left side of the results table
7/ Note that the aria-label now appears and contains relavant
information
8/ Signoff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Bug 25244: (follow-up) QA corrections

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ea51c1a865c20e29ab6c10bc017cbe40a1b314a3)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25922: Fix typo 'arial-label' -> 'aria-label'
Julian Maurice [Fri, 3 Jul 2020 13:36:04 +0000]
Bug 25922: Fix typo 'arial-label' -> 'aria-label'

Signed-off-by: Julian Maurice <julian.maurice@biblibre.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 73ff914d5d537947b5fdc4cd602e79f41af5179a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 48ba19be8e3351f665df8f4ccdde22b63ecab416)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25922: Add aria-label to the allowlist for translation
Martin Renvoize [Fri, 3 Jul 2020 13:07:25 +0000]
Bug 25922: Add aria-label to the allowlist for translation

This patch adds aria-label to the allowlist for translations.

To test:
- Apply patches from here and bug 25244
- kshell
- cd misc/translator
- perl translate update de-DE
- Check for the aria-label in the diff
- Verify the strings appear in the po files now
- Translate them
- perl translate install de-DE
- Verify the translated strings appear in the template

Signed-off-by: Julian Maurice <julian.maurice@biblibre.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 280f1bdeb3cbec9f57d71e980490e32af61eecfb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 21be26f25b7f60c0cadfe247b8efc66cf733551b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25237: Fix semantic heading for opac-details
Martin Renvoize [Thu, 11 Jun 2020 11:45:57 +0000]
Bug 25237: Fix semantic heading for opac-details

Prior to this patch the opac-details view contained semantically incorrect h3
headings for the author information.

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 there are semantically incorrect headings
   H1 (Page title) > H2 (Item title) > H5 (Author)
4/ Apply the patch
5/ Reload the page
6/ Inspect the page and note that the semantically incorrect author block has
   been converted to a span with an 'h3' class for styling
7/ Note the page still appears nicely
8/ Signoff

Bonus points: Check with XSLT views enabled and disabled.

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 6b49a70b94d6b5e0e2e1cde3025ade1278814925)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bb805283f6094c0ba0988b574bd7ee8b5492f53f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25155: (follow-up) Increase headings levels by 1
Martin Renvoize [Thu, 11 Jun 2020 09:14:03 +0000]
Bug 25155: (follow-up) Increase headings levels by 1

In the previous patch we reduced the headings levels by 2, but this was
one level too many as we already have an H1 in the navbar and so all
other heading sets should start at level 2 to semantically follow the
title heading.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3a9597ea481a6be3b32011aa0d0e317e4dec77dd)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25155: Fixing semantic headings login modal
Martin Renvoize [Thu, 11 Jun 2020 08:32:45 +0000]
Bug 25155: Fixing semantic headings login modal

The login modal headings were semantically incorrect prior to this
patch.

Test plan:
1) Click the 'Log in to your account' option to expose the modal
2) Use a headings inspector and note we jump from H1 (Page Title) -> H3
   (Modal Title)
3) Apply the patch and reload the page.
4) Click the 'Log in to your account' option to expose the modal
5) The modal should still appear well formed
6) Use a headings inspector and note we jump from H1 (Page Title) -> H2
   (Modal Title) -> H3 (Shibboleth title if enabled)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 482fc13558437013479b31e7a553fd0919ee97c5)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25155: Fixing semantic headings in opac-auth.tt
Hayley Mapley [Thu, 11 Jun 2020 01:13:30 +0000]
Bug 25155: Fixing semantic headings in opac-auth.tt

Test plan:
1) Follow test plan from comment #1
2) Apply the patch
3) Reload the page, and note that is still displays fine
4) Check that the main heading is now an h1, and that the other headings
on the page make sense

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7e224455099b0fd33a0c65e8d0647efa2d45419a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25293: Don't call escapeHtml on null
Didier Gautheron [Tue, 28 Apr 2020 05:43:46 +0000]
Bug 25293: Don't call escapeHtml on null

 Test Plan:

    1) Create two Checkouts
    2) view patron's checkout list
       cgi-bin/koha/members/moremember.pl?borrowernumber=pp <show
       checkout>
    3) in mysql shell delete a checkout home branch: update items set
       homebranch = null where itemnumber = xx;
    4) view patron's checkout list, again

    Without this patch the list is empty.

    Same if biblio title is null (update biblio set title = null where
    biblionumber = yy;).
    Javascript error:
    TypeError: oObj.title is null

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 2b56ae1d4a231a83f52420ec9efc4829226fa86a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6cbd0a6257dabab98959d2c5a090fca84213eefa)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 24473: Add $raw filter for Syndetics content
Lucas Gass [Tue, 21 Jan 2020 17:53:09 +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>
(cherry picked from commit def7b5d1706fe145c61b18d17fe5251ab92e6dd7)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25862: Prevent TinyMCE to mangle local url links
Didier Gautheron [Wed, 24 Jun 2020 14:03:16 +0000]
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>
(cherry picked from commit ace1e3e53e6332cba767594f6caa0be97ce2e198)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25868: Fix transfers page to show effective itemtype
Fridolin Somers [Wed, 24 Jun 2020 15:05:30 +0000]
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>
(cherry picked from commit 797af6754455b9c029679e8d3c345c8a09ee9b30)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25869: Fix Coce display for lists
Nick Clemens [Wed, 24 Jun 2020 16:17:19 +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>
(cherry picked from commit ca2e551a4ab5aaf5a9e9fb0b87af4519d8fb5d61)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25950: Remove <client> in X-Forwarded-For from proxy tests
David Cook [Wed, 8 Jul 2020 07:10:50 +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>
(cherry picked from commit 8c27b372a4968d5b0d99e512a781302f09a769bf)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.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]
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>
(cherry picked from commit cb76501776b3d03cf7c513b50c6b38630740416e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25944: Schema fix for illrequests route
Martin Renvoize [Tue, 7 Jul 2020 08:27:48 +0000]
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>
(cherry picked from commit 0cd877fb743154a76642952f454df1502302338a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.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]
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>
(cherry picked from commit d59536e289692537289460a9225cc0c0bce80a57)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years ago[19.11.x] Bug 25850: Tests fail when useDaysMode is not set to Calendar
Aleisha Amohia [Thu, 30 Jul 2020 12:39:34 +0000]
[19.11.x] Bug 25850: Tests fail when useDaysMode is not set to Calendar

t/db_dependent/Calendar.t tests fail

This patch is needed as long as useDaysMode is checked in
Koha::Calendar->_init

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25850: Add tests for weekday holidays
Martin Renvoize [Fri, 26 Jun 2020 15:24:00 +0000]
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>
(cherry picked from commit e6522ea63c6258b162c23731d2d3ff3950808152)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25850: (QA follow-up) use dt_from_string
Nick Clemens [Tue, 7 Jul 2020 12:05:42 +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>
(cherry picked from commit f63c82a30f2e9455ce07085f3030d5160658c9f7)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25850: (QA follow-up) Match logic in is_holiday
Martin Renvoize [Mon, 29 Jun 2020 08:54:58 +0000]
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>
(cherry picked from commit 4c0d7b14bebcedb802488ee1fb200a2c7513ca91)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.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]
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>
(cherry picked from commit 238b2af84fe8efe8a740758a774f3587717ffb2b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25850: Regression Test
Martin Renvoize [Fri, 26 Jun 2020 15:52:50 +0000]
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>
(cherry picked from commit f5f3269e25169e295fa495dc6b38114edcb767a6)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25443: (follow-up) surround strings with <span>
Bernardo Gonzalez Kriegel [Sun, 24 May 2020 11:51:27 +0000]
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>
(cherry picked from commit 5680e79f0da5795ab0f99a7b145a6b2115fd39e4)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.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]
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>
(cherry picked from commit f7b93ef9c54bd1ce662ff7147f958a6fa73369a2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25890: Update sorting column for checkouts table
Nick Clemens [Mon, 29 Jun 2020 11:04:59 +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>
(cherry picked from commit 33cb7a9d0b78fc69b97b687a39170473d662aeee)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.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]
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>
(cherry picked from commit d49844d0e1b3ad54c3a7706232437c1a22871fd8)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoUpdate release notes for 19.11.08 release v19.11.08
Aleisha Amohia [Wed, 22 Jul 2020 02:55:28 +0000]
Update release notes for 19.11.08 release

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoIncrement version for 19.11.08 release
Aleisha Amohia [Wed, 22 Jul 2020 00:53:18 +0000]
Increment version for 19.11.08 release

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoFixing po files for 19.11.08
Aleisha Amohia [Wed, 22 Jul 2020 00:50:54 +0000]
Fixing po files for 19.11.08

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoTranslation updates for Koha 19.11.08
Koha translators [Wed, 22 Jul 2020 00:41:57 +0000]
Translation updates for Koha 19.11.08

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25864: Lower case fields for searching
Nick Clemens [Wed, 24 Jun 2020 12:20:03 +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>
(cherry picked from commit ecdefe969e76c0819e8386f8af539f79528a44b3)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25864: Unit test adjustment
Nick Clemens [Wed, 24 Jun 2020 12:22:48 +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>
(cherry picked from commit b2504f1a2fb9b9d44f743ad981794d3365c89951)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25434: Display selections-toolbar on small screens
Jonathan Druart [Tue, 26 May 2020 10:28:13 +0000]
Bug 25434: Display selections-toolbar on small screens

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 014dfd82b6043437a08589e18f2917aaebdfc592)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.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]
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>
(cherry picked from commit 25d820f3226c6116d064591abc67e2463a571f50)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25875: Unit test
Nick Clemens [Thu, 25 Jun 2020 10:38:16 +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>
(cherry picked from commit 7467f10ceb52696f263746d5495532e2b63b8f5b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.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]
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>
(cherry picked from commit 59e1e78c6d59ee6ced202382e2910676a4e32360)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.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]
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>
(cherry picked from commit 13ac8457d5ef1da87ecbc729ffb93b9f19fd84e1)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 25491: Fix for "Use of uninitialized value" in InstallAuth.pm
Slava Shishkin [Wed, 13 May 2020 17:20:27 +0000]
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>
(cherry picked from commit 3a3237da9c2f107a9d4e4a9e9383316ce10e6ecc)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years ago[19.11.x] Bug 25858: Use bitwise OR for setting a bit in borrowers.flag
Aleisha Amohia [Thu, 16 Jul 2020 04:24:38 +0000]
[19.11.x] Bug 25858: Use bitwise OR for setting a bit in borrowers.flag

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years ago[19.11.x] Bug 25858: Don't attempt to set flag if already set
Aleisha Amohia [Thu, 16 Jul 2020 04:23:07 +0000]
[19.11.x] Bug 25858: Don't attempt to set flag if already set

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 24986: DBIC
Aleisha Amohia [Thu, 16 Jul 2020 04:17:14 +0000]
Bug 24986: DBIC

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 24986: DBRev 19.11.07.001
Aleisha Amohia [Thu, 16 Jul 2020 04:14:40 +0000]
Bug 24986: DBRev 19.11.07.001

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

3 years agoBug 24986: Modify some borrowers DB fields to (TINY|MEDIUM)TEXT
Jonathan Druart [Thu, 4 Jun 2020 10:12:23 +0000]
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>
(cherry picked from commit c234daac2afe239625a59940c4aa8ef37453762b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.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]
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>
(cherry picked from commit 18faf9b7aa7c313fd9fa086c5f9609ef7b0c70f5)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>