]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 30072: Add missing hold actions plugin hooks
Tomas Cohen Arazi [Fri, 11 Feb 2022 18:28:31 +0000 (15:28 -0300)]
Bug 30072: Add missing hold actions plugin hooks

This patch introduces the after_hold_action plugin hook, with 4
different 'action' parameters:

- fill
- cancel
- suspend
- resume

To test:
1. Apply the unit tests
2. Run:
   $ kshell
  k$ t/db_dependent/Koha/Plugins/Holds_hooks.t -v
=> FAIL: The hooks are not in the code, so the expected output from the
Koha::Plugin::Test plugin is not there, and the tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Note: I think we could deprecate 'after_hold_create' and migrate it to
the one introduced here, using the 'place' action.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f2d1b126b97ede8d67a3deee97c3a2dc44b334c8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30072: Unit tests
Tomas Cohen Arazi [Fri, 11 Feb 2022 18:28:10 +0000 (15:28 -0300)]
Bug 30072: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ecbe50aa317a27d6ce55317ceec51e8b1c72c6a3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29877: Make POST /holds handle maxreserves correctly
Tomas Cohen Arazi [Thu, 13 Jan 2022 15:10:30 +0000 (12:10 -0300)]
Bug 29877: Make POST /holds handle maxreserves correctly

The current implementation doesn't consider the following values for the
syspref: undef and 0.

The tests mistakenly didn't cover them.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, obvious warnings about comparing undefined values
         too.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. You can try on Postman as well
=> SUCCESS: Behavior is correct!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b002a84a2c6e5ee59562620b62bb21cfc7f61a02)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29877: Regression tests
Tomas Cohen Arazi [Thu, 13 Jan 2022 15:10:24 +0000 (12:10 -0300)]
Bug 29877: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8ea1b883b76187a1d863f08426b65f5321fd703e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29596: correct DBRev
Andrew Fuerste-Henry [Mon, 7 Mar 2022 14:39:33 +0000 (14:39 +0000)]
Bug 29596: correct DBRev

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29706: (follow-up) Adjust code to work for multi-holds
Nick Clemens [Tue, 8 Feb 2022 12:30:23 +0000 (12:30 +0000)]
Bug 29706: (follow-up) Adjust code to work for multi-holds

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29706: Hide items that cannot be held by default when placing hold on OPAC
Nick Clemens [Thu, 16 Dec 2021 01:59:50 +0000 (01:59 +0000)]
Bug 29706: Hide items that cannot be held by default when placing hold on OPAC

This patch adds a 'holdable' and 'unholdable' class to the rows of the table

Additionally I rename the 'backgroundcolor' field to 'onloan' as that is what it contains.
Note: Out of the box, there is no css associated with this class

I add a div around the table to allow hiding the new buttons as well when optiuons are hidden

It would be nice in the future to utilise a Koha table here, however, it is complicated by multi-holds

To test:
 1 - Add a number of items to a record, ensuring they belong to different libraries
 2 - Set 'Default checkout, hold and return policy'->'Hold policy' to 'From home library'
 3 - Sign in to opac and attempt to placehold on the record
 4 - Click 'show more options' and 'a specificitem'
 5 - Note holds table includes items that cannot be held
 6 - Apply patch
 7 - Reload holds page
 8 - Note items that cannot be heldare hidden
 9 - Click 'Show unholdable items' and note they appear
10 - Click 'Hide unholdable items' and veriofy they hide
11 - Test with multi holds

Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
(cherry picked from commit 8b13fc7ebbc236ea2358b1da58e871e6090cb396)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29706: Improve table elements
Nick Clemens [Thu, 16 Dec 2021 01:12:52 +0000 (01:12 +0000)]
Bug 29706: Improve table elements

This patch add a thead and tbody element to the 'copiesrow' table

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29596: DBRev 21.05.11.001
Andrew Fuerste-Henry [Fri, 4 Mar 2022 15:28:35 +0000 (15:28 +0000)]
Bug 29596: DBRev 21.05.11.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29596: Add Yiddish language
Tomas Cohen Arazi [Mon, 29 Nov 2021 21:35:46 +0000 (18:35 -0300)]
Bug 29596: Add Yiddish language

This patch adds the Yiddish language to Koha. The language codes were
taken from https://www.loc.gov/standards/iso639-2/php/code_list.php

Sponsored-by: Universidad Nacional de San Martín
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 808fb2679bb4c3574589486546d61e0d392c8368)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28576: Update the maximum size of an image.
The Minh Luong [Tue, 1 Feb 2022 19:44:06 +0000 (14:44 -0500)]
Bug 28576: Update the maximum size of an image.

This patch modifies the maximum size of a patron's image, from 500KB to
2MB. Also, in Home/Patrons/anyPatron, when you try to add an image to a
patron, you can now see the supported file types AND the maximum size.

The following places are affected by this patch:
- Home/Patrons/anyPatron
- Home/Tools/Upload patron images
- Home/Tools/Patron card creator/Images

To test:
1)Search for any patron and go to his page.
2)Hover over the image area on the left and click on the "Add" button.
3)Notice that the message above the choose file button only specifies
file types without the maximum size.
4)Add an image bigger than 500KB.
5)Nothing happens. (This is because the maximum size is 5KB)
6)Apply the patch.
7)Repeat steps from 1 to 3.
8)Notice that the message now includes the maximum size.
9)Add an image bigger than 500KB, but smaller than 2MB.
10)The image is succesfully uploaded.
11)Add an image bigger than 2MB.
12)Nothing happens. (The maximum size is now 2MB)
13)Repeat the steps 9 to 12 in "Home/Tools/Upload patron images" and
"Home/Tools/Patron card creator/Images".
14)Notice that the maximum size is updated.

Signed-off-by: David Nind <david@davidnind.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>
(cherry picked from commit cc49fd7e00a789d15aac7294dfc8066a2c5c3752)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28576: Add patron image in patron detail section does not specify image size...
Salman Ali [Wed, 16 Jun 2021 17:20:24 +0000 (13:20 -0400)]
Bug 28576: Add patron image in patron detail section does not specify image size limit

When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented.

This is not the case with the 2 other places where we can add patron images in which they give warnings:
Home/Tools/Upload patron images
Home/Tools/Patron card creator/Images

For now, i simply added the size limit to the file supported message.

