koha.git
3 years agoUpdate release notes for 20.11.01 release v20.11.01
Fridolin Somers [Wed, 6 Jan 2021 16:27:31 +0000 (17:27 +0100)]
Update release notes for 20.11.01 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoIncrement version for 20.11.01 release
Fridolin Somers [Wed, 6 Jan 2021 16:07:57 +0000 (17:07 +0100)]
Increment version for 20.11.01 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoTranslation updates for Koha 20.11.01
Koha translators [Wed, 6 Jan 2021 08:47:26 +0000 (05:47 -0300)]
Translation updates for Koha 20.11.01

3 years agoBug 27004: Prevent claim resolution to fail
Jonathan Druart [Mon, 21 Dec 2020 10:05:26 +0000 (11:05 +0100)]
Bug 27004: Prevent claim resolution to fail

If the account of the patron who created a claim is removed, then the
claim won't be resolvable.
Trying to resolve the claim will result in a 500:
[2020/12/21 10:05:55] [ERROR] PUT /api/v1/return_claims/1/resolve: unhandled exception (Koha::Exceptions::Checkouts::ReturnClaims::NoCreatedBy)<<[created_by is mandatory]>> Koha::REST::Plugin::Exceptions::__ANON

We should not check if created_by exist when we update an existing hold,
only when we create it.

Test plan:
- Login with patron A
- set a value to syspref ClaimReturnedLostValue
- Check an item out
- Claim returned it
- Login with patron B
- Delete patron A
- Resolve the claim
- ERROR in api-error.log an UI never confirming the resolution
- apply patch & restart services
- Resolve the claim
- it works

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 92dbe809021ea1f7ee44e51387b48d9ffbda1fea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27004: Regression tests
Tomas Cohen Arazi [Tue, 29 Dec 2020 17:35:27 +0000 (14:35 -0300)]
Bug 27004: Regression tests

This patch introduces regression tests for the change in
Koha::Checkouts::ReturnClaim->store.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Checkouts/ReturnClaim.t
=> FAIL: Tests fail

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c4702149b2a9d3ec6216a7526a2c52b91de5d4cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27276: Fix syntax error
Kyle M Hall [Mon, 4 Jan 2021 13:12:25 +0000 (08:12 -0500)]
Bug 27276: Fix syntax error

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4f112b782b706d906fb39dd0d7a708f7d12da45f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27276: Prevent borrowers-force-messaging-defaults.pl to crash
Jonathan Druart [Fri, 18 Dec 2020 13:28:13 +0000 (14:28 +0100)]
Bug 27276: Prevent borrowers-force-messaging-defaults.pl to crash

MySQL 5.7 does not allow queries using 0000-00-00

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f228c9ee9fc7094054b687b26ae4306254922019)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 17809: FR installer: fix duplicate authorised value qualif 370
Victor Grousset/tuxayo [Mon, 28 Dec 2020 14:48:25 +0000 (15:48 +0100)]
Bug 17809: FR installer: fix duplicate authorised value qualif 370

Monteur vs Réalisateur

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ca50623a6082c0aec51d817bd8fddfdb022c8d1b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 17809: Fix ER country appearing twice in fr-FR database files
Fridolin Somers [Thu, 22 Dec 2016 15:03:57 +0000 (16:03 +0100)]
Bug 17809: Fix ER country appearing twice in fr-FR database files

In installer/data/mysql/fr-FR/1-Obligatoire/authorised_values.sql, ER is defined twice, for "Erythrée" (correct one) and "Allemagne".

Test plan :
- Create a new database using fr-FR or import the sql file
- Look at authorised values COUNTRY
=> without patch you have ER / Allemange
=> with patch you have ER / ErythrÃe

NOTE: Allemange occurs twice as well, correctly with DE.
      This patch correctly removes the ER one.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 016c51f3a444e50029a7053c28c6f0821d204605)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 17809: Correct authorised values for fr-FR
Mark Tompsett [Tue, 3 Jan 2017 18:02:40 +0000 (13:02 -0500)]
Bug 17809: Correct authorised values for fr-FR

This corrects:
CC -- duplicate, but name not full.
GQ -- duplicate, but only one name correct.
PK -- Poland was mislabelled.

This removes and edits duplicates and corrects PK to PL.

Signed-off-by: Luke Honiss <luke.honiss@gmail.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9b2dbfab9412d8c4e163c3f83241fa621b3a8123)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27331: (bug 27331 follow-up) Fix syntax error in authorised_values.sql for fr-FR
Jonathan Druart [Mon, 4 Jan 2021 13:41:56 +0000 (14:41 +0100)]
Bug 27331: (bug 27331 follow-up) Fix syntax error in authorised_values.sql for fr-FR

ERROR 1064 (42000) at line 724: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '+
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD' at line 1

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 80029ad4725b64bb6197ced5bd867721769b04a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27317: (Bug 27127 follow-up) fix t/db_dependent/Koha/BackgroundJobs.t
Fridolin Somers [Wed, 30 Dec 2020 14:06:56 +0000 (15:06 +0100)]
Bug 27317: (Bug 27127 follow-up) fix t/db_dependent/Koha/BackgroundJobs.t

Bug 27127 changed  Koha::BackgroundJob->messages to return arrayref instead of array.
This impacts Unit Test t/db_dependent/Koha/BackgroundJobs.t failling on :
  not ok 10 - 10 messages generated

Test plan :
prove t/db_dependent/Koha/BackgroundJobs.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: I fixed the indentation of the test label.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 5f2414686dbba56ee8140cad55051d7b900cb47d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27055: Fix compatibility with newer Firefox+Selenium version
Victor Grousset/tuxayo [Thu, 19 Nov 2020 12:47:45 +0000 (13:47 +0100)]
Bug 27055: Fix compatibility with newer Firefox+Selenium version

Fix "submit is not a function error"
A submit button should not be named "submit", in this case, it's id.
https://stackoverflow.com/questions/833032/submit-is-not-a-function-error-in-javascript

Fix some uses of get_attribute()

Fix a fail by setting a global implicit_wait_timeout, default value is 0
in our lib. Other libs set it higher which helps to not have to manually
deal with part of the timing issues.

Fix: remove usage of click_when_visible() because it doesn't work with
elements not in the top of the page. Because they are off screen.

Fix: use $driver->quit() in error_handler to not forget an open Firefox.
With the current version, it fills /dev/shm and fails with around 5
Firefox opened.
Also use quit() it at the end of every script.

Fix: filling item fields, to fill only the displayed one (not those
with display:none)

