koha.git
4 years agoBug 23944: (follow-up) Update circulation to use new library
Owen Leonard [Fri, 1 Nov 2019 13:18:28 +0000 (13:18 +0000)]
Bug 23944: (follow-up) Update circulation to use new library

This patch updates the circulation page to use the new JavaScript Cookie
library for cookie management.

To test, apply the patch and open a patron record for checkout in the
staff client.

 - Click "Search to hold" in the toolbar and perform a catalog search
   which will return results.
 - On the search results page, the toolbar at the top of the results
   should include a split "Place hold" button. The button's menu should
   include "Place hold for <patron>" and "Forget <patron>" options. Test
   that these work correctly.
 - In the table of search results each title should include a "Place
   hold for <patron>" link.
 - Go to the checkouts page for a patron with one or more checked-out
   items.
   - Check the "Always show checkouts immediately" checkbox.
   - The patron's checkouts should load.
   - Open another patron for checkout who has checked-out items.
   - The table of checkouts should load automatically.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23944: Phase out use of jquery.cookie.js in favor of js.cookie.js
Owen Leonard [Fri, 1 Nov 2019 13:00:03 +0000 (13:00 +0000)]
Bug 23944: Phase out use of jquery.cookie.js in favor of js.cookie.js

This patch adds a new JavaScript file to the staff client's global
JavaScript include file: js.cookie-2.2.1.min.js. This "plugin" will
replace jquery.cookie.js which is no longer maintained.

The "About" page in the staff client is updated to include this new
resource as well as adding previously-missing information about the old
plugin which will remain until all instances of its usage have been
removed.

To test, apply the patch and check the About page to confirm the correct
information is included.

No functionality change is introduced by this bug. The only other
observable change is the existence of the new files and the inclusion of
the minified version of the file in any staff client page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: (follow-up) Remove previous declaration of batch_biblionumbers
Jonathan Druart [Wed, 29 Jan 2020 10:13:45 +0000 (11:13 +0100)]
Bug 24305: (follow-up) Remove previous declaration of batch_biblionumbers

Revert change for cardnumbers, they are not always numbers.
We may need to add a regex to remove special chars however, will be done
on its own bug report if needed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24348: Pass marc record to _passes_required_checks
Andreas Jonsson [Sun, 5 Jan 2020 13:02:13 +0000 (13:02 +0000)]
Bug 24348: Pass marc record to _passes_required_checks

Test plan:

* Add record matching rule:

 Matching rule code: test
 Description: 001 and 003
 Match threshold: 1000
 Record type: Bibliografic record

 Match points:
    Search index: Control-number
    Score: 1000
    Tag: 001
    Subfields:
    Offset:
    Length:
    Normalization rule: none

 Required match checks:

    Source (incoming) record check field

    Tag: 003
    Subfields:
    Offset:
    Length:
    Normalization rule: none

    Target (database) record check field

    Tag: 003
    Subfields:
    Offset:
    Length:
    Normalization rule: none

* Note the match rule identity number.
* Stage a marc-file for import, for instance this one ftp://ftp.libris.kb.se/pub/export2/X/marc/X.20200104.marc

sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/stage_file.pl --match 4 --file 'X.20200104.marc' --format ISO2709 --comment 'test'" kohadev

* Note the batch number and commit the file using the batch number:

sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/commit_file.pl --batch-number 1" kohadev

* Again, stage the same marc-file  for import:

sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/stage_file.pl --match 4 --file 'X.20200104.marc' --format ISO2709 --comment 'test'" kohadev

* Note the number of records matched.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23113: members/pay.tt account_grp is not longer used
Owen Leonard [Tue, 7 Jan 2020 12:33:02 +0000 (12:33 +0000)]
Bug 23113: members/pay.tt account_grp is not longer used

This patch removes obsolete markup from pay.tt.

To test, apply the patch and search the Koha codebase for instances of
"account_grp" There should be none.

Log in to the staff client and go to the account of a patron who has
fines. Confirm that the "Accounting" page ("Make a payment" tab) works
correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24486: Remove duplicated account information at the OPAC
Nick Clemens [Mon, 27 Jan 2020 11:48:31 +0000 (11:48 +0000)]
Bug 24486: Remove duplicated account information at the OPAC

Test plan:
Create a manual invoice
Pay it
Void it

Go to the opac, account
=> You should see only one "(Voided)"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24497: Turn off smartIndent for SQL
Lucas Gass [Fri, 24 Jan 2020 18:18:33 +0000 (18:18 +0000)]
Bug 24497: Turn off smartIndent for SQL

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24511: Update variable names to avoid confusion
Nick Clemens [Fri, 24 Jan 2020 14:58:25 +0000 (14:58 +0000)]
Bug 24511: Update variable names to avoid confusion

To test:
1 - Create a report
    SELECT borrowernumber, firstname, surname, email, emailpro FROM borrowers WHERE surname='acosta'
2 - Create or edit patron with surname acosta to have a separate email and emailpro
3 - perl misc/cronjobs/patron_emailer --notice HOLDS --module reserves --verbose --email emailpro --report ## --from 'me@you.us'
4 - Note email is used, not email pro
5 - Apply patch
6 - Repeat, correct eamil is used

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24515: Column Configuration for pay-fines-table does not hide Account Type properly
Owen Leonard [Fri, 24 Jan 2020 23:25:20 +0000 (23:25 +0000)]
Bug 24515: Column Configuration for pay-fines-table does not hide Account Type properly

This patch corrects the order of the columns in the columns
configuration YML file. The incorrect order was causing the wrong column
to be hidden when changing the columns settings for the table in
Administration.

To test, apply the patch and go to Administration -> Columns settings.

 - Under Patrons -> pay-fines-table, test hiding the account_type and
   description columns, together and separately.
 - Verify that the correct columns are hidden on the pay fines screen
   (Patron -> Accounting -> Make a payment)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24507: Make Checkouts/ReturnClaim.t pass on MySQL 8
Jonathan Druart [Fri, 24 Jan 2020 10:13:53 +0000 (11:13 +0100)]
Bug 24507: Make Checkouts/ReturnClaim.t pass on MySQL 8

 $ prove t/db_dependent/Koha/Checkouts/ReturnClaim.t
 t/db_dependent/Koha/Checkouts/ReturnClaim.t ..
     #   Failed test 'Exception field is correct'
     #   at t/db_dependent/Koha/Checkouts/ReturnClaim.t line 97.
     #          got: 'return_claims.issue_id'
     #     expected: 'issue_id'
     # Looks like you failed 1 test of 8.
 t/db_dependent/Koha/Checkouts/ReturnClaim.t .. 1/1
 #   Failed test 'store() tests'
 #   at t/db_dependent/Koha/Checkouts/ReturnClaim.t line 133.