To test:
1)Search for any patron and go to his page
2)Hover over the image area on the left and click on add
3)Notice the message above the choose file button only specifies file types not size.
4)Add an image bigger than 500 kb
5)Nothing happens
6)Apply patch
7)Repeat steps from 1 to 3
8)Notice the message now includes the maximum size

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.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>
(cherry picked from commit 196e964237f4be0ca53bf27cbc53b0677c9b58ad)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoUpdate release notes for 21.05.11 release v21.05.11
Andrew Fuerste-Henry [Mon, 21 Feb 2022 17:44:25 +0000 (17:44 +0000)]
Update release notes for 21.05.11 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoIncrement version for 21.05.11 release
Andrew Fuerste-Henry [Mon, 21 Feb 2022 17:37:51 +0000 (17:37 +0000)]
Increment version for 21.05.11 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoFix translations for Koha 21.05.11
Andrew Fuerste-Henry [Mon, 21 Feb 2022 17:34:40 +0000 (17:34 +0000)]
Fix translations for Koha 21.05.11

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoTranslation updates for Koha 21.05.11
Koha translators [Mon, 21 Feb 2022 17:13:36 +0000 (14:13 -0300)]
Translation updates for Koha 21.05.11

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30090: Don't export some columns in patron search results
Fridolin Somers [Mon, 14 Feb 2022 21:04:25 +0000 (11:04 -1000)]
Bug 30090: Don't export some columns in patron search results

The checkout and Edit buttons should not export (Exel, Print) on the patron search result list.
Same for fist column with checkboxes.

Test plan :
1) Go to patrons module /cgi-bin/koha/members/members-home.pl
2) Perform a search with results
3) Click on 'Export' then 'Print'
=> Check you dont see column with checkboxes (text 'Select patron') and colum with actions

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30082: Bibliographic details tab missing when user can't add local cover image
Owen Leonard [Fri, 11 Feb 2022 15:24:43 +0000 (15:24 +0000)]
Bug 30082: Bibliographic details tab missing when user can't add local cover image

This patch corrects the template logic which determines whether the
"Images" tab should be displayed on the bibliographic detail page. The
"Images" tab should display whenever local cover images are enabled, not
just if the user has permission to manage cover images.

To test, apply the patch and go to Administration -> System preferences.

- Enable the LocalCoverImages system preference.
- Locate and view the detail page for a bibliographic record in the
  catalog which doesn't have a local cover image attached.

  - If you are logged in as a user with upload_local_cover_images
    permission you should see an "Images" tab with the message "No
    images have been uploaded for this bibliographic record yet" and an
    upload button.
  - If you are logged in as a user without upload_local_cover_images
    permission you should see an "Images" tab with just the "No
    images..." message.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29952: Replace obsolete DataTable column filter function
Owen Leonard [Thu, 27 Jan 2022 11:50:28 +0000 (11:50 +0000)]
Bug 29952: Replace obsolete DataTable column filter function

The "Filter paid transactions" link on the Accounting -> Transactions
page is broken because it uses an obsolete DataTables function for
filtering. This patch updates it to use the current syntax, available in
DataTables since version 1.10.

To test, apply the patch and locate a patron in the staff interface who
has multiple fines, some paid.

- View the patron's "Accounting" page and click the "Transactions" tab.
- Click the "Filter paid transactions" link. The table should be
  filtered so that only transactions with an outstanding amount > zero
  are shown.
- The filter link should change to read "Show all transactions."
- Clicking "Show all transactions" should clear the filter.
- Test with one or more columns hidden using the "Columns" control.
  Filtering should still work correctly with columns hidden.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29385: Catch register_id for payments against fees
Jonathan Druart [Thu, 2 Dec 2021 12:52:45 +0000 (13:52 +0100)]
Bug 29385: Catch register_id for payments against fees

This patch refactors the pay method in SIP FeePayment such that we
consistently pass parameters to both invocations of Koha::Account->pay.

It ensure the missing cash_register definition is passed when a set of
account lines to pay is defined.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e8b1bc88508c1cf919b21cf93a0f7163e1c07289)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29754: (QA follow-up) Minor tests tweaks
Tomas Cohen Arazi [Mon, 7 Feb 2022 11:58:43 +0000 (08:58 -0300)]
Bug 29754: (QA follow-up) Minor tests tweaks

This patch does two things:

- Wraps the new SIP tests in a single transaction. We do that to avoid
  sub-test interference, specially when test files get big. The provided
  tests are correct and don't require previous tests data.
- Migrated from the introduced 'diag' calls to 'note', as I just learned
  they are the same, but 'note' is only displayed when in verbose mode.
  Which is great to avoid unnecessary noise in Jenkins.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29754: Don't include patron when fetching guarantees fines
Nick Clemens [Wed, 22 Dec 2021 15:25:44 +0000 (15:25 +0000)]
Bug 29754: Don't include patron when fetching guarantees fines

This patch removes the flag to fetch the patrons own debts as we have already
calculated them

This test plan highlights another issue - the value of NoIssuesChargeGuarantorsWithGuarantees
is not checked in SIP code - we merely get the total owed including guarantees and compares to
noissuescharge
See bug 29755

To test:
 1 - Apply first patch only
 2 - prove t/db_dependent/SIP/Patron.t
 3 - It fails
 4 - Enable NoIssuesChargeGuarantorsWithGuarantees, you can set to 1
 5 - Create/find a patron
 6 - Add a $10 charge to parons account
 7 - Add a guarantee to patron
 8 - Add a $5 charge to guarantee
 9 - Set noissuescharge to 15.01
10 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m patron_information --patron BARCODE
11 - Note the 64 message starts with Y's that mean patron is blocked
12 - Patron shouldn't be blocked as under 15.01
13 - Apply patch
14 - Restart all
15 - repeat 10
16 - Patron is no longer blocked

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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>
(cherry picked from commit fe59e356a3b2ea32b333d6c1d332468db61feeec)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29754: Unit test
Nick Clemens [Wed, 22 Dec 2021 15:20:16 +0000 (15:20 +0000)]
Bug 29754: Unit test

This adds a unit test to the SIP code

It also adds some spacing and dividers to make the tests for 'relationships_debt' easier to read

To test:
prove -v t/db_dependent/Koha/Patron.t - passes and is readable
prove -v t/db_dependent/SIP/Patron.t - fails

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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>
(cherry picked from commit a38ba3b0bd88c96d5614d9e9231c358512158d68)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29966: Dont pass authnotrequired true and flags together
Marcel de Rooy [Fri, 28 Jan 2022 09:59:15 +0000 (09:59 +0000)]
Bug 29966: Dont pass authnotrequired true and flags together

Test plan:
Logout in OPAC.
Goto sco help page.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29785: Rename Koha::Object->message with ->object_messages
Jonathan Druart [Tue, 4 Jan 2022 13:28:26 +0000 (14:28 +0100)]
Bug 29785: Rename Koha::Object->message with ->object_messages

It will conflict with other ->messages methods, it's too generic.