== Test plan ==
1. Update selenium/standalone-firefox to the latest version [1]
2. prove t/db_dependent/selenium/authentication.t
3. It fails with: arguments[0].form.submit is not a function
4. Apply patch
5. Retest
6. Success

[1] In koha-testing-docker you can do it with
docker-compose.yml:
     selenium:
-        image: selenium/standalone-firefox:2.53.1-americium
+        image: selenium/standalone-firefox

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c3406257e78a9407320d22820807f767b4c4df3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27250: Fix stacked event listeners in SMTP delete modal
Tomas Cohen Arazi [Thu, 17 Dec 2020 14:53:16 +0000 (11:53 -0300)]
Bug 27250: Fix stacked event listeners in SMTP delete modal

There is a design issue on the click event listener that makes the modal
get added new event listeners on each row being deleted. This makes the
page call all the event listeners and generates an error.

This patch replaces the flawed logic (adding the event listener inside
the event listener). It makes the event listener be defined at startup
time, and make the .on('click') action just pass information around as
required.

To test:
1. Create at least 2 SMTP servers
2. Open the browser inspector, on the network tab
3. Click "Delete" for server 1
=> SUCCESS: You get a successful message (OK)
4. Click "Delete" for server 2
=> SUCCESS: You get a successful message (OK)
=> FAIL: You get also an alert message about server 1 (KO)
=> FAIL: The inspector shows more than one AJAX call has been made
5. Apply this patch and reload the page
6. Repeat 3-4
=> SUCCESS: Everything goes smooth this time
7. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 084d64b84a536c1d88f2fa477865134f97388489)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27099: Stage for import button not showing up
Owen Leonard [Mon, 14 Dec 2020 12:30:03 +0000 (12:30 +0000)]
Bug 27099: Stage for import button not showing up

In the latest version of Chrome, pages where the Humansmg library is
included have a problem where the language footer obscures the bottom of
the page.

The problem traces back to some CSS in the Humanmsg library's CSS file:

html, body {
    height: 100%; /* Damn you IE! */
}

Removing the line doesn't have any ill effects that I can see in Chrome
or Firefox, and it fixes the problem in Chrome. IE can be damned.

To test you must have one or more translations enabled in the staff
interface.

- Apply the patch and clear your browser cache if necessary.
- View pages in the staff interface which use the Humansmg library,
  e.g.:
  - Administration -> System preferences. Choose a category of
    preferences which will be numerous enough to require scrolling to
    reach the bottom of the page.
  - Tools -> Stage MARC records for import. Upload a file to display the
    form for staging the import.
  - Cataloging -> Advanced MARC editor

On each page the language footer should not obscure the bottom of the
page.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2498cdcc88be798b88d6a23bf6e592cff5a80f45)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27247: Re-add highlighting to the quote editor
Jonathan Druart [Wed, 16 Dec 2020 10:32:20 +0000 (11:32 +0100)]
Bug 27247: Re-add highlighting to the quote editor

Caused by
  commmit 247dca306407ac9568344a0a37aca3bbcffc2468
  Bug 23013: Upgrade DataTables in the staff client

which removed

-tr.even.selected td {
-    background-color: #D3D3D3;
-}

There was no more highlighting when trying to delete an imported quote, as there was before
(see screenshot from the manual https://gitlab.com/koha-community/koha-manual/-/blob/master/source/images/tools/qotd/selectfordelete.png)

It was, however, possible to delete imported quotes, you just don't see which ones you are deleting.

Test plan:
1) Create a CSV with two columns first the name, then the quote (I've attached a CSV that I've done for testing purposes)
2) Go to Tools > Edit quotes for the QOTD feature
3) Click 'Import quotes'
4) Click 'Browse' and choose the CSV created earlier
5) Click on the id of a couple of quotes. Notice those lintes are highlighted

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit eddf09da53b0ad21e2b2649266ca201623372d0c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27230: Display OPAC description for OPAC_SUG
Jonathan Druart [Mon, 14 Dec 2020 13:51:17 +0000 (14:51 +0100)]
Bug 27230: Display OPAC description for OPAC_SUG

The authorised values OPAC_SUG displayed at the OPAC show the staff
description.

Test plan:
1. Create an auth value in opac_sug, with different text for the description and OPAC description.
2. Go to the OPAC and open the purchase suggestion form.
3. Note in the Reason for purchase drop down, the descriptions appear, the text entered in the OPAC description field.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7063f2c4763d7fec870a4c326837b8b64e64004f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26956: Allow guarantor's controls to be set when a guarantee is created
Jonathan Druart [Wed, 2 Dec 2020 09:34:50 +0000 (10:34 +0100)]
Bug 26956: Allow guarantor's controls to be set when a guarantee is created

With AllowStaffToSetCheckoutsVisibilityForGuarantor and
AllowStaffToSetFinesVisibilityForGuarantor set to Allow, one can only see the
controls for these values in the patron record *after* the patron has been saved
with a guarantor. That makes a frustrating 2-step process. We should be able to
set those values regardless of whether or not there is currently a guarantor on
the account.

Test plan:
Create a guarantee and confirm that the 2 options "Show checkouts to
guarantors" and "Show fines to guarantors" are displayed
Select Yes, save
Confirm that the values have been correctly saved

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6a461382ba944a8e9f4a7c4e534dca74745f0f55)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 22243: Fix unescaped apostrophe in Z target
Andrew Isherwood [Thu, 31 Jan 2019 09:40:08 +0000 (09:40 +0000)]
Bug 22243: Fix unescaped apostrophe in Z target

This patch escapes apostrophes in the z39.50 target name prior to them
being embedded in the template.

To test:

- Create a z39.50 target containing an apostrophe in the title
- Note that the Advanced Cataloguer editor does not load
- Apply the patch
- TEST: Note that the Advanced Cataloguer editor does load

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>
(cherry picked from commit 7ffa71fbd1fa0e4b8c036f02b8a73eacbdfac066)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27200: Compiled CSS
Jonathan Druart [Sat, 26 Dec 2020 17:13:57 +0000 (18:13 +0100)]
Bug 27200: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 28423fa756439607fbbe72d70806e964098345a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27200: (follow-up) Browse search interface update
Owen Leonard [Wed, 16 Dec 2020 18:38:11 +0000 (18:38 +0000)]
Bug 27200: (follow-up) Browse search interface update

This patch updates the browse search interface to confirm to new
interface patterns in the Bootstrap 4 framework, especially in the form
markup.