This is similar to bug 23825.

Test plan:
Confirm that the tests pass on MySQL8 and MariaDB

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: (QA follow-up) Strip table name in [[table.field|alias]]
Marcel de Rooy [Fri, 24 Jan 2020 11:17:15 +0000 (11:17 +0000)]
Bug 24305: (QA follow-up) Strip table name in [[table.field|alias]]

When you would use the construct, you wont have batch features unless
we strip the table name. This is consistent with the $sth->{NAME} used
to fill the headers by default.

Test plan:
Use [[items.biblionumber|bibno]] instead of items.biblionumber in a
reporting query.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: (follow-up) Add small comment for square brackets in get_prepped_report
Marcel de Rooy [Fri, 24 Jan 2020 11:04:05 +0000 (11:04 +0000)]
Bug 24305: (follow-up) Add small comment for square brackets in get_prepped_report

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: Remove previous declaration of batch_biblionumbers
Jonathan Druart [Mon, 13 Jan 2020 11:15:33 +0000 (12:15 +0100)]
Bug 24305: Remove previous declaration of batch_biblionumbers

We should not init batch_biblionumbers before.
Also this patch deals with batch_cardnumbers.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24305: Fix links to batch tools when report's columns do not contain integers
Jonathan Druart [Thu, 26 Dec 2019 10:11:55 +0000 (11:11 +0100)]
Bug 24305: Fix links to batch tools when report's columns do not contain integers

If report's columns do not only contain integers, we should not point to
batch tools.
For instance, if the value is a link, the batch tools will not work as
they will not retrieve the id (itemnnumber or biblionumber) properly

Test plan:
Create a report like:
    SELECT CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is not link to the batch tools

Edit the report like:
    SELECT itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is a link to the batch tools

Edit the report like

    SELECT itemnumber, CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is link to the batch tools

Try other combinations with biblionumber.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24503: fix missing use in value builder barcode_manual.pl
Fridolin Somers [Fri, 24 Jan 2020 08:20:06 +0000 (09:20 +0100)]
Bug 24503: fix missing use in value builder barcode_manual.pl

Bug 22721 added use C4::Biblio in cataloguing/value_builder/barcode.pl.
This is missing in value builder barcode_manual.pl.
You get the error :
Undefined subroutine &Koha::FrameworkPlugin::GetMarcFromKohaField called at cataloguing/value_builder/barcode_manual.pl line 41.

Test plan :
1) Configure a subfield of item to use value builder barcode_manual.pl
2) Go to a record
3) Try to add a new item
4) Check the value builder is OK

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with autobarcode==year-0001,0002
No internal server error, but generates a barcode now.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23407: (QA follow-up) Same change for UNIMARC XSLT
Marcel de Rooy [Fri, 24 Jan 2020 07:22:52 +0000 (07:22 +0000)]
Bug 23407: (QA follow-up) Same change for UNIMARC XSLT

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23407: (QA follow-up) Remove some XSLT item leftovers
Marcel de Rooy [Fri, 24 Jan 2020 07:12:31 +0000 (07:12 +0000)]
Bug 23407: (QA follow-up) Remove some XSLT item leftovers

Test plan:
Check intranet results and detail page.
Check opac detail.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23407: Don't process items for XSLT on details pages
Nick Clemens [Wed, 31 Jul 2019 20:14:34 +0000 (20:14 +0000)]
Bug 23407: Don't process items for XSLT on details pages

To test:
1 - Add 1000 items to a record
    Go to biblio
    Edit items
    Add multiple copies of this item
    Add 1000 and confirm
    Wait..
2 - Load the record in staff client and OPAC, note how long it takes
    Press F12 in browser to open the console
    use the Network tab of the console
    note the load time
    refresh a few times to see average time
3 - Apply patch
4 - Restart all the things
5 - Reload the record in staff and opac
6 - Note decresed time
7 - Verify nothing on the page has changed

QA can grep the standard XSLT files for details pages for 'item' to note occurences do not use items information

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24443: Unit test
Fridolin Somers [Fri, 17 Jan 2020 09:48:50 +0000 (10:48 +0100)]
Bug 24443: Unit test

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24443: Consider NULL as 0 for issues in items search
Fridolin Somers [Fri, 17 Jan 2020 09:25:19 +0000 (10:25 +0100)]
Bug 24443: Consider NULL as 0 for issues in items search

In items search, we can filter by items issues count, data coming from items.issues.
Most of the time, for an item with no issues this column contains NULL.
This enhancement proposes to consider NULL as 0 to allow searching items with no issues.

Test plan:
1) Use SQL to count items with items.issues = NULL :
   select count(*) from items where issues is null;
2) Go to items search
3) Perform search with filter "Checkout count" = 0
4) Check you get the same number of results as SQL query

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 21296: suspend hold ignores system preference on intranet
Owen Leonard [Wed, 20 Nov 2019 20:04:10 +0000 (20:04 +0000)]
Bug 21296: suspend hold ignores system preference on intranet

This patch modifies the DataTable configuration for the table of holds
which displays under the "Holds" tab on the patron's checkout and
details pages. A variable is now defined in the JavaScript with the
value of the "SuspendHoldsIntranet" system preference. This variable is
passed to the DataTable configuration to determine whether the column is
visible or not.

One of the changes made in this patch moves a <script> block so that it
appears before some of the JS includes on the page. This helps keep the
string-defining JS together in one block.

To test, apply the patch and set the "SuspendHoldsIntranet" system
preference to "Allow."

 - Open the checkout page for a patron with one or more holds.
 - Under the "Holds" tab, the table of holds should have a "Suspend"
   column with controls for suspending or resuming holds.
 - Check that the same is true on the patron detail page.
 - Set the "SuspendHoldsIntranet" system preference to "Don't allow."
 - Test the checkout and detail pages again and confirm that the
   "Suspend" column does not appear.

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 16683: Help links to fields 59X in cataloguing form are broken
Owen Leonard [Thu, 21 Nov 2019 16:26:53 +0000 (16:26 +0000)]
Bug 16683: Help links to fields 59X in cataloguing form are broken