Bug 29230 needs Koha::Patron->messages to return Koha::Patron::Messages for instance.

Test plan:
Confirm that the tests modified by this patch still pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 30b9270bd9dfd773821d5ca17c924e8f7b56c45c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28977: Fix cat_issues_top.pl report with strict SQL modes
Michael Hafen [Fri, 14 Jan 2022 18:35:05 +0000 (11:35 -0700)]
Bug 28977: Fix cat_issues_top.pl report with strict SQL modes

To get the 'Most circulated items' report to run in ONLY_FULL_GROUP_BY
Sql mode.

Test plan:

Turn on strict_sql_modes ( make sure <strict_sql_modes> is 1 in KOHA_CONF )
Go to Reports -> Most circulated items
submit the form.

Without the patch you get an error like:
CGI::Compile::ROOT::usr_local_koha_master_reports_cat_issues_top_2epl::calculate(): DBI Exception: DBD::mysql::st execute failed: Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'koha_main_v4.items.itemcallnumber' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [for Statement "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS `RANK`, biblio.biblionumber AS ID, itemcallnumber as CALLNUM, ccode as CCODE, location as LOC FROM `old_issues`
                  LEFT JOIN items USING(itemnumber)
                  LEFT JOIN biblio USING(biblionumber)
                  LEFT JOIN biblioitems USING(biblionumber)
                  LEFT JOIN borrowers USING(borrowernumber)
                  WHERE 1 AND old_issues.issuedate > '2020-08-03' AND old_issues.issuedate < '2021-05-17' AND old_issues.returndate > '2020-08-27' AND old_issues.returndate < '2021-06-01' AND old_issues.branchcode like '403' AND items.itype like 'F' AND ccode like 'FIC' AND borrowers.categorycode like 'ST' group by biblio.biblionumber order by `RANK` DESC"] at /usr/local/koha_master/reports/cat_issues_top.pl line 67
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

With the patch you will see the report results view.

Signed-off-by: David Nind <david@davidnind.com>
JD Amended patch - adjust commit's title

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29932: Use localStorage instead of cookie for bibs_selected
Owen Leonard [Fri, 21 Jan 2022 13:05:40 +0000 (13:05 +0000)]
Bug 29932: Use localStorage instead of cookie for bibs_selected

This patch replaces the use of the jquery.cookie.js plugin in the
"Browse selected records" feature. The feature is modified to use
localStorage instead of cookies.

To test, apply the patch and go to Administration -> System preferences.

 - Enable the "BrowseResultSelection" system preference.
 - Perform a catalog search which will return multiple results.
 - On the search results page, check the checkbox for a number of
   titles.
 - Click the "Browse selected biblios" button in the toolbar.
 - You should be directed to the detail page for the first title you
   checked.
 - Clicking the right-arrow in the sidebar should take you
   through each one of your selected titles.
 - When you click the "Results" link in the sidebar you should be
   returned to the same search results set and the same titles should be
   checked.
 _ If you uncheck those titles and reload the page the checkboxes should
   remain unchecked.
 - If you log out of the staff interface the "bibs_selected" item in
   localStorage should be deleted. See, for example,
   https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector for
   information about viewing local storage.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29933: Fix stray usage of jquery.cookie.js plugin
Owen Leonard [Mon, 24 Jan 2022 18:33:30 +0000 (18:33 +0000)]
Bug 29933: Fix stray usage of jquery.cookie.js plugin

This patch removes a few instances where the old cookie plugin was still
being used for deleting cookies even though the new plugin is being used
to set the cookies.

To test, apply the patch and test the following processes in the staff
interface:

Search to hold:

 - View a patron record and click the "Search to hold" button.
 - Perform a catalog search which will return results.
 - On the search results page there should be a "Place hold for
   <patron>" link under each holdable title.
 - Click the "Place hold" button's dropdown arrow and choose "Forget
   <patron>." The "Place hold for..." links should disappear.

Search to hold for a patron club:

 - If necessary, create a patron club.
 - Add one or more patrons to the club.
 - In Tools -> Patron clubs, find the club you added patrons to.
 - Click the "Actions" button and then "Search to hold."
 - Perform a catalog search which will return results.
 - On the search results page there should be a "Place hold for
   <club>" link under each holdable title.
 - Click the "Place hold" button's dropdown arrow and choose
   "Forget <club>." The "Place hold for..." links should disappear.

Batch item modification show/hide columns:

 - Go to Tools -> Batch item modification.
 - Submit a list of items for modification.
 - Uncheck some checkboxes to hide columns on the page showing the items
   you submitted.
 - In the browser's storage inspector (e.g.
   https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector),
   should see a "showColumns" cookie with a string of numbers and
   slashes.
 - Click the "Show all columns" checkbox.
 - The "showColumns" cookie should disappear.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29881: libdbd-sqlite2-perl is unavailable on deb12 (koha-common wont install)
Mason James [Fri, 14 Jan 2022 06:44:24 +0000 (19:44 +1300)]
Bug 29881: libdbd-sqlite2-perl is unavailable on deb12 (koha-common wont install)

to test...

- attempt to install koha-common pkg on deb12

  confirm error...
   The following packages have unmet dependencies:
   koha-common : Depends: libdbd-sqlite2-perl but it is not installable

- apply patch, rebuild new package

- install new koha-common pkg on deb12 successfully

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.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>
(cherry picked from commit 382e63cc2da99461dc34fec86dd5014f8cd544c7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29943: DBRev 21.05.10.003
Andrew Fuerste-Henry [Mon, 21 Feb 2022 16:07:06 +0000 (16:07 +0000)]
Bug 29943: DBRev 21.05.10.003

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29943: Db rev: replace typo in existing notices
Marcel de Rooy [Tue, 25 Jan 2022 15:35:05 +0000 (15:35 +0000)]
Bug 29943: Db rev: replace typo in existing notices

Test plan:
Run updatedatabase.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b5a8b8925854be3efe3135d2ca94f1ced42edd79)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29943: Fix NOTIFY_MANAGER notice in sample notices
Marcel de Rooy [Tue, 25 Jan 2022 15:27:35 +0000 (15:27 +0000)]
Bug 29943: Fix NOTIFY_MANAGER notice in sample notices

Test plan:
Look good at this change, or do a new install :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 13b3ea4b9a96df1c0379cd095ae11170715ca116)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29967: extended width of description and opac description inputs on authorised_va...
Lucas Gass [Fri, 28 Jan 2022 20:19:08 +0000 (20:19 +0000)]
Bug 29967: extended width of description and opac description inputs on authorised_values.tt