The results list has been changed to a Bootstrap "Collapse" component
configured as an accordion
(https://getbootstrap.com/docs/4.5/components/collapse/#accordion-example).

Instead of loading the bibliographic record results below the list of
terms returned, the bibliographic results are now displayed in the
"panel" expanded below the selected term. Subtitle has been added to the
information displayed about the bibliographic record.

To test you must be using ElasticSearch and the OpacBrowseSearch
preference must be enabled. Apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Open the "Browse search" page in the OPAC.
- Test various searches: Author, Subject, and Title.
- When results are found, the should be displayed as a Bootstrap-styled
  accordion widget. Clicking any individual result should expand the
  panel containing the corresponding records.
- Clicking the record link should open the bibliographic detail page in
  a new window.
- When no results are found, a Bootstrap-style "alert" box should
  appear.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e12e0ef016247003a7a97916aa760277b56782cf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27200: (bug 20168 follow-up) Fix 'Browse search'
Jonathan Druart [Fri, 11 Dec 2020 10:19:55 +0000 (11:19 +0100)]
Bug 27200: (bug 20168 follow-up) Fix 'Browse search'

The 'hidden' class has been replaced by 'd-none' on bug 20168

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fc2c86ba78420a083cfad726b15ed52f9cd19d53)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27196: Don't explode if item that is waiting if checked in by SIP
Jonathan Druart [Mon, 14 Dec 2020 14:54:54 +0000 (15:54 +0100)]
Bug 27196: Don't explode if item that is waiting if checked in by SIP

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6b9b7d8e779b29ec5bb9ec2a2e84c91eb1c5b19e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 24398: (QA follow-up) Add POD
Nick Clemens [Mon, 21 Dec 2020 13:43:21 +0000 (13:43 +0000)]
Bug 24398: (QA follow-up) Add POD

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dd36b9bb5b05e66f01ecd32d028247894820523c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 24398: Fix 500 when viewing a single news item at the OPAC
Jonathan Druart [Thu, 10 Dec 2020 14:10:10 +0000 (15:10 +0100)]
Bug 24398: Fix 500 when viewing a single news item at the OPAC

Test plan:
0. Set the NewsAuthorDisplay preference to 'OPAC' or 'Both OPAC and staff client.'
1. Open the OPAC main page and click on an individual news item
Without this patch you get an ugly 500
    Template process failed: undef error - The method Koha::NewsItem->author_title is not covered by tests!
With this patch applied you see the news with the author's info

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c596f450d96e04befe6d5335d8ad12679541d220)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27256: Update click handler for point of sale
Martin Renvoize [Wed, 16 Dec 2020 19:26:11 +0000 (19:26 +0000)]
Bug 27256: Update click handler for point of sale

This patch updates the click handler to bind to the table element in the
DOM as aposed to the individual buttons by their classes. We then use
the event propogation and filter on the button class to catch the clicks
we want.

Test plan
1/ Add 22 debit_types that can be sold to the system (or reduce the
datatable paging size)
2/ Confirm that items on the second page of results cannot be added for
sale on the point of sale page.
3/ Apply the patch
4/ Confirm items from the second table page can now be added correctly
5/ Clicking add when navigating to such an item should leave the items
table unmodified.
6/ Clicking aa when the table was filtered should reset the filters
bringing the table back to the first page
7/ Signoff

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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>
(cherry picked from commit 68047132a4888db6eb5169e1cd3ceac49aa84b3b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27148: (QA follow-up) Calculate default_strong_password correctly
Nick Clemens [Mon, 21 Dec 2020 16:06:35 +0000 (16:06 +0000)]
Bug 27148: (QA follow-up) Calculate default_strong_password correctly

Fix a typo lenght for length

If category strong password is not set, then we fall back to the preference, but that can be "" - which should be treated as 0

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3b56076405bd0d171b702a63564339d80fa99359)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27148: (follow-up) Fix require_strong variable set
Agustin Moyano [Wed, 9 Dec 2020 18:17:15 +0000 (15:17 -0300)]
Bug 27148: (follow-up) Fix require_strong variable set

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 03839d40b1fd58a3863a1153a6ae44d1002d9afb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27148: Fix bug on self registration when user category is hidden
Agustin Moyano [Thu, 3 Dec 2020 16:10:18 +0000 (13:10 -0300)]
Bug 27148: Fix bug on self registration when user category is hidden

This patch fixes the bug when there is no patron category available for
selection in self registration form. It uses PatronSelfRegistrationDefaultCategory
to get patron's password length and strength.

To test:
1. Do not apply this patch
2. Allow SeflRegistration, set PatronSelfRegistrationDefaultCategory to
   a valid patron category and finally add categorycode to PatronSelfRegistrationBorrowerUnwantedField
3. Go to opac and enter self registration form
CHECK => There is no patron category available for selection
      => Password's info alert shows "Password must contain at least
undefined characters"
4. Fill the form setting a password and send.
CHECH => You get an exception saying "You must provide a patron's
category to validate password's strength and length"
5. Apply this patch and restart_all
6. repeat steps 3 and 4
SUCCESS => Password's info alert message shows a number instead of
"undefined"
        => Password's strength and length checks are working
        => If you change default category's lenght or strength parameter it get's reflected when you refresh the page
        => When you click send, patron is saved

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 f5373b7a5ea125f5b3123ab038a727d13315390f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 14564: Set permissions on configuration backups
Mirko Tietgen [Sun, 19 Jul 2015 15:16:12 +0000 (17:16 +0200)]
Bug 14564: Set permissions on configuration backups

This patch sets the group and group read permissions on
configuration backups, so that they can be downloaded
via the web staff interface.

Test plan:
0. Apply the patch
1. cp debian/scripts/koha-dump /usr/sbin/koha-dump
2. koha-run-backups --days 2 --output /var/spool/koha
3. Note *.tar.gz backups in /var/spool/koha/kohadev
now have root:kohadev-koha ownership and 640 permissions
4. vi /etc/koha/sites/kohadev/koha-conf.xml
5. Set backup_db_via_tools and backup_conf_via_tools to 1
6. echo 'flush_all' | nc -q 1 memcached 1121
7. koha-plack --restart kohadev
8. Go to http://localhost:8081/cgi-bin/koha/tools/export.pl
9. Click on "Export configuration"
10. Choose a file
11. Click Download configuration
12. Note that *.tar.gz file downloaded correctly

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6982680ae9e71d5d038e894842125860fcc986d6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26941: Fix OPAC password recovery error messages
Fridolin Somers [Thu, 5 Nov 2020 14:52:47 +0000 (15:52 +0100)]
Bug 26941: Fix OPAC password recovery error messages

In OPAC password recovery perl opac/opac-password-recovery.pl
there are some error codes not in Template koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt

This patch fixes several bugs:
- remove 'use Koha::Patrons' defined twice
- remove vars $errTooManyEmailFound $errBadEmail, not used in any template
- add in template text for error 'errNoBorrowerEmail'