This patch adds more specificity to handling of MARC21 documentation
links in the basic MARC editor.

To test, apply the patch and make sure the "advancedMARCeditor" system
preference is set to "Display."

You may need to edit a bibliographic framework so that 09x, 59x, and 69x
tags will display in the editor.

Edit or create a bibliographic record using that framework. Next to each
tag label in the editor should be a "?" link. Clicking this link should
open a new window with the correct Library of Congress documentation
page.

Check the links for 09x, 59x, and 69x tags as well as others to confirm
they open the correct pages.

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24289: dbrev update to remove atomicupdate file
Joy Nelson [Fri, 7 Feb 2020 23:59:33 +0000 (23:59 +0000)]
Bug 24289: dbrev update to remove atomicupdate file

4 years agoBug 22831: (RM follow-up) Code golf
Martin Renvoize [Thu, 23 Jan 2020 10:20:31 +0000 (10:20 +0000)]
Bug 22831: (RM follow-up) Code golf

Rather than performing a symmetric diff and then splitting the results
in a further loop this patch changes to logic to use two asymetric diffs
to get the results more directly.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22831: (follow-up) Sort results, group by db
Nick Clemens [Thu, 7 Nov 2019 18:49:12 +0000 (18:49 +0000)]
Bug 22831: (follow-up) Sort results, group by db

Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22831: (follow-up) Determine where the record is missing and provide link, show...
Nick Clemens [Wed, 6 Nov 2019 14:37:01 +0000 (14:37 +0000)]
Bug 22831: (follow-up) Determine where the record is missing and provide link, show counter

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22831: Elasticsearch - add a maintenance script for checking DB vs index counts
Nick Clemens [Thu, 2 May 2019 12:24:08 +0000 (12:24 +0000)]
Bug 22831: Elasticsearch - add a maintenance script for checking DB vs index counts

This script uses Array::Utils and adds a dependency

To test:
 1 - Have Koha with ES running
 2 - Delete some records from ES
     curl -X DELETE "es:9200/koha_kohadev_biblios/data/5"
     curl -X DELETE "es:9200/koha_kohadev_authorities/data/5"
 3 - perl misc/maintenance/compare_es_to_db.pl
 4 - Note you are notified of problems in both indexes
 5 - perl misc/search_tools/rebuild_elastic_search.pl  -a
 6 - perl misc/maintenance/compare_es_to_db.pl
 7 - Note you are only notified about problems in biblios (assuming you don't have other issues)
 8 - perl misc/search_tools/rebuild_elasticsearch.pl  -b
 9 - perl misc/maintenance/compare_es_to_db.pl
10 - Both counts match, no problems

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24289: DBRev 19.11.02.003
Joy Nelson [Fri, 7 Feb 2020 23:11:45 +0000 (23:11 +0000)]
Bug 24289: DBRev 19.11.02.003

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24289: Make sure sample_holidays will load after sample_libraries
Jonathan Druart [Thu, 26 Dec 2019 11:06:10 +0000 (12:06 +0100)]
Bug 24289: Make sure sample_holidays will load after sample_libraries

They are inserted depending on their alpha order, and sample_holidays
will fail because of missing branchcode.
This patch suggests a simple fix: rename sample_holidays to
sample_libraries_holidays, to make sure it will be loaded after
sample_libraries

Test plan:
Start a fresh installation and select all sample data

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24289: Add foreign keys on *_holidays.branchcode tables
Jonathan Druart [Thu, 26 Dec 2019 10:42:43 +0000 (11:42 +0100)]
Bug 24289: Add foreign keys on *_holidays.branchcode tables

Those are missing foreign keys, it will also clean the holidays tables
and automatically remove the holidays when a library is removed.

Test plan:
0. Do not apply this patch
1. Create a new library
2. Create special and repeatable holiday for this library
3. Remove the library
=> Notice that the holidays still exist in DB
4. Apply this patch
5. Execute the update database entry
=> Notice that the holidays for this library have been removed from the DB
6. Repeat 1-3
=> Notice that the holidays have been removed along with the library

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24025: Make CodeMirror content searchable
Lucas Gass [Wed, 22 Jan 2020 16:31:10 +0000 (16:31 +0000)]
Bug 24025: Make CodeMirror content searchable

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24452: Advanced editor - show multiple spaces visually
Owen Leonard [Fri, 17 Jan 2020 15:00:31 +0000 (15:00 +0000)]
Bug 24452: Advanced editor - show multiple spaces visually

This patch updates the JavaScript and CSS for the advanced MARC editor
so that multiple consecutive spaces within a line will be detected and
highlighted.

To test the EnableAdvancedCatalogingEditor system preference should be
enabled. Apply the patch and clear your browser cache if necessary.

 - Go to Cataloging -> Advanced editor.
 - On any text entry line (e.g. 245), enter some words with one, two,
   and more spaces in between them. When there are two or more spaces
   between words the spaces between the words should have a dotted red
   underline.
 - Remove the extra spaces and confirm that the dotted line disappears.

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24105: Fix error when running longoverdue.pl with --itemtypes
Liz Rea [Mon, 25 Nov 2019 17:20:51 +0000 (11:20 -0600)]
Bug 24105: Fix error when running longoverdue.pl with --itemtypes

To test:

Run Longoverdue.pl as koha-shell with both 1 and several --itemtypes specified
notice that it has an error
apply this patch
run longoverdue.pl as koha-shell with both 1 and several --itemtypes specified
notice there isn't an error anymore!

Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23064: Use Koha::Subscription in ModSubscription
Jonathan Druart [Wed, 20 Nov 2019 11:22:58 +0000 (12:22 +0100)]
Bug 23064: Use Koha::Subscription in ModSubscription

We must use Koha::Subscription instead of raw SQL.
It will fix issue with default and integer values.

Test plan:
Edit a subscription and set number of issues = "f"
Save
=> Without this patch there is a SQL error in the log:
  Incorrect integer value: 'f' for column 'numberlength'
=> With this patch the other changes are effective.

Note: We also could change the type attribute of the input to "number",
to have a client-side check

Also, the return value of ModSuggestion is never used, so we are safe
with that.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24397: Remove out of sync script populate_db.pl
Jonathan Druart [Fri, 10 Jan 2020 13:16:56 +0000 (14:16 +0100)]
Bug 24397: Remove out of sync script populate_db.pl

populate_db.pl from koha-misc4dev must be used instead.
This script existed before the creation of koha-misc4dev, it does no
longer make sense to have it in Koha.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24286: Escape forward slash in GENRE/FORM (and any authtype)
Nick Clemens [Fri, 20 Dec 2019 13:33:28 +0000 (13:33 +0000)]
Bug 24286: Escape forward slash in GENRE/FORM (and any authtype)

Note that bug 24267 will fix the issue during Z39 searching for new auth, but the duplicate check at saving will still fail

To test:
 0 - Set SearchEngine to Elasticsearch,  QueryRegexEscapeOptions  to 'Don't Escape'
 1 - Browse to Authorities
 2 - Select New->New from Z3950
 3 - Search for subject 'Short stories'
 4 - Auth search explodes
 5 - Apply patch
 6 - Repeat and confirm the search results return
 7 - Import and save the GENRE/FORM record for Short stories
 8 - Repeat the search and import the same record
 9 - Confirm that upon save you are notified of duplicate, don't save
10 - set  QueryRegexEscapeOptions to 'Escape' and confirm Z39 searching works and importing/save notifies of duplicate
11 - set SearchEngine to Zebra and confirm Z39 searching works and importing/save notifies of duplicate

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24441: Error when checking in an item with BranchTansferLimitsType set to itemtype
Kyle M Hall [Thu, 16 Jan 2020 19:10:18 +0000 (14:10 -0500)]
Bug 24441: Error when checking in an item with BranchTansferLimitsType set to itemtype

It appears that the transition to using Koha::Item in AddReturn has introduced a bug. Previously $item was a hashref with the key 'itemtype', now that it's an object, it has no itemtype method and so triggers an error with the message "The method Koha::Item->itemtype is not covered by tests!".

Test Plan:
1) Enable Branch Transfer Limits via itemtype
2) Check in an item
3) Note the error
4) Apply this patch
5) Restart all the things!
6) Check in an item
7) No error!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Maribeth (Turner) Shafer <mshafer@ckls.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24441: Add tests
Jonathan Druart [Tue, 21 Jan 2020 15:08:12 +0000 (16:08 +0100)]
Bug 24441: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24236: Fix pagination to use query_cgi
Nick Clemens [Fri, 13 Dec 2019 16:08:16 +0000 (16:08 +0000)]
Bug 24236: Fix pagination to use query_cgi

