koha.git
2 years agoBug 30742: Prevent placing holds on items/records where all items notforloan Bug...
Nick Clemens [Thu, 9 Jun 2022 15:27:56 +0000 (15:27 +0000)]
Bug 30742: Prevent placing holds on items/records where all items notforloan Bug 30742: Remove 'bad_bibs' and send a list of holdable bibs Bug 30892: (bug 30742 follow-up) Send single bib as a holdable bib

Rebeased/rewritten patch - includes fix from 30892

This patch does a few things:
1 - Adds itemtype not for loan status to display
2 - Adds a conditional to display notforlaon status as the reason a hold cannot be placed
3 - Seperates the lower 'Place hold(s)' buttons for single and multi holds into two template sections
4 - Handles the case where all bibs in a multi hold have no items available
5 - Disables the button for single hlds when all items are unavailable

To test:
 1 - Find or create a record with all items of itemtype marked 'notforloan'
 2 - Attempt to place single hold on this record from staff client
 3 - See one disab;ed button, one enabled 'Place holds' button
 4 - Click 'Place holds' - hold placed
 5 - Cancel hold
 6 - Place multiple holds with some bibs that can be held, and this one that cannot
 7 - Notice message that 'Cannot place hold on some items'
 8 - Click 'Place holds' - hold is generated for the notforloan bib
 9 - Apply patch
10 - Place single hold
11 - Note you now see not for loan status on items
12 - Note the red x also includes message abnout not for loan status
13 - Note the 'Place hold' button is disabled
14 - Attempt multi hold
15 - Message now includes "No items available: One or more records have no items that can be held"
16 - Click 'Place holds'
17 - Above still places the hold - this is for a followup patch

Currently place request gets a list of bad_bibs that is created via javascript on the
template. It ignores this list

Ths patch instead doesn't add info for bad bibs, and provides a list of the bibs that
can be held

To test:
1 - Attempt multi hold with some items that can be held, and one that cannot due to notforloan
2 - Fill in pickup locations and place hold
3 - Note hold is place on bib with no avilable items and hsows twice in results
4 - Apply patch
5 - repeat with another patron
6 - Note no aidditonal hold on record with notforloan items
7 - Note with with not for loan items appears only once in results

Bug 30892
To test:
1. Try placing hold
2. Everything seems to work but no hold gets placed.
3. Apply patch
4. Verify holds are no placed correctly.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 29860: Remove item type-related warnings
Tomas Cohen Arazi [Wed, 12 Jan 2022 14:15:10 +0000 (11:15 -0300)]
Bug 29860: Remove item type-related warnings

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/selenium/regressions.t
=> FAIL: You see several
item-level_itypes set but no itemtype set for item (985) at /kohadevbox/koha/Koha/Schema/Result/Item.pm line 905.
2. Apply this patch
3. Repeat 1
=> SUCCESS: No more item type warnings
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 169c535e880bf1233622042cab76351b7dbc65ca)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 57a58a79b4f82afba57020370fa0ebb38a7f44ce)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 30721: Markup error in detail page's component parts tab
Owen Leonard [Mon, 9 May 2022 15:22:16 +0000 (15:22 +0000)]
Bug 30721: Markup error in detail page's component parts tab

This patch adds a missing </div> to the bibliographic detail
page template in the section for showing component parts.
Some comments are added to clarify the markup structure.

To test you should have a record in your catalog with component
parts. Bug 11175 provides one you can import if necessary:
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78023

To see the error, go to the staff interface, locate the record
in question and view the detail page. Under the Components tag,
scroll to the bottom. You will see content from "later" tabs at
the bottom, e.g. "There is no order for this bibliographic record"
or "No images have been uploaded for this bibliograhpic record yet."

Apply the patch and reload the page. The tabs should still look
correct, and now the tab content should be correctly isolated.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 656e864e6b3234a5d493bd2b44bc3b831bd458f1)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 30862: Typo: langues
Caroline Cyr La Rose [Fri, 27 May 2022 21:52:06 +0000 (17:52 -0400)]
Bug 30862: Typo: langues

This patch changes the word 'langues' to 'languages' in the description
of the following system preferences:

- OPACXSLTDetailsDisplay

- OPACXSLTListsDisplay

- OPACXSLTResultsDisplay

- XSLTDetailsDisplay

- XSLTListsDisplay

- XSLTResultsDisplay

To test:
1- Apply patch
2- Check the aforementioned system preferences and make sure the descriptions say 'languages'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 58de13cb9a5efa3fd9c9fd50865eea62ee18ec5b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 706c478a406422d8dff26d13bf97dbbc12526a1a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 30528: Process limits before handling CCL query
Nick Clemens [Thu, 14 Apr 2022 12:20:09 +0000 (12:20 +0000)]
Bug 30528: Process limits before handling CCL query

This patch moves the code that handles limit processing before that for CCL queries to ensure that special limit cases (branch, multibranch, etc) are handled before adding the limits to the query string

To test:
1 - Apply unit tests patch only
2 - prove -v t/db_dependent/Search.t
3 - It fails
4 - Apply this patch
5 - It passes!
6 - Test searching and confirm things work as epxected

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2da14cf8c10c2d5165220e6657b279b37aa02f81)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eb07e2c47560caabd9f3b4b1469db6fbaa394867)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 30528: Unit tests
Nick Clemens [Thu, 14 Apr 2022 12:19:22 +0000 (12:19 +0000)]
Bug 30528: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fde3aefba821c43554adaa53324c81cbe7d2d95a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f9290c5465214bea72c7aa3f0a98d85260ab525f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 30870: Don't skip tests if Test::Deep if not installed
Jonathan Druart [Tue, 31 May 2022 09:29:57 +0000 (11:29 +0200)]
Bug 30870: Don't skip tests if Test::Deep if not installed

We are using Test::Deep in different tests, but from t/db_dependent/Koha.t the tests are skippted if the module is not installed.
We must assume the module is installed

Test plan:
  prove t/db_dependent/Koha.t
should return green in ktd

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 42290cb43deb7dde668d9a55467c44ba705e665c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a97d5c93ab61a790f1d25b770682c9832fb8e9de)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 29883: Add test
Jonathan Druart [Tue, 31 May 2022 09:26:36 +0000 (11:26 +0200)]
Bug 29883: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 740258568368b7741df1a95d7bf330c527bf9054)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 26272432a106d8d1b560548aa70dc91aaaa31ced)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 29883: avoid uninitialized value warn in GetAuthorisedValues sub
Petro Vashchuk [Fri, 14 Jan 2022 09:57:39 +0000 (11:57 +0200)]
Bug 29883: avoid uninitialized value warn in GetAuthorisedValues sub