To test:
-Go to Administration > Authorized values
-In any category, new or existing, look at an authoized value.
-The description and OPAC description inputs both have a maxlenght of 200 but you cannot see very many characters.
-Apply patch
-Look again, the inputs are much bigger and you can see many more characters.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 19865: Add back horizontal scroll bar
Lucas Gass [Thu, 20 Jan 2022 21:45:49 +0000 (21:45 +0000)]
Bug 19865: Add back horizontal scroll bar

To test:
1. Do a Z39.50/SRU search
2. In the search results click on MARC to get the MARC preview. Choose
   something with lots of MARC data so it is both wide and long.
3. See the Y axis scrollbar
4. You must scroll bottom of the modal to see the X axis scrollbar,
   annoying.
5. Apply patch
6. Try steps 1-4 again. This time you should see the X axis scrollbar
   without having to scroll to the bottom.
7. It's not a bad idea to test in multiple browsers.

Note: I also put the CSS onto multiple lines to increase readability

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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>
(cherry picked from commit 099c4b55e7c1b87fc27efcd3c57bc6972d7f2222)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29895: Fix 'add multiple items' button on neworderempty
Jonathan Druart [Mon, 17 Jan 2022 14:01:56 +0000 (15:01 +0100)]
Bug 29895: Fix 'add multiple items' button on neworderempty

Button [Add multiple items] stops responding when it's pressed and some multiple items added to basket

It has a "visibility: hidden" we are trying to remove setting "display:
inline"

This is pretty ugly and certainly does not clean the code, but it's too
messy and this patch fixes the problem easily.

Test plan:
Add a new order
Click "Add multiple items", enter "2", click "Add".
Confirm that you can use the "Add multiple items" again.

Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
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>
(cherry picked from commit 0911987be88ae700a096e812eb51a089f673ed00)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29809: Fix StockRotationStages.t
Jonathan Druart [Thu, 27 Jan 2022 16:13:32 +0000 (17:13 +0100)]
Bug 29809: Fix StockRotationStages.t

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29809: (follow-up) Update tests and rename variable
Nick Clemens [Tue, 18 Jan 2022 11:55:59 +0000 (11:55 +0000)]
Bug 29809: (follow-up) Update tests and rename variable

Signed-off-by: Nick Clemens <nick@bywatersolutions.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>
(cherry picked from commit c52ce558d01fb1f526074dd3e47f0a990b5a19b7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29809: Update stockration tool to reflect method name change
Martin Renvoize [Thu, 6 Jan 2022 13:58:26 +0000 (13:58 +0000)]
Bug 29809: Update stockration tool to reflect method name change

Signed-off-by: Nick Clemens <nick@bywatersolutions.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>
(cherry picked from commit 3b3ae941c74ddffd4c7238b13c57f4d975bd600c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29809: Rename item relation accessor from itemnumber
Martin Renvoize [Thu, 6 Jan 2022 13:49:37 +0000 (13:49 +0000)]
Bug 29809: Rename item relation accessor from itemnumber

This patch renames the item relation accessor method in
StockRotationItem to 'item' from 'itemnumber' to more clearly reflect
that the method returns a Koha::Item object and not an itemnumber.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a33afd47c11b96e9f13b6d83ca641883c9c70adc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29862: Add missing txn begin/rollback in TestBuilder.t
Jonathan Druart [Mon, 17 Jan 2022 10:40:00 +0000 (11:40 +0100)]
Bug 29862: Add missing txn begin/rollback in TestBuilder.t

It fixes the tests when SearchEngine=ES
 t/db_dependent/TestBuilder.t .. 7/15 Invalid MARC field expression: l5ffglZ_upqqcwOvaiyALgXfyJw2Ot2AGRPUsiAPzSFHfd8J_hsnuQ8z75B8RKc_kyo2rFBp8BrPNwcM1FPhc01ngP01HU_Z7Rx1VHfcIcmrifYnjBDWNmYB9N5_4xEnxMH7ZhqC9b2Bz9wf9
 wSEmx64x6t5xFFKX at /kohadevbox/koha/C4/Biblio.pm line 306.
     # Looks like you planned 12 tests but ran 6.

 #   Failed test 'Tests for delete method'
 #   at t/db_dependent/TestBuilder.t line 302.
 Can't call method "biblionumber" on an undefined value at t/db_dependent/TestBuilder.t line 281.
 # Looks like your test exited with 11 just after 8.

Previous subtest created invalid date in the ES mappings.

Test plan:
Set SearchEngine=ES and run the tests, they must pass.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29043: Don't fetch items if when are not on the 'Place a hold on' form
Jonathan Druart [Mon, 17 Jan 2022 14:18:13 +0000 (15:18 +0100)]
Bug 29043: Don't fetch items if when are not on the 'Place a hold on' form

Signed-off-by: Nick Clemens <nick@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>
(cherry picked from commit 9feb4180590ca29551a1e6f136bbef255edac658)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29043: Don't fetch biblios info unless a patron is picked
Jonathan Druart [Fri, 14 Jan 2022 16:15:31 +0000 (17:15 +0100)]
Bug 29043: Don't fetch biblios info unless a patron is picked

If we haven't picked a patron or a club yet we don't need to fetch
biblios, items and holdability infos

Signed-off-by: Nick Clemens <nick@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>
(cherry picked from commit 12666fe233493c7235efbfa5a20f488a0ffa2e8d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29511: Sort hash keys
Nick Clemens [Tue, 23 Nov 2021 13:39:57 +0000 (13:39 +0000)]
Bug 29511: Sort hash keys

This code exists in authorities/authorities.pl and the hash keys are sorted
I just do the same here

To test:
1 - Find/create a record with 245a 245h populated
2 - Load/reload the record several times and note that fields c and b are ordered randomly
3 - Apply patch
4 - Reload and note c and b are ordered alphabetically
5 - Move subfield h before subfield c
6 - Save and reload
7 - Confirm that existing/filled fields retain order in the MARC record

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
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>
(cherry picked from commit d5db394e65c0c16d924a195bf68abefc2375a1a4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 21652: Simplify code
Jonathan Druart [Thu, 20 Jan 2022 10:20:49 +0000 (11:20 +0100)]
Bug 21652: Simplify code

And add a test.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 21652: Only set waitingdate to today if there is no waitingdate already
Lucas Gass [Thu, 6 Jan 2022 15:16:05 +0000 (15:16 +0000)]
Bug 21652: Only set waitingdate to today if there is no waitingdate already

1- Find or create a hold with a waitingdate other than today
2- Check the item in to generate a new hold alert
3- Select "Confirm and Print"
4- Verify that the waiting date has changed to the current date
5- Apply patch
6- Try 1-3 again, if a waitingdate already exists it should not change
7. Try an item with no waitingdate, it should properly update to today

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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>
(cherry picked from commit 1de5464ededf2f8c55c7f94e1c53df3656cef153)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 21652: Unit test
Nick Clemens [Fri, 14 Jan 2022 14:17:02 +0000 (14:17 +0000)]
Bug 21652: Unit test

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29320: Update OverDrive availability to V2
Nick Clemens [Tue, 26 Oct 2021 11:22:04 +0000 (11:22 +0000)]
Bug 29320: Update OverDrive availability to V2

This patch updates the call to overdrive_proxy to allow passing a version
and updates the code to use V2 for availability

To test:
1 - Enable OverDrive integration by setting the sysprefs
2 - Log in to your overdrive account in the Koha opac
3 - Perform a search and note availability display
4 - Confirm you can checkout/hold/return books
5 - Apply patch
6 - Repeat search and test functionality
7 - Note that title with '0 out of 0 copies available' now say 'Currently unavailable'

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29686: Adapt Koha to use new fulfillment API for OverDrive
Nick Clemens [Mon, 13 Dec 2021 13:08:28 +0000 (13:08 +0000)]
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive

This patch modifies the checkout_download_url routine in
WebSerivce::ILS::OverDrive::Patron

We now directly hit the fulfillment endpoint with redirects disabled
and fetch the URL

The overdrive.js is modified to use a single 'Get item' button for all
checked out items and to refer to the fulfillment page

To test:
1 - Enable all OverDrive system preferences
2 - Search on opac and confirm OD results returned
3 - Checkout an item
4 - Confirm you have the new 'Get item' button on 'OverDrive account'
    tab on opac-user.pl
5 - Confirm the 'Get item' button works

NOTE:
Most items will also show the 'Get item' button in results, however,
magazines may not as each checkout has a unique 'reserve id' and the
'parent' id is not checked in our current code

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 09a51041cdd241a78abf88321daac14e54af6f01)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29722: (QA follow-up) Replace unusual single quote
Fridolin Somers [Sat, 22 Jan 2022 06:45:27 +0000 (20:45 -1000)]
Bug 29722: (QA follow-up) Replace unusual single quote

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a4c5a166918483c22686fc2ed4677b61e44bb7b6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29722: Add more sample quotes
Aleisha Amohia [Fri, 17 Dec 2021 02:48:42 +0000 (02:48 +0000)]
Bug 29722: Add more sample quotes

This patch adds sample quotes from women, women of colour, trans women,
Black and Indigenous women, and people who weren't US Presidents!

To test:
1. Install a fresh Koha and import sample quotes
2. Go to Tools -> Quote editor
3. Confirm the quotes show

Sponsored-by: Catalyst IT
Signed-off-by: Lucas Gass <lucas@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>
(cherry picked from commit 97692b4bba77597f15c59bdc19fd49663388fdaf)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29054: Add verbose check for warn in advance_notices.pl
Hayley Pelham [Mon, 20 Sep 2021 04:23:11 +0000 (04:23 +0000)]
Bug 29054: Add verbose check for warn in advance_notices.pl

To test:
1) Set EnhancedMessagingPreferences to Don't allow
2) In the koha-shell, run misc/cronjobs/advance_notices.pl -c
3) Note that you see the warning "The "EnhancedMessagingPreferences"
syspref is off... etc."
4) Apply the patch and restart services
5) In the koha-shell, run misc/cronjobs/advance_notices.pl -c and note
the warning no longer shows
6) Still in the shell, run misc/cronjobs/advance_notices.pl -c -v and
note the warning does show