This is still wrong, we should use page-numbers.inc, but that is a larger refactoring
This patch fixes non-QueryParser searches by simple getting an using the escaped query (query_cgi)

For QueryParser, we do what the QP code does, just uri escape the query - the way that SimpleSearch does the query parsing instead of the usual buildQuery suggest to me that we should probably switch all of this to use the general Zebra search.

The issues with reservoir should be their own bug

To test:
1 - Search for cat in cataloging search
2 - Get results and see you can paginate
3 - Search for "cat"
4 - Get results but subsequent pages empty
5 - Apply patch
6 - Repeat search for "cat"
7 - You can paginate
8 - Enable UseQueryParser syspref (don't worry about installing)
9 - Confirm can still search with quotes and paginate

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24338: DBREV 19.11.02.002
Joy Nelson [Thu, 6 Feb 2020 21:33:28 +0000 (21:33 +0000)]
Bug 24338: DBREV 19.11.02.002

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24338: (QA follow-up) Make update idempotent
Martin Renvoize [Tue, 4 Feb 2020 13:19:18 +0000 (13:19 +0000)]
Bug 24338: (QA follow-up) Make update idempotent

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV
Martin Renvoize [Mon, 27 Jan 2020 11:06:26 +0000 (11:06 +0000)]
Bug 24338: Add 'CASH' to default 'PAYMENT_TYPE' AV

Bug 23321 adds cash registers to the koha accounts system and as part of
that work introduces the 'CASH' payment type as a required option to
allow requirment of a 'CASH_REGISTER' when making cash payments. The
original patchset, however, forgot to add this new authorised value
during installation and upgrade.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24485: Allow hold when some can be overridden
Nick Clemens [Tue, 28 Jan 2020 13:57:32 +0000 (13:57 +0000)]
Bug 24485: Allow hold when some can be overridden

The check to see if we can place a hold counts the number that we can override vs the number of items on the record.

We cannot override if we already have a hold on an item, however, we don't count these to see if they plus
the number of overrides equal the items on the record.

To test:
1 - Set max reserves to 2, allow 2 holds per recrod
2 - Place 2 holds for a patron on some records
3 - Find another record with 2 items
4 - Place a hold on the first item, you will be notified about the limit but you can override
5 - Attempt to place hold on second item, cannot be done, button disabled
6 - Apply patch
7 - Repeat
8 - You can place the second hold

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoRevert "Bug 24200: Try to fix random failures from Borrower_PrevCheckout.t"
Joy Nelson [Mon, 3 Feb 2020 23:46:54 +0000 (23:46 +0000)]
Revert "Bug 24200: Try to fix random failures from Borrower_PrevCheckout.t"

This reverts commit 3e93514ac3fbf35691aaad90fa6121d176bdb9b1.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24214: Fix due date formatting when sticky
Jonathan Druart [Wed, 11 Dec 2019 11:20:54 +0000 (12:20 +0100)]
Bug 24214: Fix due date formatting when sticky

When checking out and sticky due date is selected, on the next screen
the due date is displayed iso-formatted, instead of following the
dateformat syspref

Test plan:
0/ Do not apply the patch
1/ Check an item out, with a selected due date. Tick "Remember for
session"
2/ Next screen you see the date like YYYY-MM-DD HH:MM
regarless the value of the dateformat syspref
3/ Apply this patch
4/ Reload the page
=> The date is correctly formatted
5/ Check an item out
=> Due date is correctly set

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24061: Close after timeout if onafterprint no supported
Jonathan Druart [Fri, 22 Nov 2019 09:16:15 +0000 (10:16 +0100)]
Bug 24061: Close after timeout if onafterprint no supported

Not supported on Chrome < 63
https://www.w3schools.com/tags/ev_onafterprint.asp

Signed-off-by: Gabriel DeCarufel <gabriel@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24061: Close the window after the page has been printed
Jonathan Druart [Wed, 20 Nov 2019 08:19:51 +0000 (09:19 +0100)]
Bug 24061: Close the window after the page has been printed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 17667: Do not modify quantity of the original standing order when a receipt is...
Jonathan Druart [Wed, 18 Dec 2019 17:10:15 +0000 (18:10 +0100)]
Bug 17667: Do not modify quantity of the original standing order when a receipt is cancelled

When cancelling a receipt, the quantity of the original order is
increased.

Test plan:
Create a basket, mark is as "standing orders"
Create an order
receive it
cancel the receipt
=> Without this patch the quantity of the original order is 2
=> With this patch applied the quantity it always 1

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 17667: Add tests
Jonathan Druart [Wed, 18 Dec 2019 17:10:07 +0000 (18:10 +0100)]
Bug 17667: Add tests

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24404: Add missing space on invoices page / remove . from status
Katrin Fischer [Sun, 12 Jan 2020 09:32:17 +0000 (10:32 +0100)]
Bug 24404: Add missing space on invoices page / remove . from status

On the bottom of the invoices page the summary of adjustments and
shipping shows as:

Adjustments plus shipping:2.00

The patch adds the missing space between text and amount.

To test:
- 'Receive shipment' from a result in your vendor search
- Start a new invoice by entering an invoice number, amount
  for shipping cost and fund.
- Finish receive (you don't need to receive anything)
- You should now be on invoice.pl
- Verify Status is 'Open.' and in 'Invoice details' we
  have the amount with the missing space.
- Apply patch, reload the page.
- Verify the missing space is there and the . is gone.
- Close invoice, no . there either.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24333: Add password class to AutoSelfCheck syspref
Nick Clemens [Thu, 9 Jan 2020 12:48:04 +0000 (12:48 +0000)]
Bug 24333: Add password class to AutoSelfCheck syspref

To test:
1 - Go to Administration
2 - Search sysprefs for AutoSelfCheck
3 - Enter something into AutoSelfCheckPass
4 - Note it is not masked
5 - Apply patch
6 - Reload page
7 - Note password is now masked

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24395: Show initial float using the Price TT plugin on summary page
Katrin Fischer [Tue, 14 Jan 2020 18:44:01 +0000 (18:44 +0000)]
Bug 24395: Show initial float using the Price TT plugin on summary page

For displaying monetary amounts, we should be using the Price TT
plugin everywhere. This adds it to the cash register summary page.

To test:
- Create a cash register
- Check the cash register table for "Initial float"
- Verify the amount shows with more than 2 decimals
- Edit cash register - verify the same display there
- Apply patch
- Check again - it should display now with only 2 decimals

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22220: Fix bib Apache rewrite rule for intranet
Marcel de Rooy [Thu, 16 Jan 2020 14:33:39 +0000 (14:33 +0000)]
Bug 22220: Fix bib Apache rewrite rule for intranet

Trivial change. Speaks for itself.
Since koha/detail.pl does not exist, we cannot break things ;)

Test plan:
[1] Copy the change in apache-shared-intranet.conf to your actual
    apache configuration. Probably in /etc/koha/.
[2] Restart Apache.
[3] Try a biblionumber say 123 on intranet with [your_staff_client]/bib/123.
    Does the detail page come up?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24275: Apply anti-the to title column in inventory table
Nick Clemens [Thu, 19 Dec 2019 13:19:11 +0000 (13:19 +0000)]
Bug 24275: Apply anti-the to title column in inventory table

To test:
1 - Go to Tools->Inventory
2 - Click submit (or add options to get a subset of titles)
3 - Try sorting by title, note that titles with leading articles sort including the articles
4 - Apply patch
5 - Reload the page
6 - Note that leading articles are ignored for sorting

Signed-off-by: Deb <dstephen@dubuque.lib.ia.us>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20567: Count found holds for holds limit
Jonathan Druart [Tue, 14 Jan 2020 09:34:48 +0000 (10:34 +0100)]
Bug 20567: Count found holds for holds limit

Signed-off-by: Hans Palsson <hans.palsson@hkr.se>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20567: Add tests
Jonathan Druart [Tue, 14 Jan 2020 09:33:03 +0000 (10:33 +0100)]
Bug 20567: Add tests

Signed-off-by: Hans Palsson <hans.palsson@hkr.se>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24391: Remove event attributes from patron clubs edit template
Owen Leonard [Thu, 9 Jan 2020 17:45:47 +0000 (17:45 +0000)]
Bug 24391: Remove event attributes from patron clubs edit template

This patch removes "onclick" attributes from the template for adding and
editing patron club templates.

To test, apply the patch and go to Tools -> Patron clubs -> New club
template.

Test the process of adding and deleting both club and enrollment fields.
Test during the template add process and when editing an existing
template.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24408: Do not compare floats with precision in tests
Jonathan Druart [Fri, 10 Jan 2020 10:10:50 +0000 (11:10 +0100)]
Bug 24408: Do not compare floats with precision in tests

We should not compare floating precision in tests.

Test plan:
Confirm that the tests still pass after this patch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23790: fr-CA translation of ACCOUNT_DEBIT and ACCOUNT_CREDIT notices
Caroline Cyr La Rose [Wed, 9 Oct 2019 19:34:24 +0000 (15:34 -0400)]
Bug 23790: fr-CA translation of ACCOUNT_DEBIT and ACCOUNT_CREDIT notices

This patch provides the fr-CA translation of the ACCOUNT_DEBIT and ACCOUNT_CREDIT notices.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested deleting from letter table, then loading the file.
File loads without problem, no errors.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24206: DBRev 19.11.02.001
Joy Nelson [Fri, 31 Jan 2020 22:32:58 +0000 (22:32 +0000)]
Bug 24206: DBRev 19.11.02.001

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24206: Update content of OpacSearchForTitleIn for existing installations
Katrin Fischer [Sun, 22 Dec 2019 13:07:46 +0000 (13:07 +0000)]
Bug 24206: Update content of OpacSearchForTitleIn for existing installations

This includes a database update for existing installations.
Using the REPLACE function it makes the same changes to the URLs
as the previous patch did for new installations:

- Worldcat: now https
- BookFinder: now https
- OpenLibrary: remove / before search parameters

To test:
- Verify the current content of your preference OpacSearchForTitleIn
  (without changes from first patch!)
- Run the database update
- Verify everything still works, but changes have been made

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24206: Update URLs for default options in OPACSearchForTitleIn
Katrin Fischer [Sun, 22 Dec 2019 13:05:34 +0000 (13:05 +0000)]
Bug 24206: Update URLs for default options in OPACSearchForTitleIn

- Worldcat: now https
- BookFinder: now https
- OpenLibrary: remove / before search parameters

To test:
- Verify changes to the installer files are correct
- Bonus: run the web installer for en, de-DE and nb-NO and
  verfiy the content of OPACSearchForTitleIn is correct

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24146: Illustrate increasing and decreasing fine
Nick Clemens [Fri, 6 Dec 2019 15:35:27 +0000 (15:35 +0000)]
Bug 24146: Illustrate increasing and decreasing fine

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24146: Corrections to UpdateFine logic concerning maxFine
Martin Renvoize [Fri, 6 Dec 2019 15:10:17 +0000 (15:10 +0000)]
Bug 24146: Corrections to UpdateFine logic concerning maxFine

The `maxFine` system preference actually refers to the amount of
outsanding debt (in fines) a patron may have at a given time. This patch
corrects the functionality of UpdateFine such that it properly respects
that counter given the payment of accruing fines scenario.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24146: Increment existing fine
Martin Renvoize [Thu, 5 Dec 2019 10:14:51 +0000 (10:14 +0000)]
Bug 24146: Increment existing fine

We should increment an existing fine even if it has been fully paid off
whilst it is still incrementing and not create a new fine.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24146: Add test cases
Martin Renvoize [Wed, 4 Dec 2019 14:23:14 +0000 (14:23 +0000)]
Bug 24146: Add test cases

This patch adds test cases for both checking amountoutstanding values
are handled correctly and also that the paid down accruing fines do not
add additional fines on increment.

Test plan:
Read the changeset and asses whether the changes/additional tests are
correct as per the expected behaviour.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 9156: Clarify order in the syspref
Nick Clemens [Thu, 2 Jan 2020 18:06:20 +0000 (18:06 +0000)]
Bug 9156: Clarify order in the syspref

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 9156: (follow-up) Simplify code
Nick Clemens [Thu, 19 Dec 2019 19:05:36 +0000 (19:05 +0000)]
Bug 9156: (follow-up) Simplify code

The MARC::Field as_string method can join multiple subfield using a delimiter, this simplifies the code here

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 9156: itemcallnumber not pulling more than 2 subfields
Owen Leonard [Tue, 19 Nov 2019 14:56:05 +0000 (14:56 +0000)]
Bug 9156: itemcallnumber not pulling more than 2 subfields

When the itemcallnumber system preference is defined, the item add form
pulls data from the specified tag and subfield(s) to pre-populate the
call number field. This update makes it possible to build the
prepopulated callnumber from more than just the first two subfields.

To test, apply the patch and update the itemcallnumber system preference
so that it includes more than two subfields. For instance, "092abef"

 - Edit a bibliographic record and populate the specified subfields.
   e.g. subfield a -> "One", b-> "Two", e-> "Three", f-> "Four".
 - Save the record and go to the add/edit items screen.
 - The call number field should contain a string which contains each of
   the subfields you populated, concatenated with spaces: "One Two Three
   Four."
 - Test with other numbers of subfields.
 - Test with an empty itemcallnumber preference.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24373: Correct basic cataloging editor CSS
Owen Leonard [Tue, 7 Jan 2020 19:52:25 +0000 (19:52 +0000)]
Bug 24373: Correct basic cataloging editor CSS

This patch makes minor corrections to the basic MARC editor CSS, fixing
an error caused by Bug 23259.

To test, apply the patch and clear your browser cache if necessary.

Open the basic MARC editor and check the numbered tabs. There should be
no stripe of green background showing below the tabs.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Guillaume Paquet <guillaume@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23443: Do not checkin an item if checked out to another patron when lost fee...
Jonathan Druart [Tue, 14 Jan 2020 11:39:38 +0000 (12:39 +0100)]
Bug 23443: Do not checkin an item if checked out to another patron when lost fee is paid

Test plan:
0 - Do not apply this patch
1 - Check out an item to a patron
2 - Make sure a fee will be charged when lost
3 - Mark the item lost
4 - Make sure the fee will not be refunded on return of the item
5 - Return the item
6 - Check it out to a new patron
7 - Write off the fine for the original patron
=> The item is now checked in
8 - Apply this patch and repeat 1 to 7
=> The item is still checked out

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23443: Add tests
Jonathan Druart [Tue, 14 Jan 2020 11:39:36 +0000 (12:39 +0100)]
Bug 23443: Add tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24377: Record passed branch if renewing via cron
Nick Clemens [Thu, 16 Jan 2020 13:09:58 +0000 (13:09 +0000)]
Bug 24377: Record passed branch if renewing via cron

To test:
1 - Checkout an item with auto renewal set and eligible for auto renew
2 - Set no renewal before in the circ rules to 99 (something greater than the checkout period)
3 - perl misc/cronjobs/automatic_renewals.pl
4 - Check the statistics table, note the branch for renewal is null
    SELECT * FROM statistics WHERE itemnumber={itemnumber} AND type='RENEWAL'
5 - Apply patch
6 - Repeat 1-4
7 - Note the branch is set to the issuing branch

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ed Veal <eveal@mckinneytexas.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24377: Unit test
Nick Clemens [Thu, 16 Jan 2020 13:09:50 +0000 (13:09 +0000)]
Bug 24377: Unit test

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24484: Add explanatory text to batch patron deletion
David Roberts [Thu, 23 Jan 2020 12:18:17 +0000 (12:18 +0000)]
Bug 24484: Add explanatory text to batch patron deletion

This patch adds a more detailed explanation about what the tool can do.

To test:

1) Open up the Batch patron deletion and anonymisation tool
2) Check the help text near the top of the screen
3) Install the patch and repeat steps 1 and 2
4) Check the help text has changed to the new version

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24423: Add biblionumber to modify items link
Nick Clemens [Wed, 15 Jan 2020 15:27:56 +0000 (15:27 +0000)]
Bug 24423: Add biblionumber to modify items link