GetAuthorisedValues is defined with optional parameter $category but it
is instantly interpolated without preventing "Use of uninitialized value
$category in concatenation (.) or string at .../C4/Koha.pm line 491."
warning.
As category param is optional, we can avoid throwing that warn as it is
something that can happen and is not an actual error:
C<$category> returns authorized values for just one category (optional).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 44e126bcc7fae369e13c533eea79f00ef41f2ff1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 36cbd69763dc8e8162781ee22bc7d5e234443b9d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 30831: Unit test
Nick Clemens [Mon, 23 May 2022 12:18:11 +0000 (12:18 +0000)]
Bug 30831: Unit test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: minor typo fix
(cherry picked from commit f08951f044e2cdac7a9bdf4cdfb6897b9de9e1f2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f9bdca4adff37dabf01322b0e287675af9c1a21c)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 30830: Add Koha Objects for Koha Import Items
Nick Clemens [Mon, 23 May 2022 12:25:53 +0000 (12:25 +0000)]
Bug 30830: Add Koha Objects for Koha Import Items

To test:
prove -v t/db_dependent/Koha/Import/Record/Items.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6cd0249725f211f0df77ba367c379f0e5c5e1d4e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a0790249cb5b6ad5c9dfbeee03bc1d8276947bf2)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 28152: Log the "duplicate item barcode" error
Jonathan Druart [Mon, 10 Jan 2022 10:22:54 +0000 (11:22 +0100)]
Bug 28152: Log the "duplicate item barcode" error

Looking at the code this 'import_error' column is empty for the last 9 years. Not sure it makes much sense to have this single error now.

commit 1dba9c6409d78cb1f90de6c1300cb5b63fb1b851
Date:   Wed Oct 10 14:21:22 2012 -0500
    Bug 7131: teach MARC import how to overlay items

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c0c375d8e073c9eb765179fa7b3c3d0136b5174)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2d19940f7e6a3b50e3dedee909a419cf1923a2e4)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 28152: Fix import_items row creation if duplicate barcode
Jonathan Druart [Thu, 15 Apr 2021 10:12:23 +0000 (12:12 +0200)]
Bug 28152: Fix import_items row creation if duplicate barcode

We are trying to insert "duplicate item barcode" into import_items.itemnumber (integer),
it fails with "Incorrect integer value: 'duplicate item barcode' for column 'itemnumber' at row 1"

To reproduce:
Export a biblio with an item
Import it
=> The item is not added, and there is no new row in import_items.

The error only appears in the log if you comment the close STDERR and
close STDOUT lines

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7a8a456c7dcc0bc2a015968f7a2c0e9ac2370f0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e5d97a001d3b70d1a2e436fd490c2820f448784f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 29828: Prevent additional content to be created without default
Jonathan Druart [Mon, 10 Jan 2022 09:15:35 +0000 (10:15 +0100)]
Bug 29828: Prevent additional content to be created without default

When creating or editing an additional content, the form is submitted if
only the title of the 'default' tab is filled in.
We should submit the form only if both title and content exist.

Test plan:
Create a new content using text editor (codemirror)
Confirm that the form is submitted only if title and content from the
default tab are not empty
Try again with wysiwyg (tinymce)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 05934b89b1b43ceb88928b48a4e1fd69708ac61b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit be11af15e61653f2f853a22870468bc8987fbdd4)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2 years agoBug 30204: Add subtitle to serial search results
Lucas Gass [Tue, 1 Mar 2022 16:11:40 +0000 (16:11 +0000)]
Bug 30204: Add subtitle to serial search results

To test:
1. Make some new serial subscriptions and connect them to biblios that contain subtitles.
2. Do a serial search that will return your newly created subscription.
3. Notice the subtitle doesn't appear.
4. Apply patch and restart_all
5. Again try step 2.
6. Notice the subtitle appears alongside the title now.
7. Make sure it still sorts that column correctly.

Signed-off-by: shiyao <shiyao@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30204: Add unit test
Kyle M Hall [Tue, 5 Apr 2022 16:54:37 +0000 (12:54 -0400)]
Bug 30204: Add unit test

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29617: exclude categorycode from BorrowerUnwantedField
Lucas Gass [Thu, 2 Dec 2021 01:36:26 +0000 (01:36 +0000)]
Bug 29617: exclude categorycode from BorrowerUnwantedField

To test:
1. Go to BorrowerUnwantedField and select categorycode as unwanted
2. Try adding a new patron, you will see an error message in the staff client "Something went wrong when creating the patron. Check the logs." You will be unable to make a new patron.
3. Apply patch
4. Go to BorrowerUnwantedField, you are unable to exlcude it. Patrons need categorycodes

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoUpdate release notes for 21.11.06 release v21.11.06
Kyle Hall [Wed, 25 May 2022 16:04:09 +0000 (12:04 -0400)]
Update release notes for 21.11.06 release

2 years agoIncrement version for 21.11.06 release
Kyle Hall [Wed, 25 May 2022 15:21:00 +0000 (11:21 -0400)]
Increment version for 21.11.06 release

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
2 years agoFix translations for Koha 21.11.06
Kyle Hall [Wed, 25 May 2022 15:15:35 +0000 (11:15 -0400)]
Fix translations for Koha 21.11.06

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
2 years agoTranslation updates for Koha 21.11.06
Koha translators [Wed, 25 May 2022 14:02:04 +0000 (11:02 -0300)]
Translation updates for Koha 21.11.06

2 years agoBug 30663: Implement overrides handling in POST /suggestions
Tomas Cohen Arazi [Tue, 3 May 2022 14:23:23 +0000 (11:23 -0300)]
Bug 30663: Implement overrides handling in POST /suggestions

This patch implements the override checks in the controller as expected
by the previous patch.

To test:
1. Apply this bug patches up to 'Add x-koha-override options...'
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/suggestions.t
=> FAIL: Tests fail! The controller doesn't care about overrides or
         sysprefs about suggestions limits.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Things work!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30663: Add x-koha-override options to /suggestions
Tomas Cohen Arazi [Tue, 3 May 2022 14:20:46 +0000 (11:20 -0300)]
Bug 30663: Add x-koha-override options to /suggestions

This patch adds the x-koha-override header parameter to the route that
is used to create suggestions, POST /suggestions.

The idea is that adding suggestions will be rejected under certain
conditions unless x-koha-override is passed with appropriate values. The
added overrides are:

* any
* max_total
* max_pending

Tests are added for the expected behavior.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30354: Don't assign warn as letter
Nick Clemens [Thu, 24 Mar 2022 15:31:05 +0000 (15:31 +0000)]
Bug 30354: Don't assign warn as letter