1) Create a patron A with login but no email
2) Create a patron B with login and valid email
3) Go to system preferences set 'OpacResetPassword' to ON
4) Make sure that OpacPasswordChange is also ON
5) Go to 'Forgot your password' in OPAC
6) Enter login if patron A and save
=> You get message 'This account has no email address we can send the email to.'
7) Enter login if patron B and save
=> Password recovery is send, no error message

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 24519: Match paycollect form validation for change collection
Martin Renvoize [Mon, 2 Mar 2020 16:45:58 +0000 (16:45 +0000)]
Bug 24519: Match paycollect form validation for change collection

This patch adds form validation to the Point Of Sale payment page such
that one cannot submit the form with a 'collected' value that is less
than the 'owed' amount.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 080288bce48cf4fa94b19d35a117dd3e1967a4c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26849: Fix Array::Utils dependency in cpanfile
Julian Maurice [Wed, 28 Oct 2020 15:46:32 +0000 (16:46 +0100)]
Bug 26849: Fix Array::Utils dependency in cpanfile

Since bug 26434, if the module is missing Koha does not start. So it
should be marked as required

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a43fcaf1416057905c277951fb2b0bff13977d33)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27127: Make Koha::BackgroundJob->messages return a scalar
Jonathan Druart [Tue, 1 Dec 2020 14:35:11 +0000 (15:35 +0100)]
Bug 27127: Make Koha::BackgroundJob->messages return a scalar

Otherwise the code in the template is not handled correctly:
112                     [% FOR m IN job.messages %]

m will become each key/val of the message hash:
{"type":"success","biblionumber":"1","code":"biblio_modified"}
And not the whole hash

Test plan:
Modify one biblio using the batch record modification tool
Modify two biblios using the batch record modification tool
Go to the detail view of each job and confirm that with this patch the
display is correct

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c5efece0dc8db3a1438bab40afbcaa7f164f2f75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27117: Only place_holds permission is needed to adjust pickup locations
Jonathan Druart [Tue, 1 Dec 2020 10:44:04 +0000 (11:44 +0100)]
Bug 27117: Only place_holds permission is needed to adjust pickup locations

The GET /pickup_locations route is requesting the whole reserveforothers
permission whereas only the subpermission place_holds is needed.

Test plan:
0. Don't apply this patch
1. Set the subpermission place_holds but modify_holds_priority
2. Edit a hold and click the pickup library dropdown list
3. You get a JS alert and log displays
  GET /api/v1/app.pl/api/v1/holds/5/pickup_locations
  403 Forbidden
4. Apply this patch
5. Reload the page, click the dropdown list, modify the pickup location
and save
=> Success!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 69c01ee0f2dccd04cfbe8201ba580a15727f5280)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26921: Don't generate an invalid custom cover image if the url cannot be generated
Jonathan Druart [Thu, 5 Nov 2020 15:02:14 +0000 (16:02 +0100)]
Bug 26921: Don't generate an invalid custom cover image if the url cannot be generated

In case a custom cover image url is used to generate the cover image of
bibliographic records, we should not build one if the record does not
have the necessary data.

For instance if you have
CustomCoverImagesURL set to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb
and a biblio does not have the isbn defined, we should not generate and
empty image (empty or invalid src)

Test plan:
0.
Set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb
Enable CustomCoverImages and OPACCustomCoverImages
To highlight the issue you should disable LocalCoverImages and OPACLocalCoverImages.
1. Make sure you have some of your bibliographic records with a valid
isbn
2. Make sure you have at least 1 bibliographic record without an isbn
set
3. Visit the search result and detail views (OPAC and staff interfaces)
=> Without this patch you should see a "Cover image" link, and an empty
block/div on the detail page
=> With this patch applied you should only see images when the url can
be generated

Note that the problem will persist if the isbn is not valid (ie. no
image is generated)

Sponsored-by: Orex Digital
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1ea55acd0c997b96039a2a1a4a9f9941d2558bda)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27205: Improve logic readability in conditional
Jonathan Druart [Fri, 18 Dec 2020 10:56:22 +0000 (11:56 +0100)]
Bug 27205: Improve logic readability in conditional

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 85c25260853aa1c8003b0a041dba2772cd2f316b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27205: Check valid pickup location on POST /holds
Tomas Cohen Arazi [Mon, 14 Dec 2020 13:19:05 +0000 (10:19 -0300)]
Bug 27205: Check valid pickup location on POST /holds

This patch adds a check for valid pickup location to the POST /holds
route. A 400 code is returned if the supplied pickup library is not
valid.

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

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c913bd7d698a8fbc9992f93db426a35c79f330c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27205: Check valid pickup location on PUT /holds/:hold_id
Tomas Cohen Arazi [Fri, 11 Dec 2020 20:55:40 +0000 (17:55 -0300)]
Bug 27205: Check valid pickup location on PUT /holds/:hold_id

This patch adds a test for valid pickup locations when updating a hold
through the API.

Tests are adjusted to reflect this change.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1bfe7ea16ef1346585211345ba89d18e303a0c32)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27209: (follow-up) Add ->is_pickup_location_valid
Tomas Cohen Arazi [Mon, 14 Dec 2020 10:37:53 +0000 (07:37 -0300)]
Bug 27209: (follow-up) Add ->is_pickup_location_valid

This patch simply refactors the pickup location check into a method that
can be called on its own. Tests are added, and the tests for
->set_pickup_location should pass unmodified.

To test:
1. Apply the first two patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Hold.t
=> SUCCESS: tests pass
3. Apply this refactoring patch
4. Notice the tests are similar, but check for boolean output
5. Repeat 2
=> SUCCESS: New tests pass, set_pickup_location() behavior unchanged.
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 865a1dab5c346920c61237c4b7593202328e04f8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27209: Add Koha::Hold->set_pickup_location
Tomas Cohen Arazi [Fri, 11 Dec 2020 19:51:42 +0000 (16:51 -0300)]
Bug 27209: Add Koha::Hold->set_pickup_location

This patch introduces a method to safely update a hold's pickup
location. It will raise exceptionis if the passed parameters are invalid
or absent.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Hold.t
=> SUCCESS; Tests pass
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 672413ea294679d4b5b30d30839650f6d30b45ca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27209: Unit tests
Tomas Cohen Arazi [Fri, 11 Dec 2020 19:51:34 +0000 (16:51 -0300)]
Bug 27209: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 295787223e4dbbe116cba20119db05da4992e0b1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27124: JS error "select2Width is not defined"
Owen Leonard [Thu, 10 Dec 2020 11:48:43 +0000 (11:48 +0000)]
Bug 27124: JS error "select2Width is not defined"