To test:
- Find/create a bib with at least one item
- From detail.pl, use the checkboxes in the holdings table to select one or more items
- click the "Modify Selected Items" link just above the holdings table to take your item(s) to batch modification
- Change something and click save
- Observe that the Return to the Record link points to a url without a biblionumber: "/cgi-bin/koha/catalogue/detail.pl?biblionumber="
- Apply patch
- Repeat
- The link now works!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Bug 24423: Fix for deletion - cleanup accidental debug inclusiopm

To test:
Repeat prior test plan with 'Delete selected'

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24421: Check if subfields are valid using the biblio tag
Nick Clemens [Tue, 14 Jan 2020 16:13:25 +0000 (16:13 +0000)]
Bug 24421: Check if subfields are valid using the biblio tag

To test:
 1 - Enable the sysprefs
     AutoCreateAuthorities
     BiblioAddsAuthorities
     CatalogModuleRelink
 2 - Open a record with a subject heading with a subdivision and add a new subfield, or add a new unauthroized heading to a record and save it
    e.g. 650$aChess$xOpenings$vFiction.
 3 - Save the record, note the created authority and that field is linked
 4 - Save the record again and note the authority number changes
 5 - Find and view the authority linked to the record
 6 - The record is for 'Chess', not Chess openings'
 7 - Search authorities for 'Chess' - note duplicated records
 8 - Apply patch, restart all
 9 - Save the record, auth number increases again, we shoudl create the correct record this time