TO test:
1 - Check out an item marked for autop renewal to a patron and make it overdue
2 - Set system preference AutoRenewalNotices to follow messaging prefs
3 - set that borrower to receive both email and SMS AUTO_RENEWALS_DGST
4 - confirm your AUTO_RENEWALS_DGST does not have SMS content but does have email
5 - run the auto_renew cron
6 - item is renewed, but error from cron, and cron dies:

No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583.
no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/automatic_renewals.pl line 305.
Can't use string ("1") as a HASH ref while "strict refs" in use at /kohadevbox/koha/C4/Letters.pm line 898.

7 - Apply patch
8 - Make item eligible for auto renewal agian (or checkin/checkout)
9 - Run the cron
10 - There is still 2 warn, but cron does not die:

No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583.
no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/    automatic_renewals.pl line 305.

11 - Patron receives email and item is renewed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30572: (QA follow-up) Fix failing unit test
Martin Renvoize [Thu, 5 May 2022 16:12:29 +0000 (17:12 +0100)]
Bug 30572: (QA follow-up) Fix failing unit test

We changed from 'null' being meainingful to using a tinyint and
explicitly requiring '0'.  This patch simply updates the unit test to
reflect that change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30663: Add Koha::Suggestions helper methods
Tomas Cohen Arazi [Tue, 3 May 2022 14:18:10 +0000 (11:18 -0300)]
Bug 30663: Add Koha::Suggestions helper methods

This patch adds the following helper methods:

* filter_by_pending
* filter_by_suggested_days_range

This methods follow basically what's done in opac-suggestions.pl
I chose 'pending' as opposed to 'open' to follow what we use in the UI
which might be the case because of being more accurate for end users.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 10517: (QA follow-up) No need to remove second true
Marcel de Rooy [Fri, 29 Apr 2022 09:18:24 +0000 (09:18 +0000)]
Bug 10517: (QA follow-up) No need to remove second true

This is just theoretical, but by removing the second true you
could end the script on another error.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 10517: Use `DROP USER IF EXISTS` and remove ` || true`.
Rudolf Byker [Wed, 8 Jan 2020 09:20:02 +0000 (11:20 +0200)]
Bug 10517: Use `DROP USER IF EXISTS` and remove ` || true`.

When restoring a Koha instance, and the database user does not exist, an error is shown,
although it is prevented from stopping the script by ` || true`. This patch removes the
` || true` guard, and rather uses `DROP USER IF EXISTS` which does exactly what one
would expect, without confusing error messages, whether the user existed or not.

To test:
1) Assume your Koha instance is called `asdf`.
1) Export the Koha instance using `koha-dump`.
2) Remove the instance completely using `koha-remove`.
3) Import it again using `koha-restore`.
4) No error should be shown, and the import should work. There was NO user to drop, therefore `DROP USER IF EXISTS` did nothing.
5) A database user called `koha_asdf` should exist, and have all privileges on the database of the same name.
6) Remove the instance again using `koha-remove`.
7) Now create a database user in MySQL called `koha_instance` where instance is the name of your dumped koha instance.
8) Import your koha instance again using `koha-restore`.
9) Again, no error should be shown, and the import should work. There WAS a user to drop, therefore `DROP USER IF EXISTS` dropped the user before creating a new one.
10) Again, a database user called `koha_asdf` should exist, and have all privileges on the database of the same name.

Sponsored-by: Reformational Study Centre
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30143: OAI-PMH: Fix SQL query used to fetch deleted records
Ere Maijala [Mon, 21 Feb 2022 14:07:00 +0000 (16:07 +0200)]
Bug 30143: OAI-PMH: Fix SQL query used to fetch deleted records

The query was missing the "ORDER BY" and "LIMIT" clauses, which could make retrieve a wrong set of records.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29537: Remove unnecessary if-else checks for soonest renew date
Nick Clemens [Thu, 24 Mar 2022 11:42:55 +0000 (11:42 +0000)]
Bug 29537: Remove unnecessary if-else checks for soonest renew date

GetSoonestRenewDate() calculates the renewal due date now also
correctly for auto-renewals after the fixes from bug 29476 so we don't
have to add any if-else checks because of it being buggy anymore.

To test:
 1) prove t/db_dependent/Circulation.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30628: Fix patron selection in batch patron modification tool
Jonathan Druart [Thu, 28 Apr 2022 08:32:28 +0000 (10:32 +0200)]
Bug 30628: Fix patron selection in batch patron modification tool

bug 28014 added Datatables to this view, but the form is submitted with
only the checkboxes from the first page.

Solution adapted from https://stackoverflow.com/questions/33240409/how-to-submit-checkboxes-from-all-pages-with-jquery-datatables

Test plan:
Have more than 20 cardnumbers, use the batch patron modification tool
Select (not all) patrons from the first page and second page
Submit the form
Notice that the patrons you have selected appear on the confirmation
page.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30599: Add an 'Archive selected' button
Nick Clemens [Fri, 22 Apr 2022 19:15:43 +0000 (19:15 +0000)]
Bug 30599: Add an 'Archive selected' button

This patch simply adds a new button on the suggestions interface to allow
for archiving multiple suggestions.