This patch changes the default width paramter passed to the
select2 plugin. This allows the basic MARC editor's Select2
widgets to be styled differently than on other pages.

To test, apply the patch and view various pages where the select2 plugin
is used:

 - Basic MARC editor
 - Items edit
 - Batch item edit
 - Authority editor

In each case check that the Select2 plugin works correctly to style
fields like collection code and home library.

On the basic MARC editor page these <select>s should have a width
that adjusts as the browser window changes. On other pages the width
should be fixed.

Check the browser console and confirm that there are no JavaScript
errors.

Update: Thanks to Julian for the suggested optimization

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ff7318c62ec7097c5b88f7278b71d0cc7feb1f39)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26634: Remove GetHoldRule subroutine in C4::Reserves
Nick Clemens [Tue, 24 Nov 2020 20:21:07 +0000 (20:21 +0000)]
Bug 26634: Remove GetHoldRule subroutine in C4::Reserves

This routine is only used internally and incorrectly overrides
the precedence of holds rules - it should be removed

This patch removes the routine, adjusts tests, and adds test to
confirm correct precedence is followed

To test:
1 - At the All Libraries level, create a circ rule for a specific patron category and a specific item type that only allows 1 hold
2 - At the branch-specific level for Branch A, create an All/All rule that allows 2 holds
3 - confirm ReservesControll is set to patron's library
4 - find a patron from Branch A of the category for which you made your rule
5 - find two bibs with items of the itype got which you made your rule
6 - place a hold on one bib. success!
7 - try to place a hold on the second bib. you're told you cannot because the patron is only allowed 1 hold
8 - apply patch, restart services
9 - try to place your second hold again, success!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit de4d6983ab614f56d0514ff4060543da69b2b651)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27133: (bug 19351 follow-up) Add missing "Copy no" header to relative's checkouts
Jonathan Druart [Wed, 2 Dec 2020 10:31:07 +0000 (11:31 +0100)]
Bug 27133: (bug 19351 follow-up) Add missing "Copy no" header to relative's checkouts

Test plan:
Add a guarantee, go to the relative's checkouts list and confirm that
the number of headers is not correct

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ec1979a385cb35228d39d139d7c0bd8c685dd4a2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27166: Set destination_loc to item->homebranch
Nick Clemens [Tue, 8 Dec 2020 14:18:35 +0000 (14:18 +0000)]
Bug 27166: Set destination_loc to item->homebranch

In bug 21020 we used the issue to fetch the item and then the homebranch.
This fails when the item is not issued. We fetch the item already, so we
can use it directly

To test:
1 - Have an item belonging to branch A
2 - Check it in via sip at branch B:
    perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 --item CHESS1 -l FPL -m checkin
3 - The read command is blank and there is a warn about uninitialized data
4 - Apply patch
5 - Restart sip server
6 - Check the item in at branch A using the sip cli emulator
7 - Check it in at branch B
8 - This time the checkin should succeed and the output msg should be included

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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 9ec0744ccce7a5027373154fc0a5098e8c5260c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27166: Unit tests
Nick Clemens [Tue, 8 Dec 2020 14:18:11 +0000 (14:18 +0000)]
Bug 27166: Unit tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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 3126ae34433abe1ca1559e8123e6e1e732c1ed6c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25583: Improve wording
Jonathan Druart [Wed, 9 Dec 2020 10:50:24 +0000 (11:50 +0100)]
Bug 25583: Improve wording

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cae0ef76f398bb3d9f60235ff10611cc8d8eacb7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 25583: Disable the "claim returned" button if the feature is disabled
Jonathan Druart [Fri, 20 Nov 2020 08:18:26 +0000 (09:18 +0100)]
Bug 25583: Disable the "claim returned" button if the feature is disabled

It's possible to display the "Return claims" column on the checkout
list, even if the feature is disabled.
We should disable the link and add an explanation.

Test plan:
- Make sure ClaimReturnedLostValue is empty
- Go to a patron account
- Check out an item
- Make the claims returned column visible in the table of checkouts
=> The button is disabled and a tooltip explains that the feature is
disabled

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3ae3981d3c881bbbd136015ae94e91961236d15e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26905: Purchase suggestion button hidden for users with suggestion permission...
Owen Leonard [Wed, 2 Dec 2020 14:21:27 +0000 (14:21 +0000)]
Bug 26905: Purchase suggestion button hidden for users with suggestion permission but not acq permission

This patch adds a link to purchase suggestions from the header menu's
"More" submenu for users with suggestions management permission.

To test, apply the patch and log in to the staff interface as a user
with "suggestions_manage" permission.

- Click the "More" menu item in the header. You should see a link to
  "Suggestions" which takes you to the suggestions management page.

- Log in as a user without "suggestions_manage" permission. The link
  should not appear.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 30acf1a9884b98b5e7e965fc057aa632cd781f8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26946: Set maxlength for cash register name
Martin Renvoize [Mon, 9 Nov 2020 12:57:13 +0000 (12:57 +0000)]
Bug 26946: Set maxlength for cash register name

The cash register names is limited to 24 characters at the database
level and so that restriction should also be reflected in the UI.

Test plan
1/ Add or Edit a cash register ( admin > accounts > cash registers )
2/ Note that you can enter a cash register name longer than 24
characters, but upon save the value is truncated.
3/ Apply patch
4/ Note you can not longer enter a cash register name longer than 24
characters.
5/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 012229c5ea77a009dc708db4370bf499e48dad01)

3 years agoBug 27142: Don't interpolate batch_type variable
Nick Clemens [Thu, 3 Dec 2020 13:30:34 +0000 (13:30 +0000)]
Bug 27142: Don't interpolate batch_type variable

To test:
1 - Create a report like:
    SELECT * FROM borrowers LIMIT 50
2 - Run the report
3 - Attempt batch modification - it fails showing every row as an unfound cardnumber
4 - Apply patch
5 - Repeat
6 - Success!
7 - Edit report to:
    SELECT * FROM biblio LIMIT 50
8 - Repeat test
9 - Ensure batch modification and deletion work

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 9b62806a979fea789661b3d85113b57dbff0e62d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 24658: (bug 22008 follow-up) Correct update DB entry 18.12.00.031
Jonathan Druart [Tue, 17 Nov 2020 14:15:02 +0000 (15:15 +0100)]
Bug 24658: (bug 22008 follow-up) Correct update DB entry 18.12.00.031

If the original constraint does not exist, the second one is not added.