10 - Save again, auth number should not change
11 - Search authorities and confirm the generated authority has the correct subfields

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24421: Unit tests
Nick Clemens [Fri, 24 Jan 2020 13:24:45 +0000 (13:24 +0000)]
Bug 24421: Unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22426: Map 'loc' to 'location' when building ES queries
Fridolin Somers [Mon, 17 Jun 2019 14:09:38 +0000 (16:09 +0200)]
Bug 22426: Map 'loc' to 'location' when building ES queries

A search made on Shelving location tab in advanced search gives 0 result.

Test plan :
Without patch:
    - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc)
    - 0 result
    - check that location exist by doing a simple search and filtering on the    location facet
    - have some results
With patch:
    - in advanced search, choose a location in shelving location tab and start search (opac-search.pl?idx=kw&op=and&idx=kw&op=and&idx=kw&do=Search&limit=mc-loc)
    - found results

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23676: (RM follow-up) Test Correction
Martin Renvoize [Mon, 13 Jan 2020 09:27:35 +0000 (09:27 +0000)]
Bug 23676: (RM follow-up) Test Correction

We altered the query form passed by the ElasticSearch Query Builder
but neglected to update the test.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23676: Use 'false' for opac suppression
Nick Clemens [Wed, 25 Sep 2019 19:04:13 +0000 (19:04 +0000)]
Bug 23676: Use 'false' for opac suppression