To test:
1 - Apply patch
2 - Create some purchase suggestions
3 - Select several suggestions
4 - Click 'Archive selected'
5 - Suggestions are archived
6 - You can view archived suggestions by selecting 'Suggestion information'->'Include archived'

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Felicity Brown <felicity.brown@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30620: Add a warning about /*!VERSION lines in kohastructure
Marcel de Rooy [Tue, 26 Apr 2022 11:45:52 +0000 (11:45 +0000)]
Bug 30620: Add a warning about /*!VERSION lines in kohastructure

Also adding a similar comment in C4::Installer.

No test plan, just documentation.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 22379: Unit tests for CancelHold service
Arthur Suzuki [Mon, 27 Jan 2020 04:41:05 +0000 (05:41 +0100)]
Bug 22379: Unit tests for CancelHold service

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 22379: Fix checks not made by ILS-DI method CancelHold
Arthur Suzuki [Wed, 20 Feb 2019 20:15:44 +0000 (21:15 +0100)]
Bug 22379: Fix checks not made by ILS-DI method CancelHold

Disable the possibility for a borrower to cancel a reservation
which is either in a Transit or Waiting state.
This reproduce the behaviour seen on the OPAC.
Also replaces previous checks on the borrowernumber
since CanReserveBeCanceledFromOpac already checks this.

--------------------------------

Test plan (before patch) :
-Put a reserve for a borrower
-Try to cancel the reserve providing another borrowernumber as argument
-> Should fail and reply "RecordNotFound"
-> Reserve still appears in the list of holds.

-Try to cancel the reserve providing the borrowernumber the reserve is
for.
-> Should succeed, reply with "Canceled"
-> Reserve do not show up in the list of holds for the borrower

-Put a new reserve with a pickup branch != from the homebranch
-Transfer the item to the pickup branch (reserve status = Transit)
-Try to cancel the reserve (with proper borrowernumber)
-> Should succeed, reply with "Canceled"
-> Reserve do not show up in the list of holds for the borrower

-Checkout the reserved item in the pickup branch (reserve status =
Waiting)
-Try to cancel the reserve (with proper borrowernumber)
-> Should succeed, reply with "Canceled"
-> Reserve do not show up in the list of holds for the borrower

--------------------------------

Test plan (after patch) :
-Put a reserve for a borrower
-Try to cancel the reserve providing another borrowernumber as argument
-> Should fail and reply "BorrowerCannotCancelHold"
-> Reserve still appears in the list of holds.

-Try to cancel the reserve providing the borrowernumber the reserve is
for.
-> Should succeed, reply with "Canceled"
-> Reserve do not show up in the list of holds for the borrower

-Put a new reserve with a pickup branch != from the homebranch
-Transfer the item to the pickup branch (reserve status = Transit)
-Try to cancel the reserve (with proper borrowernumber)
-> Should fail and reply "BorrowerCannotCancelHold"
-> Reserve still appears in the list of holds.

-Checkout the reserved item in the pickup branch (reserve status =
Waiting)
-Try to cancel the reserve (with proper borrowernumber)
-> Should fail and reply "BorrowerCannotCancelHold"
-> Reserve still appears in the list of holds.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30597: Update RestrictionBlockRenewing description to include auto renew
Andrew Fuerste-Henry [Fri, 22 Apr 2022 16:12:50 +0000 (16:12 +0000)]
Bug 30597: Update RestrictionBlockRenewing description to include auto renew

To test:
- apply the patch, find the syspref, see the new wording

To confirm the behavior:
- set the syspref to Block
- give a patron an auto-renewing checkout and a restriction
- run automatic_renewal.pl, see item does not renew
- switch syspref to allow, repeat, see renewal

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30366: Remove warn when running automatic_item_modification_by_age.pl
Fridolin Somers [Mon, 25 Apr 2022 20:27:54 +0000 (10:27 -1000)]
Bug 30366: Remove warn when running automatic_item_modification_by_age.pl

When using the ./misc/cronjobs/automatic_item_modification_by_age.pl -v
after setting up rules under Tools > Automatic item modifications by
age the script outputs several lines of warnings:

Use of uninitialized value in string eq at /kohadevbox/koha/C4/Items.pm
line 1864.

This is because even when there is no condition defined, modification
rule is stored with empty hash, like :
[{"substitutions":[{"field":"items.new_status","value":"0"}],"conditions":[{}],"age":"60","agefield":"items.dateaccessioned"}]

Test plan :
1) Go to Tools > Automatic item modifications by age
2) Create a rule with no conditions, just a substitution
3) Run misc/cronjobs/automatic_item_modification_by_age.pl -v
4) Check there is no warning
5) Edit the rule to add a condition
6) Run misc/cronjobs/automatic_item_modification_by_age.pl -v
7) Check the condition is applied

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30572: DBRev 21.11.05.005
Kyle Hall [Fri, 6 May 2022 18:01:05 +0000 (14:01 -0400)]
Bug 30572: DBRev 21.11.05.005

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30572: DBIx schema change for SearchMarcToField
Marcel de Rooy [Thu, 21 Apr 2022 12:41:08 +0000 (12:41 +0000)]
Bug 30572: DBIx schema change for SearchMarcToField

No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30572: Dbrev for search_marc_to_field.sort
Marcel de Rooy [Thu, 21 Apr 2022 12:42:53 +0000 (12:42 +0000)]
Bug 30572: Dbrev for search_marc_to_field.sort

Test plan:
Run updatedatabase.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30572: Adjust search_marc_to_field.sort in kohastructure
Marcel de Rooy [Thu, 21 Apr 2022 12:29:48 +0000 (12:29 +0000)]
Bug 30572: Adjust search_marc_to_field.sort in kohastructure

Test plan:
New install or run kohastructure on empty database.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 20449: DBRev 21.11.05.004
Kyle Hall [Fri, 6 May 2022 17:57:04 +0000 (13:57 -0400)]
Bug 20449: DBRev 21.11.05.004

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30449: (QA follow-up) Report back on problematic situations
Tomas Cohen Arazi [Mon, 25 Apr 2022 13:09:41 +0000 (10:09 -0300)]
Bug 30449: (QA follow-up) Report back on problematic situations

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30449: DBIC updates
Tomas Cohen Arazi [Mon, 25 Apr 2022 12:51:24 +0000 (09:51 -0300)]
Bug 30449: DBIC updates

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30449: Add missing FK constraint on borrower_attribute_types
Marcel de Rooy [Mon, 4 Apr 2022 13:20:37 +0000 (13:20 +0000)]
Bug 30449: Add missing FK constraint on borrower_attribute_types

Old Koha databases probably have it, newer ones might not.
See also BZ description.

Test plan:
[1} Check SHOW CREATE TABLE borrower_attribute_types to see if you
    have any index and FK constraint on category_code.
[2] Run updatedatabase.
[3] If you had category_code_fk, it should be replaced.
[4] Remove index and constraint again using things like:
    alter table borrower_attribute_types drop constraint `borrower_attribute_types_ibfk_1`;
    alter table borrower_attribute_types drop index category_code;
[5] Run updatedatabase.
[6] You should have KEY category_code and FK borrower_attribute_types_ibfk_1.
[7] Run updatedatabase. Idempotent, no changes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30610: Update on click binding for print receipt
Martin Renvoize [Mon, 25 Apr 2022 14:37:33 +0000 (15:37 +0100)]
Bug 30610: Update on click binding for print receipt

This patch updates the binding for the on click even of the print
receipt button so that subsequent pages in the datatable work with the
reciept printing button.

Test plan
1) Enable cash management and process enough transactions to display
   more than one page of transactions in the register details page.
2) Confirm the 'Print receipt' button works on the first page of
   transactions
3) Confirm the 'Print receipt' button works on subsequent transactions
   pages in the datatable.
4) Confirm the same for the past transactions table.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30565: DBRev 21.11.05.003
Kyle Hall [Fri, 6 May 2022 17:54:30 +0000 (13:54 -0400)]
Bug 30565: DBRev 21.11.05.003

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30565: DBIx schema change for stockrotationrotas
Marcel de Rooy [Wed, 20 Apr 2022 11:37:31 +0000 (11:37 +0000)]
Bug 30565: DBIx schema change for stockrotationrotas

No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30565: Database revision for stockrotationrotas
Marcel de Rooy [Wed, 20 Apr 2022 11:29:58 +0000 (11:29 +0000)]
Bug 30565: Database revision for stockrotationrotas

Add unique key if needed.
Adjust description column to make it NOT NULL.

Test plan:
(Optionally:) Drop unique key, make description nullable.
Run dbrev.
Check if unique key present, and description not-nullable.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30565: Correct kohastructure
Marcel de Rooy [Wed, 20 Apr 2022 11:22:15 +0000 (11:22 +0000)]
Bug 30565: Correct kohastructure

The unique key was added in a dbrev and is referred to in code.
But forgotten in kohastructure.

Test plan:
Run new install or kohastructure.sql on empty db.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30630: Prevent crash on check-in if HoldsAutoFill is ON
Jonathan Druart [Thu, 28 Apr 2022 07:43:06 +0000 (09:43 +0200)]
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON

RevertWaitingStatus has already removed the itemnumber from the hold, passing $itemnumber (from scanned item) should work, as it will reattach the hold to the item

Test plan:
1 - Enable HoldsAutoFill
2 - Place a title level hold
3 - Check in an item and confirm hold
4 - Switch to another branch
5 - Checkin the item
Without this patch you got
Can't call method "biblionumber" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1577.
 at /kohadevbox/koha/C4/Reserves.pm line 1576
With this patch applied the operation succeeds

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 24001: (follow-up) Fix t_Profile.t
Fridolin Somers [Fri, 29 Apr 2022 06:24:45 +0000 (20:24 -1000)]
Bug 24001: (follow-up) Fix t_Profile.t

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 24001: Fix Card template/rpinter profile creation and edit
Nick Clemens [Fri, 4 Mar 2022 16:19:35 +0000 (16:19 +0000)]
Bug 24001: Fix Card template/rpinter profile creation and edit

This patch adjusts the template/profiles to use the default of '0'
This should probably be NULL, and the columns foreign keys, this code
could use a further rewrite, but this should fix a long standing bug

To test:
 1 - Using the fresh install, with all the sample data.
 2 - Go to Home › Tools › Patron card creator › Templates
 3 - New > Card template
 4 - Save
 5 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'profile_id' at row 1
 6 - Edit an existing template
 7 - Save
 8 - Error: Can't bless non-reference value at /kohadevbox/koha/C4/Creators/Profile.pm line 89
 9 - Create a new 'Printer profile'
10 - Save
11 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'template_id' at row 1
12 - Apply the attached patch.
13 - Verify you can create a new 'Card template' and 'Printer profile' with no errors
14 - Verify you can edit and save both of the newly created objects above

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 24001: Fix patron card template edition
Blou [Tue, 30 Jun 2020 16:50:09 +0000 (12:50 -0400)]
Bug 24001: Fix patron card template edition

Error when saving Patron card Template:
Can't bless non-reference value at
/home/vagrant/kohaclone/C4/Creators/Profile.pm line 89

This is caused by the profile dropdown offering invalid choices and is
fixed by adding a filter to limit options to creator = 'Patroncards'.
The UI already handles the case where no valid profile is avaiable.

Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29092: DBRev 21.11.05.002
Kyle Hall [Fri, 6 May 2022 17:45:24 +0000 (13:45 -0400)]
Bug 29092: DBRev 21.11.05.002

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29092: Add timestamp to account-fines table column settings
Emmi Takkinen [Thu, 21 Apr 2022 06:27:17 +0000 (09:27 +0300)]
Bug 29092: Add timestamp to account-fines table column settings

Table settings for the account_fines table (in the Patrons section, the
"Transactions" table in a patron account) are missing a checkbox for the
"Updated On" column. Because of this, one cannot hide the Updated On
column and any other values one sets here get applied to the wrong
columns.

This patch adds timestamp to account-fines column settings.
To test:

1) Navigate to columns settings page and modify account-fines tables
   column.
   => Note that if you hide e.g. account_type column, column
   credit_number is hidden on patrons account page
2) Apply patch and update database.
   => Account-fines column settings has now a option to hide timestamp.
   => Correct columns should now be hidden.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29077: (follow-up) Use another syntax
Fridolin Somers [Wed, 27 Apr 2022 00:59:59 +0000 (14:59 -1000)]
Bug 29077: (follow-up) Use another syntax

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29077: Remove blank indexes before convert
Nick Clemens [Wed, 22 Sep 2021 12:55:19 +0000 (12:55 +0000)]
Bug 29077: Remove blank indexes before convert

To test:
1 - Be using Elasticsearch
2 - Search on OPAC with dropdown set to 'Library catalog'
3 - Warns in plack-opac-error.log
4 - Apply patch
5 - Repeat
6 - No warns
7 - Search returns correct results

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30224: Show correct important field in cataloguing validation
Adam Styles [Fri, 4 Mar 2022 00:22:38 +0000 (11:22 +1100)]
Bug 30224: Show correct important field in cataloguing validation

This patch fxes the cataloguing validation messages to show the correct tag, when the whole field is important (not just a subfield).

Note: Look at Bug 30159 to fix the formatting of the validation popup.

1. Go to Administration -> MARC bibliographic frameworks
2. Click Actions next to a framework, view MARC structure
3. Edit multiple tags (at least 2) and check the Important checkbox.
4. Go to cataloguing and create a new record using the framework you just edited
5. Don't fill any of the important fields. Click Save to force the validation for the important tags
6. Notice that the error message shows that an important field isn't filled, but the tag number shown is repeated for each message. The 'Go to field' link goes to the right tag, but the tag number shown is incorrect.
7. Apply patch and refresh page
8. Click Save to force validation again.
9. Confirm the correct tag number is now showing for each error message.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30482: Potential for bad string concatenation in cataloging validation error...
Owen Leonard [Thu, 7 Apr 2022 09:36:00 +0000 (09:36 +0000)]
Bug 30482: Potential for bad string concatenation in cataloging validation error message

In validating the basic MARC editor form before submission, we run
AreFieldsNotOk() twice (once with the parameter "false") and concatenate
the result for output. This creates the potential for the error string
to be appended with "0" if AreFieldsNotOk() returns false.

This patch improves the logic around building the error string.

To test, apply the patch and make sure one of your MARC frameworks
contains at least one mandatory field and at least one important field.

- Edit or create a MARC record in the basic MARC editor.
- Submit the form in various states of completion:
  - If a mandatory and an important field are empty, you should see two
    error messages at the top. "The following mandatory subfields aren't
    filled" and "The following important subfields aren’t filled."
  - If a mandatory OR an important field is empty, you should see a
    single message.
    - If it's the important field which is empty, a confirmation will
      ask if you want to save the record anyway. Test that both answers
      to this confirmation work correctly.
  - If no mandatory or important fields are empty the form should
    submit.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30072: (followup) Fix random failure of Holds_hooks.t
Fridolin Somers [Wed, 27 Apr 2022 00:17:00 +0000 (14:17 -1000)]
Bug 30072: (followup) Fix random failure of Holds_hooks.t

When building Koha::Holds object,
do not let 'found' random otherwise it may take a valid value indicating
hold is found.

See other holds unit tests.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30587: Fix acqui/supplier.tt translate issues
Tomas Cohen Arazi [Thu, 21 Apr 2022 16:48:47 +0000 (13:48 -0300)]
Bug 30587: Fix acqui/supplier.tt translate issues

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30587: Fix opac-tags.tt translate issues
Tomas Cohen Arazi [Thu, 21 Apr 2022 16:24:06 +0000 (13:24 -0300)]
Bug 30587: Fix opac-tags.tt translate issues

This patch addresses one specific case.

To test:
1. Run:
   $ kshell
  k$ cd misc/translator
  k$ perl translate update es-ES
2. On your git checkout run:
   $ git diff | grep '\[% limit or'
=> FAIL: That shouldn't be translated
3. Run:
   $ git reset --hard HEAD
4. Apply this patch
5. Repeat 1 and 2
=> SUCCESS: No attempt to translate that tag
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30191: Authority search result list in the OPAC should use 'record' instead of...
Owen Leonard [Wed, 2 Mar 2022 16:21:41 +0000 (16:21 +0000)]
Bug 30191: Authority search result list in the OPAC should use 'record' instead of 'biblios'

This patch updates the OPAC authority search results page so that it
uses the term "record" instead of "biblio."

The patch also changes how the template outputs the count of records so
that it is correctly pluralized, e.g. "1 record" vs. "2 records."

To test, apply the patch and perform an authority search in the OPAC.

In the search results, confirm that the last table header reads
"Records." The information in that column should be correct, using the
word record or records.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30534: Remove guarantor_id attribute from the patron object
Tomas Cohen Arazi [Wed, 13 Apr 2022 20:07:55 +0000 (17:07 -0300)]
Bug 30534: Remove guarantor_id attribute from the patron object

This patch removes an attribute that was actually removed 3 years ago
and causes an exception when trying to search for it. The API responses
don't include it anyways.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoRevert "Bug 30405: Reduce font-size for address in patron search result"
Kyle Hall [Fri, 6 May 2022 14:57:48 +0000 (10:57 -0400)]
Revert "Bug 30405: Reduce font-size for address in patron search result"

This reverts commit d374b7bbfce5b23ec9e6d47a3c313d8d8ac779ff.

2 years agoBug 30405: Reduce font-size for address in patron search result
Jonathan Druart [Fri, 8 Apr 2022 08:22:05 +0000 (10:22 +0200)]
Bug 30405: Reduce font-size for address in patron search result

The address has a font-size: 110%, it's not needed here, 100% is enough.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29483: [21.11.x] Check ItemsAnyAvailableAndNotRestricted once per patron
Nick Clemens [Mon, 15 Nov 2021 13:54:00 +0000 (13:54 +0000)]
Bug 29483: [21.11.x] Check ItemsAnyAvailableAndNotRestricted once per patron

ItemsAnyAvailableAndNotRestricted can take a long time and create nested loops.
We can check it once per patron, however, this requires us to flip the loops.
Since an item can only be used once, we now add a check to see if this item has already
been assigned to a borrower.

To test:
1 - Find or create a biblio with 100 items
2 - Place ten 'Next available' holds on a biblio
3 - Set preference 'AllowRenewalIfOtherItemsAvailable' to 'Allow'
    Set circ rules 'On shelf holds allowed' to 'If any unavailable'
4 - Checkout one of the items to a patron, backdated to be overdue
5 - Note a long loading time for the patron's checkouts
6 - Apply patch, restart_all
7 - Patron loads much faster

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29483: Unit tests

This patch updates the AllowRenewalIfOtherItemsAvailable tests to
remove deletion of all data, and create specific circ rules for this
test. It adjust several other tests that were relying on the rules from
this test, so thy too create their opwn specific rules.

Additionally, we add tests to cover the case of mutliple items on the record,
and some items cannot fill some reserves.

What is uncovered here is that the same patron is checked twice, so two holds can
be filled, but they only satisfy a single patron

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 29483: Further improve performance of script

This patch adds a few tests to cover more cases, and to highlight current functionality.

The script only allows renewal if all outstanding holds can be filled by available items.
This means we can return as soon as we have determined that not all holds can be filled.

I add FIXME and some explanatory comments - I will file a follow-up bug for those, but
I feel we can accept these improvements to the performance and deal with the issues
of how it 'should' work versus how it does work on another report.

To test:
1 - prove -v t/db_dependent/Circulation.t

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30461: Fix BatchUpdateAuthority
Jonathan Druart [Wed, 6 Apr 2022 09:35:41 +0000 (11:35 +0200)]
Bug 30461: Fix BatchUpdateAuthority

Use of inherited AUTOLOAD for non-method Koha::BackgroundJob::BatchUpdateAuthority::ModAuthority() is
no longer allowed

Test plan:
Use the batch authority tools to edit authority record and confirm that
the task processes correctly

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27253: (follow-up) Fix UNIXTIME(0) in db_revs/211200037.pl
Marcel de Rooy [Mon, 25 Apr 2022 10:29:05 +0000 (10:29 +0000)]
Bug 27253: (follow-up) Fix UNIXTIME(0) in db_revs/211200037.pl

MariaDB [koha_myclone]> update borrowers set updated_on=COALESCE( NULL, FROM_UNIXTIME(0) ) where borrowernumber=51;
ERROR 1292 (22007): Incorrect datetime value: '1970-01-01 00:00:00' for column `koha_myclone`.`borrowers`.`updated_on` at row 1

MariaDB [koha_myclone]> update borrowers set updated_on=COALESCE( NULL, FROM_UNIXTIME(1) ) where borrowernumber=51;
Query OK, 1 row affected (0.008 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested by switching updated_on to datetime. Remove NOT NULL, etc.
Copied dbrev to atomicupdate folder.
Resulted in:
    Updated all NULL values of borrowers.updated_on to GREATEST(date_renewed, dateenrolled, lastseen): 51 rows updated

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30595: Prevent update_child_to_adult.t to fail randomly
Jonathan Druart [Fri, 22 Apr 2022 09:42:09 +0000 (11:42 +0200)]
Bug 30595: Prevent update_child_to_adult.t to fail randomly

t/db_dependent/selenium/update_child_to_adult.t ..         # Looks like you planned 3 tests but ran 2.

    #   Failed test 'Update child to adult'
    #   at t/db_dependent/selenium/update_child_to_adult.t line 132.
    # Looks like you planned 3 tests but ran 2.
    # Looks like you failed 1 test of 2 run.
t/db_dependent/selenium/update_child_to_adult.t .. 1/1
 #   Failed test 'Update child to patron'
 #   at t/db_dependent/selenium/update_child_to_adult.t line 153.
Cannot wait more for element '//input[@type="submit"]' to be visible at /kohadevbox/koha/t/lib/Selenium.pm line 189.

It happens when there are too many patron's categories and the submit
button is not in the viewport.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 18392: Add noExport of rows and don't export 'edit' row
Nick Clemens [Wed, 13 Apr 2022 19:42:06 +0000 (19:42 +0000)]
Bug 18392: Add noExport of rows and don't export 'edit' row

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 18392: use KohaTable for circ rules to allow export of matrix
Nick Clemens [Wed, 13 Apr 2022 19:10:43 +0000 (19:10 +0000)]
Bug 18392: use KohaTable for circ rules to allow export of matrix

To test:
1 - Define some circ rules
2 - View them, note the appearance
3 - Apply patch
4 - Reload and note change of header
5 - Use the new button to export, try various formats
6 - Test the filter and export

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27253: DBRev 21.11.05.001
Kyle Hall [Fri, 29 Apr 2022 17:29:06 +0000 (13:29 -0400)]
Bug 27253: DBRev 21.11.05.001

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 27253: Fix definition of updated_on in borrowers and deletedborrowers
Julian Maurice [Thu, 31 Mar 2022 13:38:07 +0000 (15:38 +0200)]
Bug 27253: Fix definition of updated_on in borrowers and deletedborrowers

Test plan:
1. First you have to be in a state where updated_on is NULL-able. You
   can do that by either:
   a) do a fresh install of Koha 16.05 and update to master, or
   b) execute the following SQL queries:

     ALTER TABLE borrowers MODIFY updated_on timestamp NULL
     DEFAULT current_timestamp() ON UPDATE current_timestamp()
     COMMENT 'time of last change could be useful for synchronization
     with external systems (among others)'

     ALTER TABLE deletedborrowers MODIFY updated_on timestamp NULL
     DEFAULT current_timestamp() ON UPDATE current_timestamp()
     COMMENT 'time of last change could be useful for synchronization
     with external systems (among others)'
2. Create two borrowers (let's name them X and Y)
3. Delete borrower Y
4. Set the column updated_on to NULL for both borrowers by executing the
   following SQL query:
   UPDATE borrowers SET updated_on = NULL WHERE borrowernumber =
   <borrowernumber of X>
   UPDATE deletedborrowers SET updated_on = NULL WHERE borrowernumber =
   <borrowernumber of Y>
5. Apply patch and run updatedatabase
6. Verify that borrowers.updated_on and deletedborrowers.updated_on are
   not NULL-able.
   Verify that updated_on for X and Y have taken the value of
   dateenrolled.
7. Repeat step 2 to 6 but this time renew the patron and/or log in with
   its account in order to set the columns borrowers.date_renewed and
   borrowers.lastseen before executing updatedatabase
   borrowers.updated_on should take the greatest value among
   dateenrolled, date_renewed, and lastseen

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30531: Add mock of UseRecalls to Search.t
Nick Clemens [Thu, 14 Apr 2022 11:24:48 +0000 (11:24 +0000)]
Bug 30531: Add mock of UseRecalls to Search.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30346: Correctly transfer values when editing rules
Lucas Gass [Mon, 11 Apr 2022 19:35:14 +0000 (19:35 +0000)]
Bug 30346: Correctly transfer values when editing rules

To test:
--Create a circulation rule with a value in "Overdue fines cap (amount), or edit an existing rule to add it
-Save the new (or edited) rule.
-Edit the same rule again to change any other field. Note that "Overdue fines cap (amount)" is now blank
-Save your edited rule - "Overdue fines cap (amount)" will save as blank.

Apply patch

--Create a circ rule with a value in Overdue fines cap (amount) and check "Cap fine at replacement price" for that same rule.
-Save the rule
-Try ediding the rule and make sure both of those values now save correctly.
-Add several more rules and try playing with both "Cap fine at replacement price" and "Overdue fines cap (amount)". Make sure everything saves right.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30509: Fix configuration of Notices accordion widget
Owen Leonard [Mon, 11 Apr 2022 17:04:34 +0000 (17:04 +0000)]
Bug 30509: Fix configuration of Notices accordion widget

The jQueryUI upgrade broke the Accordion on the notices edit page. I'm
not sure why, but defining a "header" option in the accordion
configuration fixes it.

To test, apply the patch and test the notices edit page both with and
without TranslateNotices and multiple languages installed. In both cases
the different sections (Email, Print, SMS) should open and close
correctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30540: Fix perl critic complaint of leading zeros
Nick Clemens [Thu, 14 Apr 2022 10:51:18 +0000 (10:51 +0000)]
Bug 30540: Fix perl critic complaint of leading zeros

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30540: eval on set_time_zone
Martin Renvoize [Thu, 14 Apr 2022 08:14:47 +0000 (09:14 +0100)]
Bug 30540: eval on set_time_zone

This patch adds an eval around the call to set_time_zone so that we
don't crash on invalid local dates and instead just keep the passed
floating timezone.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30540: Unit test
Martin Renvoize [Thu, 14 Apr 2022 09:19:47 +0000 (10:19 +0100)]
Bug 30540: Unit test

This patch adds tests for checking the output_pref method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/DateUtils.t
=> FAIL: The feature is not implemented, tests fail to complete

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30518: Correct DateTime maths for needs_advancing
Martin Renvoize [Wed, 13 Apr 2022 07:24:22 +0000 (08:24 +0100)]
Bug 30518: Correct DateTime maths for needs_advancing

The needs_advancing method prior to this patch used basic DateTime
arithmatic, adding a DateTime::Duration in Days to the Arrival date of
the item and then comparing that to today. This, however, can cause bugs
when the arrival + duration date coincides with a DST boundary and as
such may result in an invalid local date.  See
https://metacpan.org/pod/DateTime#Making-Things-Simple for further
details.

This patch updates the code to use the DST safe delta_days method to
count the days between arrival and now instead and then compares this
integer to the defined duration of the stage.

To test:
1. Re-run the unit tests, they should now pass.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30518: Unit test
Martin Renvoize [Wed, 13 Apr 2022 07:52:02 +0000 (08:52 +0100)]
Bug 30518: Unit test

This patch adds tests for checking the needs_advancing method against
a timezone and datetime that would cause an Invalid local time failure

To test:
1. Apply this patch
2. Run:
   $ kshell
   k$ prove t/db_dependent/StockRotationItems.t
=> FAIL: The feature is not implemented, tests fail to complete

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoUpdate release notes for 21.11.05 release v21.11.05
Kyle M Hall [Tue, 26 Apr 2022 17:56:00 +0000 (17:56 +0000)]
Update release notes for 21.11.05 release

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoIncrement version for 21.11.05 release
Kyle Hall [Tue, 26 Apr 2022 15:06:55 +0000 (11:06 -0400)]
Increment version for 21.11.05 release

2 years agoFix translations for Koha 21.11.05
Jonathan Druart [Fri, 18 Mar 2022 09:26:48 +0000 (10:26 +0100)]
Fix translations for Koha 21.11.05

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoMerge remote-tracking branch 'koha-translate/21.11.05-translate-20220426' into 21...
Kyle Hall [Tue, 26 Apr 2022 13:36:28 +0000 (09:36 -0400)]
Merge remote-tracking branch 'koha-translate/21.11.05-translate-20220426' into 21.11.x

2 years agoBug 30584: Fix ES mapping creation
Jonathan Druart [Thu, 21 Apr 2022 17:23:14 +0000 (19:23 +0200)]
Bug 30584: Fix ES mapping creation

We need to tell DT that we are adding/removing row, not only deal
manually with the DOM.

This patch also fixes the following bug: if you add or remove a row from
the "biblio" tab, then go to another tab and back to "biblio", all
changes were gone (bug existed prior to bug 29893).

Test plan:
Add, edit and remove mappings, switch from tabs and save.
Use the filters, save (29893 regression test)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoTranslation updates for Koha 21.11.05
Koha translators [Tue, 26 Apr 2022 13:25:38 +0000 (10:25 -0300)]
Translation updates for Koha 21.11.05

2 years agoBug 30583: Fix hold system for translated templates
Jonathan Druart [Thu, 21 Apr 2022 14:30:24 +0000 (16:30 +0200)]
Bug 30583: Fix hold system for translated templates

There are missing quotes, and the translate script is messing up with
the generated template.

Error is:
Template process failed: file error - parse error - holds_table.inc line 216-217: unexpected token (hold)

The generated line, without this patch is:
216 <td><input %]="%]" class="printholdslip" data-reserve_id="[%" hold.reserve_id="hold.reserve_id" html="html" name="printholdslip" type="button" value="Recibo" |="|"></td>
With this patch applied:
216  <td><input class="printholdslip" data-reserve_id="[% hold.reserve_id | html %]" name="printholdslip" type="button" value="Recibo"></td>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30525: Items batch modification broken
Owen Leonard [Wed, 13 Apr 2022 14:07:53 +0000 (14:07 +0000)]
Bug 30525: Items batch modification broken

This patch modifies instances in the code which try to get cookies
using:

my %cookies = parse CGI::Cookie($cookie);

In some cases the relevant lines can be removed because they are unused.
In others it can be replaced with:

my %cookies = CGI::Cookie->fetch();

To test, apply the patch and restart_all. Test the following pages to
confirm they load without errors:

- Circulation -> Offline circulation file upload
- Circulation -> Offline circulation -> Add to queue

- Tools -> Batch item modification
- Tools -> Stage MARC for import
- Tools -> Staged MARC management
- Tools -> Batch patron modification
- Tools -> Upload local cover image

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30532: (bug 29957 follow-up) Fix '$cookie->value'
Jonathan Druart [Thu, 21 Apr 2022 13:05:24 +0000 (15:05 +0200)]
Bug 30532: (bug 29957 follow-up) Fix '$cookie->value'

We got
 Can't call method "value" on unblessed reference at /kohadevbox/koha/opac/opac-messaging.pl line 86

$cookie can be an arrayref, we should retrieve the session id using
CGI->cookie('CGISESSID')

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30376: Fix missing mandatory date acquired error on item save
Jonathan Druart [Wed, 6 Apr 2022 15:00:36 +0000 (17:00 +0200)]
Bug 30376: Fix missing mandatory date acquired error on item save

Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30172: Enqueue the job even if rabbitmq is not reachable
Jonathan Druart [Thu, 24 Mar 2022 15:24:06 +0000 (16:24 +0100)]
Bug 30172: Enqueue the job even if rabbitmq is not reachable

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30172: Prevent race condition when enqueuing a new task
Jonathan Druart [Thu, 24 Feb 2022 09:41:16 +0000 (10:41 +0100)]
Bug 30172: Prevent race condition when enqueuing a new task

As we are sending the job to the rabbitmq before in the transaction, the
worker can receive the job to process before the transaction committed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30498: DBRev 21.11.04.004
Kyle Hall [Fri, 15 Apr 2022 12:14:16 +0000 (08:14 -0400)]
Bug 30498: DBRev 21.11.04.004

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30498: Corresponding DBIx change for SearchField
Kyle Hall [Fri, 15 Apr 2022 12:13:00 +0000 (08:13 -0400)]
Bug 30498: Corresponding DBIx change for SearchField

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30498: Fix enum search_field.type
Marcel de Rooy [Fri, 8 Apr 2022 09:19:31 +0000 (09:19 +0000)]
Bug 30498: Fix enum search_field.type

Resolves sync issue with upgrades.

Test plan:
Run dbrev.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30481: DBRev 21.11.04.003
Kyle Hall [Fri, 15 Apr 2022 12:08:05 +0000 (08:08 -0400)]
Bug 30481: DBRev 21.11.04.003

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 30481: Drop unique constraint deleteditemsstocknumberidx
Marcel de Rooy [Thu, 7 Apr 2022 11:59:53 +0000 (11:59 +0000)]
Bug 30481: Drop unique constraint deleteditemsstocknumberidx

Resolves a sync issue between database and schema caused by
differences between structure and upgrades. Note: newer
databases do not contain this index any longer.

Test plan:
Run dbrev.
Check SHOW CREATE TABLE deleteditems.
Verify that unique index has been dropped, regular index added.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>