Test plan:
1. checkout dbrev 18.12.00.030
2. Remove the constraint: ALTER TABLE accountlines DROP FOREIGN KEY accountlines_ibfk_2
3. checkout master
4.
% updatedatabase
=> The constraint accountlines_ibfk_items is not added
5. Repeat 1 to 4
=> The constraint is added correctly

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

3 years agoBug 12430: Fix Search.t failure
Jonathan Druart [Wed, 9 Dec 2020 09:52:15 +0000 (10:52 +0100)]
Bug 12430: Fix Search.t failure

t/db_dependent/Search.t ..
    #   Failed test 'buildQuery should keep 0 value'
    #   at t/db_dependent/Search.t line 669.
    #          got: 'su,phr=(rk=(0)) '
    #     expected: 'su,phr=0(rk=(0)) '

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a37ba7903d6e7c18b2e2f8d9e145936b0dc8b938)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 12430: Fix selenium/regressions.t failure
Jonathan Druart [Fri, 4 Dec 2020 16:05:30 +0000 (17:05 +0100)]
Bug 12430: Fix selenium/regressions.t failure

Test failed with
    # Looks like you planned 4 tests but ran 3.
t/db_dependent/selenium/regressions.t .. 2/5
 #   Failed test 'OPAC - Remove from cart'
 #   at t/db_dependent/selenium/regressions.t line 109.
Error while executing command: clickElement: An unknown server-side error occurred while processing the command.: Element is not clickable at point (583.7000122070312, 14). Other element would receive the click: <a class="page-link" href="/cgi-bin/koha/opac-search.pl?idx=kw&amp;q=d&amp;offset=420&amp;sort_by=relevance_dsc&amp;count=20" aria-label="Go to the last page"></a>

https://pic.infini.fr//Qhq7pLBq/jT9wZ7F1
The remove from basket link for the biblio 3 is hidden by the floating
toolbar.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 48e74cebedea733e0a6528cd275c1b2925ff46bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 12430: Add unit tests for C4::Search::buildQuery
David Cook [Tue, 18 Feb 2020 03:02:55 +0000 (03:02 +0000)]
Bug 12430: Add unit tests for C4::Search::buildQuery

This patch adds unit tests for buildQuery, especially focusing on
the use of the (rk=()) wrapper.

Note that the Net::Z3950::ZOOM library is used to test the queries
for CCL validity on top of the string matching used in the
got/expected comparisons.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD amended patch: fix spelling connexion ==> connection

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 66b2bb7ca898007533f775a2bdc413c9d00c6ca7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 12430: Use releance ranking without QueryWeightFields
David Cook [Tue, 17 Jun 2014 06:59:32 +0000 (16:59 +1000)]
Bug 12430: Use releance ranking without QueryWeightFields

The system preference "QueryWeightFields" is mutually exclusive with
the system preference "QueryAutoTruncate" and the * truncation
modifier, when not using QueryParser.

If you use truncation, relevance won't work anymore. (N.B. Relevance
doesn't work probably when using QueryParser, but for a very different
reason beyond the current scope of this bug.)

This patch adds relevance ranking when using truncation (or basically
when QueryWeightFields is disabled).

_TEST PLAN_

1) Turn on "QueryWeightFields" and set "QueryAutoTruncate" to auto
2) Turn off "UseQueryParser"
3) Do a keyword search in the OPAC
4) Note that the results are ordered by biblionumber ascending

5) Apply patch

6) Do the same keyword search in the OPAC
7) Note that the results are never ordered differently
(presumably in relevance order :P)

If you're a stickler, throw in some warns so that you can see
what CCL query is being sent to Zebra.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
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 f6b5dfa4b718fb74654448b5663cb264b5c376b7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27030: Add missing perldoc for Processing hold status to C4::Reserves
Josef Moravec [Mon, 16 Nov 2020 09:43:03 +0000 (09:43 +0000)]
Bug 27030: Add missing perldoc for Processing hold status to C4::Reserves

Test plan:

Look into diff and confirm the comment does make sense

Signed-off-by: David Nind <david@davidnind.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 2c4cd7f3f260d44801e36a7582c8dc384afb93e7)

3 years agoBug 16067: Remove FastMmap
Jonathan Druart [Mon, 17 Dec 2018 15:45:54 +0000 (12:45 -0300)]
Bug 16067: Remove FastMmap

It is known to be broken, we should remove its implementation

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 fc1158389f5a25ee9d62c2cb84742daa5b97ec50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26336: Add hint before and remove select after staging with no items
Nick Clemens [Tue, 1 Sep 2020 16:36:43 +0000 (16:36 +0000)]
Bug 26336: Add hint before and remove select after staging with no items

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5cdae4c64b7da609ddeb94d77ffa5bdbb4cb8ca1)

3 years agoBug 26336: Disable 'Item processing' dropdown if no item
Jonathan Druart [Tue, 1 Sep 2020 13:47:27 +0000 (15:47 +0200)]
Bug 26336: Disable 'Item processing' dropdown if no item

If there is no item to process and they have been ignored during the
stage step, we should not let the user modify the dropdown value

Test plan:
0 - Check the count of import_items
    SELECT COUNT(*) FROM import_items;
1 - Import a marc file with items , process the items
2 - Check the count of import items, it has increased
3 - Stage the file again, do not process items
4 - Count of import_items has not increased
5 - Manage the stage batch
Confirm that you cannot modify the "Item processing" value

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cee2e630b4e26ebfaef6cf3f41a79df3cf697b01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26976: Display 0 if renewalsallowed is not defined
Jonathan Druart [Fri, 20 Nov 2020 10:27:45 +0000 (11:27 +0100)]
Bug 26976: Display 0 if renewalsallowed is not defined

If the circulation rule "renewalsallowed" is not set (or an empty
string) then the checkout list displays
(0 of  renewals remaining)
It should display "0 of 0"

Test plan:
Set renewalsallowed to an empty string
Check an item out
Notice the change

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 01a7dc70670801fab021ba7e4f782542c744bbee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27128: (bug 25728 follow-up) Don't prefill av's code
Fridolin Somers [Tue, 1 Dec 2020 15:22:15 +0000 (16:22 +0100)]
Bug 27128: (bug 25728 follow-up) Don't prefill av's code

Bug 25728 patch "Don't prefill av's code" does not work.
Calling empty val() retruns the attribut.
Should be val('').

Test plan :
1) Without patch
2) Edit a record
3) Edit a subfield with AV
4) Enter a new value to create it
5) You see the modal popup, edit and save
6) Enter another new value to create it
7) You see the modal popup => value is prefilled
8) Re-do test plan with patch (+ clear JS cache) => value is empty

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 c6263d078e9374b1712d7b2a452a1ccb614deaef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26665: (bug 20168 follow-up) Fix path to bootstrap js file
Jonathan Druart [Wed, 2 Dec 2020 13:34:18 +0000 (14:34 +0100)]
Bug 26665: (bug 20168 follow-up) Fix path to bootstrap js file