To test:
 1 - Enable ES
 2 - Enable OpacSuppression
 3 - Suppress a bib in staff client
     Edit 942n to be 1
 4 - Search the opac for anything
 5 - Tail the plack logs and note a deprecation warning
 6 - Apply patch
 7 - Restart all the things
 8 - Repeat search on opac
 9 - No error/warn in logs
10 - Record is correctly suppressed

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 17885: Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings throws...
Joonas Kylmälä [Fri, 31 Aug 2018 12:32:20 +0000 (15:32 +0300)]
Bug 17885: Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings throws DBD::mysql Duplicate entry exceptions

When executing
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings()
against populated search engine mappings tables, one gets this
exception:

DBD::mysql::st execute failed: Duplicate entry '388-73' for key
'PRIMARY' [for Statement \"INSERT INTO `search_marc_to_field` ( `facet`,
`search_field_id`, `search_marc_map_id`, `sort`, `suggestible`) VALUES (
?, ?, ?, ?, ? )\" with ParamValues: 0='', 1='73', 2='388', 3=undef,
4=''] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line
1834.\nDBIx::Class::Storage::DBI::_dbh_execute(): Duplicate entry
'388-73' for key 'PRIMARY' at /home/koha/Koha/Koha/SearchField.pm line
38"

This patch fixes this, by first deleting all entries, then adding the
default ones.

If a subroutine says reset_elasticsearch_mappings(), I expect it to
reset the elasticsearch mappings without errors.  When writing tests it
is better to call that one subroutine reset_elasticsearch_mappings
instead of the bunch of code in
admin/searchengine/elasticsearch/mappings.pl?op=reset_confirmed
Also this promotes code reuse.

TEST PLAN:

a. perl -e 'use Koha::SearchEngine::Elasticsearch; Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings'
b. Run misc/devel/populate_db.pl on an already populated DB and you eventually
face this problem.

After this patch, step a. works.

This patch is adapted from the original patch made by Olli-Antti
Kivilahti <olli-antti.kivilahti@jns.fi>.

Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23934: Item level holds not checked for LocalHoldsPriority in Holds Queue
Kyle M Hall [Thu, 31 Oct 2019 17:52:05 +0000 (13:52 -0400)]
Bug 23934: Item level holds not checked for LocalHoldsPriority in Holds Queue

Test plan:
- Set LocalHoldsPriority to "Give priority for filling holds to patrons
whose pickup library matches the item's holding library"
- set yourself at Library A
- find at item at Library A
- place an item-level hold (Hold 1) for item for pickup at Library B
- set an item-level hold (Hold 2) for item for pickup at Library A
- Confirm Hold 1 shows priority=1
- Check in item
- confirm item would be captured for Hold 2, ignore hold
- run holds queue
- check item in
- confirm item is captured for Hold 2

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23934: Unit test
Kyle M Hall [Thu, 31 Oct 2019 17:51:33 +0000 (13:51 -0400)]
Bug 23934: Unit test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 15142: (RM follow-up) Fix tests
Martin Renvoize [Mon, 13 Jan 2020 09:22:20 +0000 (09:22 +0000)]
Bug 15142: (RM follow-up) Fix tests

We removed the su-ut facet from zebra config for UNIMARC as it makes no
sense for that case, but we neglected to remove it form the test that
checks the config response.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 15142: (follow-up) Remove facet configuration from .xsl file
Katrin Fischer [Tue, 31 Dec 2019 09:30:32 +0000 (10:30 +0100)]
Bug 15142: (follow-up) Remove facet configuration from .xsl file

Removes last remaining bit of configuration for the Titles facet
configuration.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 15142: (follow-up) remove from Zebra UNIMARC config files
Fridolin Somers [Tue, 26 Nov 2019 08:44:08 +0000 (09:44 +0100)]
Bug 15142: (follow-up) remove from Zebra UNIMARC config files

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 15142: Remove titles facet for UNIMARC
Fridolin Somers [Fri, 22 Nov 2019 14:16:51 +0000 (15:16 +0100)]
Bug 15142: Remove titles facet for UNIMARC

There is a facet using 500$a, 501$a and 503$a and Subject index.
In UNIMARC 500$a, 501$a and 503$a are not indexed as Subject.
I propose to remove this facet for UNIMARC, looks like it does not make
sens.