Sponsored-by: Catalyst IT
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit f15c9462e30ce3b813a63bd395bc2f74ab9c309b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29156: File missing warning in Koha::UploadedFile for permanent files only
Fridolin Somers [Fri, 1 Oct 2021 23:06:57 +0000 (13:06 -1000)]
Bug 29156: File missing warning in Koha::UploadedFile for permanent files only

When an uploaded file is deleted, when file does not exist there is a warning :
"Removing record for file.txt within category koha_upload, but file was missing."

For temporary files, this warning is noisy.
For example when they are in /tmp, system reboot deleted them.

I propose to remove this warning for temporary files.

Test plan :
1) Upload a temporary and a permanent file via Tools > Upload
2) Delete the file on server
3) Delete the two files from Tools > Upload
4) Look at warning in log files
=> You see only warning for permanent file

Signed-off-by: David Nind <david@davidnind.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>
(cherry picked from commit 874ad0729e15cb264a9222fbc01464eefca9ee1c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 30045: (bug 29543 follow-up) Fix SCO print slip
Jonathan Druart [Tue, 8 Feb 2022 11:12:22 +0000 (12:12 +0100)]
Bug 30045: (bug 29543 follow-up) Fix SCO print slip

Certainly since bug 29543 and bug 29914.

We should do the same authentication check than sco-main.pl, and also
make sure to generate the checkout history only for the logged in patron
(the OPAC one, not staff member)

Test plan:
Use the different combinations of the SCO config (AutoSelfCheckAllowed,
SelfCheckoutByLogin and WebBasedSelfCheck) and confirm that this patch
fixes the SCO print slip feature.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28271: Add (current status)
Jonathan Druart [Thu, 17 Jun 2021 08:26:20 +0000 (10:26 +0200)]
Bug 28271: Add (current status)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a0813c97c56cc828b6d3e99e77e6c879c05ca253)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28271: Preselect the current item lost value
Jonathan Druart [Mon, 3 May 2021 14:04:16 +0000 (16:04 +0200)]
Bug 28271: Preselect the current item lost value

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f93d28e8c6fec635eba2281b4490d47c0fc54018)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28271: Adjust API spec
Jonathan Druart [Fri, 30 Apr 2021 13:21:46 +0000 (15:21 +0200)]
Bug 28271: Adjust API spec

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e775c1b66830ff251774b5645eb8d46f5b6b85b4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28271: Add the ability to set a new lost status when a claim is resolved
Jonathan Druart [Fri, 30 Apr 2021 13:13:26 +0000 (15:13 +0200)]
Bug 28271: Add the ability to set a new lost status when a claim is resolved

When a claim is resolved the librarian should be able to edit the lost
status of the item.

It is also letting a way out when BlockReturnOfLostItems is set (the
lost status is stuck on ClaimReturnedLostValue as we remove the
option to edit itemlost on the item edit form).

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 58db137c0aeda1f0a1d5f1972f1f415c31be62ed)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 27296: Compiled CSS
Andrew Fuerste-Henry [Thu, 17 Feb 2022 20:20:22 +0000 (20:20 +0000)]
Bug 27296: Compiled CSS

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 27296: Return claims should be filtered by default to show unresolved claims
Owen Leonard [Mon, 9 Nov 2020 19:36:22 +0000 (19:36 +0000)]
Bug 27296: Return claims should be filtered by default to show unresolved claims