20168 moved it to /opac-tmpl/bootstrap/lib/bootstrap/js/bootstrap.bundle.min.js

It fixed the OAI-PMH view

Test plan:
Hit <OPACBaseURL>/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marc21
and confirm that you can click "Metadata" and it opens

Signed-off-by: David Nind <david@davidnind.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 61f1f02dd791ee587d545d71e3c08fc5eb35c770)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27003: Item creation log must be done after the item is created
Jonathan Druart [Wed, 2 Dec 2020 08:56:04 +0000 (09:56 +0100)]
Bug 27003: Item creation log must be done after the item is created

Otherwise we don't have its itemnumber yet!

Test plan:
Add and modify an item and confirm that the action logs are created
correctly

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 b3b3781ea3745a382cd38e808a2846a6fd933f3c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27144: Fix syntax error that prevents deleting patrons
Joonas Kylmälä [Thu, 3 Dec 2020 13:23:22 +0000 (15:23 +0200)]
Bug 27144: Fix syntax error that prevents deleting patrons

To test:
 1) In staff interface open up a patron record
 2) Click More -> Delete, and then "Yes, delete"
 3) Notice 500 error
 4) Apply patch
 5) Notice error is now gone when deleting

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 08c34b33e4f9bf8f4f515ca769ed923999d3991f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 23475: Unset the storage if the values do not exist
Nick Clemens [Fri, 20 Nov 2020 19:53:51 +0000 (19:53 +0000)]
Bug 23475: Unset the storage if the values do not exist

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 44be943feda8ffc0425219f11af8bdaa6d358036)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 23475: Use localStorage to preserve simple search values
Nick Clemens [Mon, 19 Aug 2019 19:38:52 +0000 (19:38 +0000)]
Bug 23475: Use localStorage to preserve simple search values

To test:
1 - Enable IntranetCatalogSearchPulldown
2 - Perform a search that brings you to a single title
3 - Note the search is not displayed on the details page
4 - Apply patch
5 - Repeat
6 - Note the search is retained on details page
7 - Try with different dropdown values and search terms
8 - Test search terms including accented characters etc

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Bug 23475: (follow-up) Fix selectors and stray use statements

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 45400055e443b991953e81248424cec0a8663b9a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoCorrect Ubuntu versions in release notes - md
Jonathan Druart [Mon, 30 Nov 2020 10:19:16 +0000 (11:19 +0100)]
Correct Ubuntu versions in release notes - md

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit be9f64b638335cac7465ca302e187c7914534fbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoCorrect Ubuntu versions in release notes
Jonathan Druart [Mon, 30 Nov 2020 10:14:27 +0000 (11:14 +0100)]
Correct Ubuntu versions in release notes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1e5d4ab20568d96f8dd2c49282d24bad9a36c4d3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agov20.11.00 v20.11.00
Jonathan Druart [Fri, 27 Nov 2020 16:36:04 +0000 (17:36 +0100)]
v20.11.00

Previous commit was pushed without the tag (git push remote master),
and now git rejects a git push v20.11.00
So, adding another commit with the tag!

3 years agoKoha 20.11.00 is here!
Jonathan Druart [Fri, 27 Nov 2020 12:19:16 +0000 (13:19 +0100)]
Koha 20.11.00 is here!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoAdd release notes for Koha 20.11.00
Jonathan Druart [Fri, 27 Nov 2020 15:41:21 +0000 (16:41 +0100)]
Add release notes for Koha 20.11.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27108: Add 21.05 release team to teams.yaml
Martin Renvoize [Fri, 27 Nov 2020 14:08:24 +0000 (14:08 +0000)]
Bug 27108: Add 21.05 release team to teams.yaml

This patch update the docs/teams.yaml file to add the elected 21.05
release team and update the include to reflect the minor change of
structure.

Test plan.
1/ Apply the patch
2/ Update Koha.pm to state 20.11.00.000
3/ Update preferences to Version to 20.1100000
4/ Navigate to the about page
5/ Note that the 20.11 team is shown on the left and the new 21.05 team
is shown on the right.
6/ Pay particular attention to the 'Packaging manager' on the left and
'Packaging team' on the right. (We have not had a team of packaging
people before, so the template had to be updated to allow for an array
of packaging people).
7/ Signoff.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27108: (QA follow-up) Fix Agustin and Documentation manager

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoAdjust history and contributors list
Jonathan Druart [Fri, 27 Nov 2020 13:21:54 +0000 (14:21 +0100)]
Adjust history and contributors list

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoFix translation issues
Jonathan Druart [Fri, 27 Nov 2020 11:53:17 +0000 (12:53 +0100)]
Fix translation issues