Test plan:
1) Install UNIMARC database
2) Edit some records to have 500$a
3) Perform a search to find those records
4) Check you dont see the titles facet

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23377: (QA follow-up) Use OVERRIDE_SYSPREF
Marcel de Rooy [Fri, 10 Jan 2020 10:49:45 +0000 (10:49 +0000)]
Bug 23377: (QA follow-up) Use OVERRIDE_SYSPREF

SYSPREF_OVERRIDE unfortunately is not supported ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23377: use ENV syspref override instead of complete disable
Ian Walls [Wed, 31 Jul 2019 16:32:23 +0000 (16:32 +0000)]
Bug 23377: use ENV syspref override instead of complete disable

In an attempt to save time, bulkmarcimport temporarily sets CataloguingLog
and AuthoritiesLog to 0.  It does this by disabling syspref caching and saving
the changes to the database (then replacing the original values at completion).

Unfortunately, this disables other key sysprefs from being cached, and results in
a 50% increase in processing time for the script.

This patch instead utilizes the ENV variable override feature of sysprefs, which
preempts the cache in C4::Context->preference().

To test:
1. Perform a bulkmarcimport with a reasonable number of biblios (~1000 will do)
2. Note the time taken to complete
3. Apply patch
4. Revert the biblio load performed
5. Perform another bulkmarcimport with the same biblios and commandline options
6. Note the time taken to complete
7. Compare times.  The time from step 6 should be about 33% less than the time from step 2
8. Check Cataloguing and Authorities Logs to verify imported records were not logged
9. Profit!

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24200: Try to fix random failures from Borrower_PrevCheckout.t
Jonathan Druart [Fri, 10 Jan 2020 10:48:09 +0000 (11:48 +0100)]
Bug 24200: Try to fix random failures from Borrower_PrevCheckout.t

It failed inconsistently, let's try to use build_sample_item and see if
it fixes the random failures.

Test plan:
 % prove t/db_dependent/Patron/Borrower_PrevCheckout.t
must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24396: Fix Suggestions.t with MySQL 8
Jonathan Druart [Fri, 10 Jan 2020 10:29:15 +0000 (11:29 +0100)]
Bug 24396: Fix Suggestions.t with MySQL 8

 #   Failed test 'DelSuggestion deletes the correct suggestion'
 #   at t/db_dependent/Suggestions.t line 413.
 #          got: 'my title 3'
 #     expected: 'my deleted title'
 t/db_dependent/Suggestions.t .. 112/113 # Looks like you failed 1 test of 113.

Suggestions were returned in the reverse order. Adding an ORDER BY clause fixes the problem.

Test plan:
 % prove t/db_dependent/Suggestions.t
must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23274: Mock simple_search_compat to cover both search engines
Nick Clemens [Tue, 26 Nov 2019 12:57:17 +0000 (12:57 +0000)]
Bug 23274: Mock simple_search_compat to cover both search engines

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24323: Advanced editor - Display an error message if the record did not save
Cori Lynn Arnold [Tue, 31 Dec 2019 17:10:14 +0000 (17:10 +0000)]
Bug 24323: Advanced editor - Display an error message if the record did not save

Invalid 008 with helper silently fails to save.

This patch adds a "else if" to fall through if the error message isn't
one of the previously defined ones ("syntax" and "invalid") and presents
the human with a generic message that "Something went wrong, cannot
save."

Prior to testing:
a/Verify that Advanced Editor is enabled
b/Download the errorrecord.mrc from bug

To test:
1/Apply patch
2/Go to Cataloging->Advanced Editor
3/Click "Import Record" button and navigate to the record saved from
step b/
4/Add an 003 field (as required by the default cataloging config)
5/Hit "Save to catalog"
6/Verify that a message is passed to the user that the file was unable
to be saved

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24371: Fix "Show all items" avaibility link (use $raw filter) - intra
Jonathan Druart [Fri, 10 Jan 2020 08:56:12 +0000 (09:56 +0100)]
Bug 24371: Fix "Show all items" avaibility link (use $raw filter) - intra

Same fix for the intranet side

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24371: Fix "Show all items" avaibility link (use $raw filter) - opac
Lucas Gass [Tue, 7 Jan 2020 18:54:49 +0000 (18:54 +0000)]
Bug 24371: Fix "Show all items" avaibility link (use $raw filter) - opac

TO TEST:
1. Make an OPAC search with plenty of results.
2. Use the search facets to limit the search in some way, item type, author, etc.
3. Click on 'Limit to currently available items', everything is still fine.
4. Attempt to return to 'Show all items', there will be no search results.
5. Apply patch
6. Ateempt steps 1-4 again.
7. Should work this time.

Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 14759: Add test
Jonathan Druart [Thu, 9 Jan 2020 15:17:12 +0000 (16:17 +0100)]
Bug 14759: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 14759: Replace Text::Unaccent with Unicode::Normalize
Martin Renvoize [Wed, 8 Jan 2020 09:13:18 +0000 (09:13 +0000)]
Bug 14759: Replace Text::Unaccent with Unicode::Normalize

As shown in the comments on the bug, it appears that Unicode::Normalize
is the most reliable way to strip accents from strings for this use
case.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 10352: Get add operations too
Nick Clemens [Fri, 13 Dec 2019 17:08:58 +0000 (17:08 +0000)]
Bug 10352: Get add operations too

When an add for biblio or item is recorded there is no space in the info field

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 10352: (follow-up) Show the biblionumber for items in modification logs
Nick Clemens [Mon, 25 Nov 2019 12:09:45 +0000 (12:09 +0000)]
Bug 10352: (follow-up) Show the biblionumber for items in modification logs

This patch adds a link to the the biblio that shows the biblionumber of the item. It makes things a little more obvious

To test:
1 - Find a biblio with an item where an itemnumber on another biblio is equal to that biblionumber
   i.e. In the sample data:
        biblionumber 59 with item with itemnumber 127
        item with itemnumber  59 on biblionumber 23
2 - Edit both items however you wish
3 - On biblionumber 59 click the modification log
4 - You should see "Item 127"
5 - Click "Submit" on the form - this searches as itemnumber
6 - You should see "Item 59"
7 - Apply patch
8 - On biblionumber 59 click the modification log
9 - You should see "Item 127 from Biblio 59"
10 - Click "Submit" on the form - this searches as itemnumber
11 - You should see "Item 59 from Biblio 23"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>