This patch modifies the DataTables configuration of the return claims
table on the checkout and patron detail pages. Using the footerCallback
function, the count of resolved and unresolved claims is calculated and
used to filter the list of claims to show only unresolved claims by
default.

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

- If necessary, Enable claims returned functionality by defining a value
  in the ClaimReturnedLostValue system preference.
- Open for checkout a patron who has items checked out.
- From the table of checkouts, click "Claim returned" for one or more
  items.
  - As you mark items "Clamed returned," the the items should appear
    under the "Claims" tab. The corresonding filter links should be
    updated accordingly, "Show all X claims."
  - Mark one or more claims resolved. As you do so they should disappear
    from the list of claims. The filter links should be updated to
    reflect that there are some resolved and some unresolved claims.
  - Clicking each filter link should trigger the correct filter.
  - Test this process when the count of unresolved claims is zero and
    when the cound of resolved claims is zero.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

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

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/checkouts.js for
  translation, e.g.:

  #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:1086
  msgid "Show 1 claim"
  msgid_plural "Show all {count} claims"
  msgstr[0] ""
  msgstr[1] ""

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

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client and
  repeat the test plan above. The translated strings should appear.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29495: DBRev 21.05.10.002
Andrew Fuerste-Henry [Thu, 17 Feb 2022 19:58:32 +0000 (19:58 +0000)]
Bug 29495: DBRev 21.05.10.002

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29495: Fix TestBuilder.t
Jonathan Druart [Tue, 18 Jan 2022 15:01:00 +0000 (16:01 +0100)]
Bug 29495: Fix TestBuilder.t

Value not allowed for auto_incr issue_id in Issue at /kohadevbox/koha/t/lib/TestBuilder.pm line 387.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29495: Update relationship methods
Martin Renvoize [Thu, 18 Nov 2021 07:43:44 +0000 (07:43 +0000)]
Bug 29495: Update relationship methods

This patch updates the relationship methods found in
Koha::Checkouts::ReturnClaim so that they are prefetchable and embeddable on
the API.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29495: Add code level constraint replacement
Martin Renvoize [Wed, 17 Nov 2021 10:27:38 +0000 (10:27 +0000)]
Bug 29495: Add code level constraint replacement

This patch adds a check in Koha::Checkouts::ReturnClaim::store to
replace the database level foreign key check.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29495: Add DBIC relationships back into Schema
Martin Renvoize [Wed, 17 Nov 2021 10:10:18 +0000 (10:10 +0000)]
Bug 29495: Add DBIC relationships back into Schema

This patch adds the relationship accessors back into the affected Schema
classes, now below the fold so they are retained during dbic rebuilds.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29495: DBIC Schema Rebuild
Martin Renvoize [Wed, 17 Nov 2021 10:01:47 +0000 (10:01 +0000)]
Bug 29495: DBIC Schema Rebuild

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29495: Drop issue_id constraint from return_claims
Martin Renvoize [Wed, 17 Nov 2021 09:56:48 +0000 (09:56 +0000)]
Bug 29495: Drop issue_id constraint from return_claims

This patch removes the issue_id constraint from return_claims.

Due to the nature of our dual table approach to checkouts/old_checkouts
we can't safely hae this constraint and not lose data.  Prior to this
commit, when an item is checked in we move the checkout from checkouts
to old_checkouts.. this therefore triggers the delete of the issue_id
from the return_claims table as described by the foreign key constraint.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29495: Unit Tests
Martin Renvoize [Mon, 22 Nov 2021 16:30:13 +0000 (16:30 +0000)]
Bug 29495: Unit Tests

Test plan
1. Run updated tests prior to applying new patches.. pass
2. Run updated tests after applying new patches.. pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29570: Simplify for loop
Jonathan Druart [Tue, 8 Feb 2022 16:35:27 +0000 (17:35 +0100)]
Bug 29570: Simplify for loop

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit dbf8c63cdd3eccc0490e014f46fe9d21646cca67)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29570: Enable sorting orders by summary
Tomas Cohen Arazi [Wed, 2 Feb 2022 20:10:36 +0000 (17:10 -0300)]
Bug 29570: Enable sorting orders by summary

This patch enables (on receiving) sorting orders by the summary column.
It needs the previous patches to work. Title is given more precedence as
expressed by users on the bug report. Which, by the way, makes sense.

To test:
1. Create a basket
2. Create orders
3. Close basket
4. Receive shipment
5. Enter invoice information
=> SUCCESS: You should see your pending orders
=> FAIL: Verify the 'Summary' column is not sortable
7. Apply this patches
8. Restart Plack
9. Reload the page
=> SUCCESS: Can sort by the summary column
10. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 69bd39f9ca492fa6db0ca056d2f15458eb5b2f1d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29570: Fix sorting orders by biblioitems columns
Tomas Cohen Arazi [Wed, 2 Feb 2022 20:04:08 +0000 (17:04 -0300)]
Bug 29570: Fix sorting orders by biblioitems columns

The API representation of Koha::Biblio objects includes the
biblioitems.* columns too. This proved problematic as queries had to get
translated so they work (i.e. if a query passes q={"biblio.ean":"123%"}
then the query needs to be tweaked so biblio.ean is translated into
biblio.biblioitem.ean. This is solved, locally, in the controller.

But sorting needs the same kind of tweak, and it was missing. This patch
solves that by doing a similar conversion.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> FAIL: Tests fail, searching on a 'biblioitems' column generates a 500
error.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! We can sort on those fields
5. Sign off :-D

Note: you will notice the tests only cover sorting by ISBN. I consider
it enough as sorting is a DB problem, and we only want to know if the
generated ORDER BY is valid for the underlying query, and MySQL would
complain if it wasn't the case.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d3dc05279cb5c3a38428aaf83d8645d38d2fe180)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29570: Regression tests
Tomas Cohen Arazi [Wed, 2 Feb 2022 19:29:00 +0000 (16:29 -0300)]
Bug 29570: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8c269f09a840595c6312bb76c79605b4f520779f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29840: Deal with non-existing biblionumber in opac-reserve
Jonathan Druart [Mon, 10 Jan 2022 13:02:49 +0000 (14:02 +0100)]
Bug 29840: Deal with non-existing biblionumber in opac-reserve

We should not explode if the biblionumber passed in not in DB.

Test plan:
Hit /cgi-bin/koha/opac-reserve.pl?biblionumber=42424
and notice the error message.

Without this patch you got
Can't call method "holds" on an undefined value at
/kohadevbox/koha/opac/opac-reserve.pl line 172

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29838: Fix string interpolation in ImportBatch.t
Jonathan Druart [Mon, 10 Jan 2022 10:34:27 +0000 (11:34 +0100)]
Bug 29838: Fix string interpolation in ImportBatch.t

Test plan:
Tests should return green

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29646: (RM follow-up) Add space before colon
Fridolin Somers [Sat, 22 Jan 2022 00:58:42 +0000 (14:58 -1000)]
Bug 29646: (RM follow-up) Add space before colon

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 9eedc98d5579ea48282fd02b140b8e9f9e374748)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29646: Fix undefined category crash in opac-password-recovery
Marcel de Rooy [Mon, 6 Dec 2021 08:31:48 +0000 (08:31 +0000)]
Bug 29646: Fix undefined category crash in opac-password-recovery