sudo apt-get install translate-toolkit
junitmsgfmt misc/translator/po/*.po

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoTranslation updates for Koha 20.11.00
Koha translators [Fri, 27 Nov 2020 15:09:13 +0000 (12:09 -0300)]
Translation updates for Koha 20.11.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoFix some updatedatabase.pl issues
Jonathan Druart [Fri, 27 Nov 2020 12:15:28 +0000 (13:15 +0100)]
Fix some updatedatabase.pl issues

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Add 'experimental' info to koha-core and koha-full descriptions
Mason James [Fri, 27 Nov 2020 12:16:10 +0000 (01:16 +1300)]
Bug 26672: Add 'experimental' info to koha-core and koha-full descriptions

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27103: Remove from fr-FR
Jonathan Druart [Fri, 27 Nov 2020 11:59:51 +0000 (12:59 +0100)]
Bug 27103: Remove from fr-FR

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27103: Remove HOLD_CANCELLATION notice
Martin Renvoize [Fri, 27 Nov 2020 09:24:46 +0000 (09:24 +0000)]
Bug 27103: Remove HOLD_CANCELLATION notice

We are really close to release, and the 'proper' fix to make the sending
of hold cancellation notices optional will introduce string changes.

This patch takes the alternative approach of removing the default notice
template there by disabling the feature for 20.11.00 release and giving
us time to properly impliment a solution and re-instate the default
notice template for the 20.11.01 release.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27079: Floating point comparison correction
Martin Renvoize [Wed, 25 Nov 2020 12:58:56 +0000 (12:58 +0000)]
Bug 27079: Floating point comparison correction

We cannot compare calculated values directly as those calculations may
have introduced floating point differences.  We have the
Koha::Number::Price->round function to consistently round the floating
point number to a decimal with 2 points precission for comparison.

Test plan
1/ Set a circ rule to have a .15 per day fine and enable finesMode
syspref.
2/ Issue an item of this type to a borrower (making it 12 days overdue
   by setting the due date to 12 days in the past)
3/ Run the fines job:
4/ Pay the fine for the patron
5/ Check in the item
6/ Note that the patron does not have an 'Overpayment refund' of $0.00

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 27079: (QA follow-up) Round both sides for clarity

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27079: Unit tests
Martin Renvoize [Wed, 25 Nov 2020 14:10:34 +0000 (14:10 +0000)]
Bug 27079: Unit tests

Add a unit test to check for floating point errors in UpdateFine
relating to catching matching CalcFine amounts compared to DB amount
values.

Test plan
1/ Run the unit test and confirm it fails
2/ Apply the second patch in the series
3/ Run the unit test and confirm it passes

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25534: Add missing td in tfoot in pendingreserves
Jonathan Druart [Fri, 27 Nov 2020 08:25:56 +0000 (09:25 +0100)]
Bug 25534: Add missing td in tfoot in pendingreserves

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Add deps to koha-core, via debian/rules file
Mason James [Thu, 26 Nov 2020 09:18:46 +0000 (22:18 +1300)]
Bug 26672: Add deps to koha-core, via debian/rules file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Remove unrequired default-mysql-* references
Mason James [Wed, 25 Nov 2020 15:29:44 +0000 (04:29 +1300)]
Bug 26672: Remove unrequired default-mysql-* references

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27092: Remove note about "synced repo" from README.md
Jonathan Druart [Wed, 25 Nov 2020 15:31:58 +0000 (16:31 +0100)]
Bug 27092: Remove note about "synced repo" from README.md

Now it's displayed on our git.k-c.org by gitea.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Add koha-core and koha-full definitions to debian/control files
Mason James [Thu, 15 Oct 2020 01:21:13 +0000 (01:21 +0000)]
Bug 26672: Add koha-core and koha-full definitions to debian/control files

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Add additional koha-core and koha-full files to ./debian
Mason James [Wed, 25 Nov 2020 12:04:27 +0000 (01:04 +1300)]
Bug 26672: Add additional koha-core and koha-full files to ./debian

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: (QA follow-up) Expect warnings, don't supress them
Nick Clemens [Mon, 23 Nov 2020 12:09:47 +0000 (12:09 +0000)]
Bug 26518: (QA follow-up) Expect warnings, don't supress them

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: Move BiblioAutoLink within the transaction
Jonathan Druart [Mon, 12 Oct 2020 13:01:22 +0000 (15:01 +0200)]
Bug 26518: Move BiblioAutoLink within the transaction

We don't want the authorities to be created if the biblio insert fails
later

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: Hide expected DBI warnings
Jonathan Druart [Fri, 9 Oct 2020 10:09:08 +0000 (12:09 +0200)]
Bug 26518: Hide expected DBI warnings

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: Raise exception if the insert failed
Jonathan Druart [Tue, 29 Sep 2020 11:29:49 +0000 (13:29 +0200)]
Bug 26518: Raise exception if the insert failed

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: Use Koha::Biblio[item] in AddBiblio
Jonathan Druart [Tue, 29 Sep 2020 11:29:33 +0000 (13:29 +0200)]
Bug 26518: Use Koha::Biblio[item] in AddBiblio

Bug 26518: Does not return from the catch block

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27026: (bug 24159 follow-up) Add a tooltip to explain the values of "Days mode"
Jonathan Druart [Tue, 17 Nov 2020 15:22:59 +0000 (16:22 +0100)]
Bug 27026: (bug 24159 follow-up) Add a tooltip to explain the values of "Days mode"

There was a tooltip for values of the existing rules, but not the only
you were editing.

Now there is the same tooltip (title) on the option elements of the
dropdown list.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 27026: Use meaningful descriptions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25942: Fix batch report operations for cardnumbers and biblionumbers
Nick Clemens [Wed, 18 Nov 2020 13:29:33 +0000 (13:29 +0000)]
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers

This patch moves the processing for these to a block and adds a comment
in place of whitespace and uses template directives to chomp newlines to improve readability

To test:
 1 - Create a report like:
    SELECT biblionumber FROM biblio
 2 - Run it
 3 - Try the various options from the 'Batch operations' button
    (You will need to define a marc modification template)
 4 - The operations don't find the biblios
 5 - Create a report like:
    SELECT cardnumber FROM borrowers
 6 - Run it
 7 - Test the batch operations
 8 - They fail
 9 - Apply patch
10 - Run each report again and test batch operations
11 - They work!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 25942: (follow-up) fix filters

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27070: Add cross_fields type to our searches
Nick Clemens [Fri, 20 Nov 2020 19:11:10 +0000 (19:11 +0000)]
Bug 27070: Add cross_fields type to our searches

This patch adds the 'cross_fields' type to our searches:
https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-query-string-query.html#query-string-syntax

Without this patch the search terms seem to all require being in the same field when using Elasticsearch 6

To test:
0 - Set QueryAutoTruncate to 'only if * is added'
1 - Find a record with a title and publisher
2 - Search for a word form the title and confirm the record is returned
3 - Search for a work from the title and the publisher's name
4 - The record is not returned
5 - Apply patch
6 - Repeat #3
7 - The record is returned

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27082: uncertainprice.pl does not handle pagination
Blou [Tue, 24 Nov 2020 22:03:32 +0000 (17:03 -0500)]
Bug 27082: uncertainprice.pl does not handle pagination

To reproduce:
1- create a basket
2- add more of 20 orders with uncertain price
3- click on uncertain price button
4- on page 1 of list, uncheck uncertain box of an order
5- click on save button
6- orders who were on page 2 are not display anymore in page uncertainprice.pl
7- return to basket view acqui/basket.pl
8- orders who were on page 2 have "rvcd" label and quantity is null

The data in page 2 and beyond is not transmitted, but the code doesn't
handle that.  This patch makes sure that all that (empty) data is not (wrongly) processed.

Sponsored by: CCSR

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26819: (QA follow-up) Fix branchtransfers.tt
Kyle M Hall [Mon, 23 Nov 2020 14:43:58 +0000 (09:43 -0500)]
Bug 26819: (QA follow-up) Fix branchtransfers.tt

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26819: (QA follow-up) authorized_value should be authorised_value
Kyle M Hall [Mon, 23 Nov 2020 14:42:06 +0000 (09:42 -0500)]
Bug 26819: (QA follow-up) authorized_value should be authorised_value

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>