The crash is a result of a not found borrower. This is typically
a bad or repeated recovery attempt.

Test plan:
Do a password recovery.
Use the mailed URL twice.
Without this patch, the second attempt crashes.
With this patch, the second attempt shows an error dialog.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0c3cede046dd8cf68e238eb79aca3eea0925033a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 11750: (QA follow-up) Remove unconditional warn
Katrin Fischer [Sat, 8 Jan 2022 23:05:00 +0000 (23:05 +0000)]
Bug 11750: (QA follow-up) Remove unconditional warn

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit aaa966c96de807386f99d6598c2cbe5dcb8bdd0f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 11750: Hide patron's attributes on overdue list if needed
Jonathan Druart [Thu, 19 Aug 2021 12:01:17 +0000 (14:01 +0200)]
Bug 11750: Hide patron's attributes on overdue list if needed

If a patron's attributes is limited to some libraries, we must apply
this limit on the overdue list view.

Test plan:
1. Create the following patron attributes:
A that is not searchable
B is searchable and does not have library limitation
C is searchable and is limited to another library than yours
2. On the right part of the overdue list view you must see B only
Without this patch C is displayed as well.

Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 278b8b2d9783b5c0cf99ce5397fbd760e354c107)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29764: Fix incorrect EmbedItems RecordProcessor filter POD
Tomas Cohen Arazi [Thu, 23 Dec 2021 11:41:33 +0000 (08:41 -0300)]
Bug 29764: Fix incorrect EmbedItems RecordProcessor filter POD

This patch makes the usage POD for the EmbedItems filter actually be
usable. The filter is used in opac-ISBDdetail.pl and the POD is updated
to how it is used there.

Not much to test.

Signed-off-by: David Cook <dcook@prosentient.com.au>
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>
(cherry picked from commit 47c01f0b8a181a2d6f31478d08d9a3ee728e7fe4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29806: (follow-up) Call ->as_list for ->pickup_locations on request.pl
Jonathan Druart [Fri, 7 Jan 2022 14:54:16 +0000 (15:54 +0100)]
Bug 29806: (follow-up) Call ->as_list for ->pickup_locations on request.pl

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29806: Fix POST /holds use of pickup_locations
Tomas Cohen Arazi [Thu, 6 Jan 2022 12:27:45 +0000 (09:27 -0300)]
Bug 29806: Fix POST /holds use of pickup_locations

This patch makes Koha::Item->pickup_locations and
Koha::Biblio->pickup_locations explicitly call ->as_list in list
context. This way we workaround bug 28871.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, the route gives a 500 (unhandled exception)
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass, the route correctly returns a 400 with a
message about the pickup location being invalid
5. Sign off :-D

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29806: Call ->as_list for ->pickup_locations on request.pl
Tomas Cohen Arazi [Thu, 6 Jan 2022 12:22:05 +0000 (09:22 -0300)]
Bug 29806: Call ->as_list for ->pickup_locations on request.pl

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29806: Regression tests
Tomas Cohen Arazi [Thu, 6 Jan 2022 12:27:28 +0000 (09:27 -0300)]
Bug 29806: Regression tests

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29807: Make Branches plugin handle empty pickup locations list
Tomas Cohen Arazi [Thu, 6 Jan 2022 11:53:30 +0000 (08:53 -0300)]
Bug 29807: Make Branches plugin handle empty pickup locations list

This patch makes the plugin handle empty Koha::Biblio->pickup_locations
and Koha::Item->pickup_locations correctly.

It does so by explicitly calling ->as_list. It also restores the logic
that was changed by 6cd1ffab4e491349c99769018a7df33dc8a8aabf so, now
that ->empty is handled correctly, it doesn't return ALL the pickup
locations when the item/biblio doesn't have valid pickup locations.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Template/Plugin/Branches.t
=> FAIL: Awful error
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29807: Regression tests
Tomas Cohen Arazi [Thu, 6 Jan 2022 11:53:01 +0000 (08:53 -0300)]
Bug 29807: Regression tests

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 18320: Remove patroncards/edit-layout.pl warnings
Tomas Cohen Arazi [Thu, 23 Mar 2017 12:51:09 +0000 (09:51 -0300)]
Bug 18320: Remove patroncards/edit-layout.pl warnings

This patch removes warnings generated by the script itself.

To test:
- Go to Tools › Patron card creator › Manage layouts and
        Tools › Patron card creator › New layout
- Add a new layout, adit existing.
=> FAIL: Warnings logged by edit-layout.pl
- Apply this patch
- Go to Tools › Patron card creator › Manage layouts and
        Tools › Patron card creator › New layout
- Add a new layout, adit existing.
=> SUCCESS: No warnings generated by edit-layout.pl
- Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b2a7b8f310fe617b8e19d3bfe14c440df8258d98)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29336: Update DBIC
Andrew Fuerste-Henry [Wed, 16 Feb 2022 16:58:51 +0000 (16:58 +0000)]
Bug 29336: Update DBIC

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29336: DBRev 21.05.10.001
Andrew Fuerste-Henry [Wed, 16 Feb 2022 16:50:09 +0000 (16:50 +0000)]
Bug 29336: DBRev 21.05.10.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29336: Database revision
Marcel de Rooy [Thu, 28 Oct 2021 12:11:07 +0000 (12:11 +0000)]
Bug 29336: Database revision

Resizes the six fields identified earlier:

additional_fields.authorised_value_category 16=>32
auth_subfield_structure.authorised_value 10=>32
auth_tag_structure.authorised_value 10=>32
club_template_enrollment_fields.authorised_value_category 16=>32
club_template_fields.authorised_value_category 16=>32
marc_tag_structure.authorised_value 10=>32

Test plan:
Run dbrev, check database.
Bonus: Connect an AV category with a long name to a authority subfield.
Check if you see its values in the authority editor.
(This was the way I found the problem.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
(cherry picked from commit 2652f299987879c6a71d65bcaaf1a5101008ddfb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29336: Remove TODOs
Jonathan Druart [Fri, 7 Jan 2022 15:04:28 +0000 (16:04 +0100)]
Bug 29336: Remove TODOs

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29336: Identify the fields with wrong length (or name) first
Marcel de Rooy [Thu, 28 Oct 2021 11:45:39 +0000 (11:45 +0000)]
Bug 29336: Identify the fields with wrong length (or name) first

This report will fix the bad lengths first.
And mark the 'bad' names with a TODO for follow-up.
Bad name means: refers to value, should be category.
Scanning kohastructure.sql.

Note: Bug 29347 has been opened to fix the names.

Test plan:
Search for another AV category field with length<>32.
Bonus: Reinstall and check database.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
(cherry picked from commit e9f0123b6d5a4bf705ac6bf0971ae053a8ef81de)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28832: (QA follow-up) Tiny comment spelling fix
Martin Renvoize [Mon, 31 Jan 2022 10:20:57 +0000 (10:20 +0000)]
Bug 28832: (QA follow-up) Tiny comment spelling fix

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28832: (follow-up) Don't remove false values, only empty strings
Nick Clemens [Wed, 24 Nov 2021 16:05:23 +0000 (16:05 +0000)]
Bug 28832: (follow-up) Don't remove false values, only empty strings

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28832: (follow-up) Handle regex fields too
Nick Clemens [Mon, 20 Sep 2021 17:22:46 +0000 (17:22 +0000)]
Bug 28832: (follow-up) Handle regex fields too

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 28832: Don't batch modify fields that we don't update
Nick Clemens [Mon, 9 Aug 2021 16:28:16 +0000 (16:28 +0000)]
Bug 28832: Don't batch modify fields that we don't update

In bug 27837 we made sure to always pass through the permanent_location if it was passed in unlike
other fields which are not passed if they have no value.
During batch mod, however, fields that aren't editied have no value, so forcing permanent_location
to pass through forces blanking it.

This patch alters the script to only pass thgouhr for edit the fields that have been updated or
cleared.

To test:
 1 - In frameworks add a new subfield to 952, "C" - make it editable in items tab and visible in intranet/editor
 2 - In mappings map that subfield to items.permanent_location
 3 - Set an item to have differing shelving location and permanent_location
 4 - This saves correctly for an individual item
 5 - Edit the item using Tools->batch item modification, updating the note field
 6 - Note the permanet_location is removed
 7 - Check the DB, the field is set to NULL
 8 - Apply patch
 9 - Repeat
10 - Permanent location is not cleared
11 - Verify that clearing fields works as before, including permanent_location

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Deb Stephenson <dstephen@dubuque.lib.ia.us>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29758: Get rid of warning in members/boraccount.pl
Tomas Cohen Arazi [Thu, 23 Dec 2021 18:51:52 +0000 (15:51 -0300)]
Bug 29758: Get rid of warning in members/boraccount.pl

This patch removes a noisy warning found in production logs.

To test:
1. Run:
   $ tail -f /var/log/koha/kohadev/plack-intranet-error.log
2. Open the 'Accounting' tab for a patron, then click on 'Transactions'
=> FAIL: You see this kind of warning in the logs:

[WARN] CGI::param called in list context from...
3. Apply this patch
4. Repeat 2 (change tab and go back)
=> SUCCESS: No more warning!
5. Sign off :-D

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 18540: (QA follow-up) Only mention index_sort_title if defined
Tomas Cohen Arazi [Fri, 7 Jan 2022 13:44:30 +0000 (10:44 -0300)]
Bug 18540: (QA follow-up) Only mention index_sort_title if defined

This patch makes the generated xslt not mention index_sort_title unless
the entry is defined on the xml file. Otherwise there's a call to

<xslo:apply-templates mode="index_sort_title"/>

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 18540: Handle indexing sort title only when needed
Nick Clemens [Thu, 13 May 2021 16:34:38 +0000 (16:34 +0000)]
Bug 18540: Handle indexing sort title only when needed

This patch moves the code that generates the xsl for MARC21 biblio sorting
to it's own template that is only called when specified in the xml

To test:
 1 - xsltproc etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml > etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl
 2 - git diff
 3 - Note that authority-zebra-indexdefs.xsl now has 245 Title:s info
 4 - Apply patch
 5 - xsltproc etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml > etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl
 6 - git diff
 7 - There are lines added about title sort, but no 245 block
 8 - xsltproc etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml > etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
 9 - git diff
10 - Note lines changes to ...title_sort
11 - 245 block does not change

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
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>
(cherry picked from commit be8f0d8d3f44bb54ccea7fc7d7ef3ed1a2228b04)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29812: Add missing use C4::Context in Koha::Token
Jonathan Druart [Fri, 7 Jan 2022 10:29:47 +0000 (11:29 +0100)]
Bug 29812: Add missing use C4::Context in Koha::Token

Caused by bug 18124.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29884: Run missing test in api/v1/patrons.t
Jonathan Druart [Fri, 14 Jan 2022 14:17:56 +0000 (15:17 +0100)]
Bug 29884: Run missing test in api/v1/patrons.t

compare is not calling is() or ok(), it's caller job to do it.

Test plan:
  prove t/db_dependent/api/v1/patrons.t
should still return green

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2 years agoBug 29808: Do not receive transfer for checked out items
Nick Clemens [Thu, 6 Jan 2022 12:38:05 +0000 (12:38 +0000)]
Bug 29808: Do not receive transfer for checked out items

This patch adds a check to StockRotationItem->advance to check if an
item is checked out from the destination branch. If so, we do not receive the transfer

To test:
 1 - Enable StockRotation system preference
 2 - Browse to Tools->Stock rotation->New Rota and create a new rota, set as cyclical
 3 - Manage->stages and add two stages, each with 0 day duration
 4 - Manage->items - add an item
 5 - Checkout the item from the first branch of rotation
 6 - Tools->Stock rotation->Manage->items->move to next stage
 7 - Error:
    [Transfer item is currently checked out] at /usr/share/perl5/Exception/Class/Base.pm line 88
 8 - Check in the item at first branch
 9 - Checkout the item from the second stage branch
10 - Apply patch
11 - Tools->Stock rotation->Manage->items->move to next stage
12 - No error!
13 - Check in item at second branch
14 - Checkout from first branch
15 - Tools->Stock rotation->Manage->items->move to next stage
16 - Still no error!

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

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