]> git.koha-community.org Git - koha.git/log
koha.git
6 years agoBug 20764: Rename the test file
Jonathan Druart [Mon, 14 May 2018 15:14:33 +0000 (12:14 -0300)]
Bug 20764: Rename the test file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3a125dfb9144ae4165d9790121db1ed3b7129dc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20764: (QA follow-up) Fix path to sample plugins
Tomas Cohen Arazi [Mon, 14 May 2018 15:03:32 +0000 (12:03 -0300)]
Bug 20764: (QA follow-up) Fix path to sample plugins

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3523a01a07381a701375b81d540e325559449aae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20764: Koha_Template_Plugin_KohaPlugins.t is db dependent
Mirko Tietgen [Mon, 14 May 2018 12:46:20 +0000 (14:46 +0200)]
Bug 20764: Koha_Template_Plugin_KohaPlugins.t is db dependent

t/Koha_Template_Plugin_KohaPlugins.t is DB dependent.
This patch moves it to t/db_dependent/

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 831e6fac4d84cf5cbc63354dcd1baa5100cfaba7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: (QA follow-up) Remove double check
Kyle M Hall [Thu, 29 Mar 2018 11:11:40 +0000 (07:11 -0400)]
Bug 20181: (QA follow-up) Remove double check

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 14c702bee5362654c8779b8b4a33a0d679ee6a6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: Add POD for new plugin
Kyle M Hall [Tue, 13 Feb 2018 19:08:25 +0000 (14:08 -0500)]
Bug 20181: Add POD for new plugin

Signed-off-by: Mark Tompsett <mtompset@hotmail.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 f50a6ece8386058a5778d46458821064412c5f01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: (follow-up) Ensure test runs
Mark Tompsett [Tue, 13 Feb 2018 18:50:02 +0000 (18:50 +0000)]
Bug 20181: (follow-up) Ensure test runs

If EnablePlugins was 0, this test before this patch fails.
After this patch, it passes.

TEST PLAN
---------
1) Apply all but this patch
2) Run the following commands
    kshell
    prove t/Koha_Template_Plugin_KohaPlugins.t
   -- two tests fail, if you have the conf or syspref set to 0.
3) Apply this patch
4) Repeat step 2.
   -- all tests pass, including the positive and negative case checks.
5) run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.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 9755c34938c42411e4a7e5d897af7335eca6bc13)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: Unit tests
Kyle M Hall [Mon, 12 Feb 2018 16:15:47 +0000 (11:15 -0500)]
Bug 20181: Unit tests

Signed-off-by: Mark Tompsett <mtompset@hotmail.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 98164dc43209af9964b84e83f2ee8f0ff7491a35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20181: Allow plugins to add css and javascript to OPAC
Kyle M Hall [Mon, 12 Feb 2018 14:09:20 +0000 (09:09 -0500)]
Bug 20181: Allow plugins to add css and javascript to OPAC

A number of Koha plugins have been written that enhance Koha's public catalog. These plugins often make due to adding css and javascript to the various opac system preferences. It would be nice if the plugin system had hooks so plugin developers could add code the the head block and the area where we include javascript in the opac template.

Test Plan:
1) Apply this patch
2) Download and install the Kitchen Sink plugin ( v2.1.12 or later )
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.12/koha-plugin-kitchen-sink-v2.1.12.kpz
3) Install the plugin
4) Restart all the things if you can ( restart_all if you are using kohadevbox )
   This will ensure the plugin takes effect right away, it should be
   necessary but it won't hurt anything!
5) Load the opac, notice you get an alert message and the background
   for your opac is now orange ( assuming you've not customized the
   opac in any way )

Signed-off-by: Mark Tompsett <mtompset@hotmail.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 e8fbe51ff33760b0446339b44047229be9e9f1a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21480: misc/translator/translate does not work with perl 5.26
Olli-Antti Kivilahti [Wed, 3 Oct 2018 08:24:38 +0000 (11:24 +0300)]
Bug 21480: misc/translator/translate does not work with perl 5.26

Perl 5.26 (or earlier) introduced a security feature, where implicitly
including the program directory as a Perl library directory no longer
happens (perl -I. ).

This causes translate to fail because it cannot find the *.pm -files in
it's own directory.

This patch adds the familiar mantra
    use lib $FindBin::Bin;
to the relevant scripts.

To test:

1. Install Ubuntu18.04 or something else with Perl 5.26
2. Install Koha (we use the dev-install)
3. cd $KOHA_PATH/misc/translator/
4. perl translate create fi-FI
5. Observe problems with missing modules.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Cannot recreate the issue right now but the changes make sense.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8aa86cdf2d5e0dbda7d21394e52f37ba17a8064c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 24e2d2d9c46772804ee1904ec7ab3e80a8bf9d28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20131: Inventory optional filters correct "For loan" addition
Fridolin Somers [Fri, 2 Feb 2018 13:34:34 +0000 (14:34 +0100)]
Bug 20131: Inventory optional filters correct "For loan" addition

In inventory, optional filters are build from authorize values categories used for items.notforloan, items.itemlost, items.withdrawn and items.damaged.

The bug is that description of value 0 is always "For loan".
This seems to be only for "notforloan".

Second bug is that if a description exists for "notforloan" value 0, it is not used.

This patch corrects by adding "For loan" only for "notforloan" authorized values and if there is no 0 value.
It changes the description added by code from "ignore" to a more unlikly user defined "__IGNORE__".

Test plan:
1) Make sure you have authorized values defined on items.notforloan, say "NFL" category, with at least a value and description but no 0 value
2) Make sure you have authorized values defined on items.itemlost, say "LOST" category, with 0 = "Not lost" and 1 = "Lost"
3) Go to inventory /cgi-bin/koha/tools/inventory.pl
4) Without patch you see "For loan" on both items.notforloan and items.itemlost
5) With patch you see "For loan" only in items.notforloan, you see for items.itemlost : "Not lost" and "Lost"
6) Create in authorized values category "NFL" a value 0 with description "Available"
7) Go to inventory /cgi-bin/koha/tools/inventory.pl
8) Without patch you see "For loan" in items.notforloan for value 0
9) With patch you see "Available" in items.notforloan for value 0

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8d9284668c6de2d5fbfc4079a8b0516ba1645876)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a9aa1bd1e43a871a813de1e2e97005567afa589c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 18655: Correct the choose link in unimarc_field_210c value builder
Baptiste Wojtkowski [Tue, 23 May 2017 08:54:00 +0000 (08:54 +0000)]
Bug 18655: Correct the choose link in unimarc_field_210c value builder

- Link 'choose' is now a button.
- It doesn't call directly javascript anymore (use of listener).
- field to load stored in html on the page (less escaping needed).

Test plan :
1) Use UNIMARC catalog
2) Define unimarc_field_210c value builder on 210$c
3) Define an autority type EDITORS with heading on 200$b
4) Create an autority of this type with a single quote in heading, ie : l'avenir
5) Index this new autority
6) Edit a biblio record and launch 210$c value builder
7) Search for new autority
8) Click on 'Choose'
=> Heading should be pasted in 210$c

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9965aa43e15aaa63fd8999daa98618d20698e89b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b8ad6a6532c236e473d548ad910d920ef1516ecf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20151: always use current language for stemming
Fridolin Somers [Wed, 7 Feb 2018 14:06:56 +0000 (15:06 +0100)]
Bug 20151: always use current language for stemming

When stemming is enabled, in catalog searching "C4::Search::_build_stemmed_operand" will transform query operand into stemmed operand using stemmer Lingua::Stem::Snowball with a specified language.
This stemmer returns undef stemmed operand if no language is defined.

In main catalog search (catalogue/search.pl) current language is used.
But in other pages "acqui/neworderbiblio.pl" and "cataloguing/addbooks.pl" no language is defined so stemmed operand is empty and so stemming is not applied.

This patch corrects by returning in "C4::Search::_build_stemmed_operand" operand without change if no langage is defined.
And uses current langage in pages "acqui/neworderbiblio.pl" and "cataloguing/addbooks.pl" so all catalog search uses stemming.

Test plan :
1) Enable system preferences QueryStemming and QueryWeightFields
2) Disable system preferences QueryAutoTruncate, QueryFuzzy and UseQueryParser
3) Go to intranet main page and click on "Search the catalog" tab
4) Perform a search (without index) that uses the stemming, for example searching for "years" will also match "year"
5) Note how many results you get, for example "year" gets 24 results and "years" gets 24 results
6) Go to "Cataloging" module
7) Perform a search on same word in "Cataloging search" tab
8) Note how many results you get
9) Without patch you get fewer results than first search (step 5) because stemming is not applied, for example "year" gets 11 results and "years" gets 15 results
10) With patch you get the same results as first search (step 5) because stemming is applied, for example "year" and "years" gets 24 results
11) Same tests in aquisition module
12) On a basket, click "Add to basket" and perform a search in "From an existing record"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 78a692dee4523d04986ec394442c3a6d80ea0771)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2170698ab9da24d306286991b55257c4c3317e65)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21322: process_message_queue.pl --type should take an argument
Magnus Enger [Thu, 6 Sep 2018 13:23:17 +0000 (13:23 +0000)]
Bug 21322: process_message_queue.pl --type should take an argument

The help for this script says:
-t --type: If supplied, only processes this type of message ( email, sms )

Currently, the type argument is set up wrong, so it does not look
for an argument. This patch fixes that.

To test, run this command (should work in kohadevbox) or something
similar:

$ sudo koha-shell -c "perl \
/home/vagrant/kohaclone/misc/cronjobs/process_message_queue.pl -v \
--type=sms" kohadev

This should give the following error: "Option type does not take an argument".
Apply the patch and run the same command again. This should not give an
error.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d74a05d4fe81a599c030024f7944d2bdcca43d12)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a3f097958cae68e4f3f16c8eb5aa5411d2488bc2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21176: Fix due date calculation when high holds and TimeFormat is 12hr
Jonathan Druart [Mon, 13 Aug 2018 16:23:00 +0000 (13:23 -0300)]
Bug 21176: Fix due date calculation when high holds and TimeFormat is 12hr

What we were doing was wrong and is still wrong. The output_pref should not be done
in modules or script, only template side.
Much more work would be needed to clean the situation. This patch provides less changes
as possible to, hopefully, not introduce side-effects.

To recreate:
1 - Enable decreaseLoanHighHolds, set to 1 day and more than 0 holds
2 - Set TimeFormat to 12 hour
3 - Find or create a record with two items
4 - Place a hold on one of them
5 - Checkout the other to a different patron
6 - Note the warning message display correct time
7 - Confirm the checkout
8 - Note the item is due at 11:59AM

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 11885e75c04fa53cd88daae1ec0dc4a2a8ecd1f7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1d8a66ad010247c90a8930f4d2b48f96bbfe3b7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19271: Show vendor name on ordered/spent lists
Katrin Fischer [Thu, 27 Sep 2018 11:29:08 +0000 (12:29 +0100)]
Bug 19271: Show vendor name on ordered/spent lists

 Improvements to the display of lists of ordered and received orders:
 - Show the vendor's name instead of the internal number

 To test:
 - Make sure you have some pending and received orders
 - Access the Spent and Ordered pages by clicking on the
   amount ordered or spent on the acq start page
   - Verify that
     - Vendor name shows

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8b1bda9ed8507745b4002199d9aae95c2cbb31fb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3e77e7a4d6c90e6a14d152af19c46cda6486e7ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 15971: Add biblioitems to available fields for serial claim notices and fix notic...
Katrin Fischer [Fri, 10 Aug 2018 03:21:56 +0000 (05:21 +0200)]
Bug 15971: Add biblioitems to available fields for serial claim notices and fix notices editor display

This fixes 2 related problems:

1) The editor only offered 3 entries from biblio for adding to the notice:
title, author, serial
It was not clear that actually all fields from biblio can be used.

2) It was not possible to use fields from biblioitems in the notices
which left out important fields like the ISSN.

The patch adds the biblioitems table and changes the editor to show
all entries from biblio and biblioitems table are shown on the left.

To test:
- Create a subscription
- Generate next issue a few times to get late issues
- Create a new notice in the "Claim serial issue" module
  - Use fields from different/all tables
- Make sure an email address is set for
  - the vendor (also check for 'receives claims for late issues')
  - your staff user
- Go to serials > claims
- Claim multiple issues
- Verify the email is generated and contains the correct information

Example notice:

Title: <<biblio.title>>
Author: <<biblio.author>>
ISSN: <<biblioitems.issn>>
ISBN: <<biblioitems.isbn>>
Issue: <<serial.serialseq>>
--

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a002d12888c1e56910a32f28514a59d9a1d9363d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 00422bf33f48c95aac0dc639e42fe958d0de133b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21425: Display basketno correctly in Order error msg
Colin Campbell [Thu, 27 Sep 2018 11:25:28 +0000 (12:25 +0100)]
Bug 21425: Display basketno correctly in Order error msg

carp will display the hash value instead of the desired basketno
in the error message unless we change its behaviour

Use the simpler but effective option of concatenating
the errormessage with the basketno. Error is shown if no
sender or receipient ean is passed in instantiating
an Koha::Edifact::Order object

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e81756b317da848a6e6346a7c0db8f3b986f7058)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f7088ecf4b752f3e61e94ff4738fb04b97d574d2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13272: (follow-up) add missing type="text"
Mark Tompsett [Wed, 26 Sep 2018 22:57:32 +0000 (22:57 +0000)]
Bug 13272: (follow-up) add missing type="text"

This addresses comment #13.
This also applies cleanly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 623f1db90ac8d0361a879813c66a4bccbf0ea23e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 721cefdb95ba6d3f8fb59f6b02255cd76d8a3fbf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13272: (follow-up) Replace tabs with spaces
Mark Tompsett [Wed, 19 Sep 2018 18:49:02 +0000 (18:49 +0000)]
Bug 13272: (follow-up) Replace tabs with spaces

Cleaned up whitespace issues tab vs. space in template.
After applying all patches:
    git diff -w origin/master
For the koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
only the changed type="text" lines will show, but without the
-w, there will be more whitespace changes.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5edd363a1f2e3b1ea34f3f2aa7ace86cbf467df8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 73b197df9ed8e038684e1821ab4d9090d7af225a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13272: (follow-up) fix concerns from comment #5
Mark Tompsett [Wed, 19 Sep 2018 16:48:13 +0000 (16:48 +0000)]
Bug 13272: (follow-up) fix concerns from comment #5

Correct the two issues I pointed out.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 77871b408c9a8e120f8415cc0b32683ee8f57e7d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 49158f3369617b9a4ad8d247308f2a4aea653cde)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13272: Adds type="text" to inputs missing it
Christopher Brannon [Sun, 16 Sep 2018 22:06:10 +0000 (22:06 +0000)]
Bug 13272: Adds type="text" to inputs missing it

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 92a2d74c1c134674b9798981208b9ad5863a6b42)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5fbbdb915f9a41070ff71aac902622f0a7bb5ef7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21289: Fix "isa" bug during partner request
Andrew Isherwood [Thu, 30 Aug 2018 09:52:43 +0000 (10:52 +0100)]
Bug 21289: Fix "isa" bug during partner request

We cannot call 'handle_commit_maybe' inside a 'try' block.
handle_commit_maybe redirects the client then calls 'exit', this is
interpreted as an error and the 'catch' block is erroneously called.

This patch moves the calling of 'handle_commit_maybe' outside the try
block, it will only be reached if everything inside the try block
suceeds.

To test:
1) Enable ILL and have the FreeForm backend available
2) Create a patron category to hold ILL "partners" to whom requests can
be sent. The category can be called anything, you should note the code
you assign
3) Create a patron that belongs to your new category, the patron must
have a primary email defined.
4) In your <interlibrary_loans> block in koha-conf.xml, ensure you have
a <partner_code> element, it should contain the code you assigned in
step 2
5) Create an ILL request using the FreeForm backend
6) Once the request is created, select the "Place request with partners"
button
7) Select your "partner" from the "Select partner libraries" box
8) Click "Send email"
9) TEST: Observe no errors are displayed in the UI

Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fca5a1cb3dba5d6561eaf5f30dfd4d996a4042cc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6bf50445b151ef94e6100da482e5826458a5136b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 16690: Simplify SHOW GRANTS to work when connected
Mark Tompsett [Wed, 8 Jun 2016 02:48:57 +0000 (22:48 -0400)]
Bug 16690: Simplify SHOW GRANTS to work when connected

If the DB is on a remote machine, the web server and the
db server are different, but the SHOW GRANTS code in
installer/install.pl is trying to use the SAME machine.
And even if the permissions were allowed accessing from
both the web and db servers, MySQL won't return the
SHOW GRANTS without access to the mysql.user table. To
install *.* permissions became easiest to get working.
Unless the DB is set up with 'user'@'%', which is also a
potential security issue.

MySQL / MariaDB allow the current connected user to
check their own grants with CURRENT_USER.
There is no need for the installer to know the
IP address of the webserver.

This also removes the need to have permissions for
'koha_kohadev'@'%', because the only process to be
accessing the koha DB is from a known host/ip.
This tightens security too.

TEST PLAN
---------
Install 2 fresh VMs from a Debian ISO.
Make sure they are on the same network (192.168.50.x) as
the kohadevbox. You will need to remember one as DB_IPADDRESS.

On the DB VM & Third VM:
sudo apt-get install mariadb-server mariadb-client net-tools
-- the third vm just needs to be able to run mysql to access
   the DB VM.

On DB VM:
sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf
-- make sure the bind-address line is commented out with a #
sudo service mariadb restart
-- congratulations, your DB server is listening to remote
   calls now.

sudo mysql -u root
CREATE DATABASE koha_kohadev;
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
-- now you have an empty DB ready to run a web install on.
   However, because only koha_kohadev from localhost is
   allowed, we expect failure when we try to run the web
   installation step when we get there.

Let's confirm that everything is working as expected
before trying.  It will also demonstrate the reason why
this patch is superior to the existing code.

On a kohadevbox:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should be denied

On DB VM:
DROP USER 'koha_kohadev'@'localhost';
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

On a kohadevbox:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show two lines based on 'koha_kohadev'@'%';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should give an access denied error.
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should show two lines based on 'koha_kohadev'@'%';
QUIT
-- This case requires the unless code currently in place,
   because we aren't checking CURRENT_USER.

On DB VM:
DROP USER 'koha_kohadev'@'%';
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'192.168.50.10' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

On a kohadevbox:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show two lines based on 'koha_kohadev'@'%';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should show two lines based on 'koha_kohadev'@'192.168.50.10';
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should give an access denied error.
QUIT
-- This case demonstrates that we have two failure points:
       1) The GRANT command by the DB Admin and
       2) The koha-conf.xml setting.
   This is why CURRENT_USER is superior: only (2) is the
   failure point.

On DB VM:
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
SELECT host,user FROM mysql.user;
-- Should see both koha_kohadev for 192.168.50.10 and %.

On a kohadevbox:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show two lines based on 'koha_kohadev'@'192.168.50.10';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should show two lines based on 'koha_kohadev'@'192.168.50.10';
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should give an access denied error.
QUIT
-- This case doesn't need the unless. CURRENT_USER still
   just works.

On an third VM on the same network:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show two lines based on 'koha_kohadev'@'%';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should give an access denied error.
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should show two lines based on 'koha_kohadev'@'%';
QUIT
-- This case demonstrates that it may be more open than a DB
   administrator would prefer. And notice, CURRENT_USER still
   just works.

On DB VM:
DROP USER 'koha_kohadev'@'192.168.50.10';
DROP USER 'koha_kohadev'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'koha_kohadev'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
-- This basically give koha_kohadev free reign to do pretty
   dangerous stuff.

On an third VM on the same network:
mysql -u koha_kohadev -h DB_IPADDRESS -p
-- this should give you a SQL prompt
SHOW GRANTS FOR CURRENT_USER;
-- this should show a line based on 'koha_kohadev'@'%';
SHOW GRANTS FOR 'koha_kohadev'@'192.168.50.10';
-- this should give a no such grant error.
SHOW GRANTS FOR 'koha_kohadev'@'%';
-- this should show two lines based on 'koha_kohadev'@'%';
QUIT
-- This case demonstrates that it may be more open than a DB
   administrator would prefer. And notice, CURRENT_USER still
   just works.

In the old code, both cases were literally checked.
This tweak is an optimization which doesn't require
setting permissions to the mysql.user table. Without it,
the code says the user doesn't have permissions to check
the show grants.  This issue is not visible to the user,
because both cases are checked.

On DB VM:
SELECT host,user FROM mysql.user;
-- for each one do an appropriate DROP USER 'user'@'host';
GRANT ALL PRIVILEGES ON `koha_kohadev`.* TO 'koha_kohadev'@'192.168.50.10' IDENTIFIED BY 'password';

On kohadevbox:
-- Make sure the /etc/koha/sites/kohadev/koha-conf.xml
   points to the DB VM.
-- Make sure a web install runs correctly

On third VM:
-- Make sure unable to connect as koha_kohadev/password.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I have not followed the whole test plan but trusting author and SO
Changes make sense to me

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 013c116d59b14681bff1c18c9225ea4e31627a28)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 67a491a73f0dea1182c937aa424491210a0d0d8b)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21416: 'gr' option missing from ZEBRA_LANGUAGE options in koha-sites.conf
Andreas Roussos [Thu, 27 Sep 2018 04:54:27 +0000 (07:54 +0300)]
Bug 21416: 'gr' option missing from ZEBRA_LANGUAGE options in koha-sites.conf

'gr' (as in 'Greek') is missing from the ZEBRA_LANGUAGE options
in debian/templates/koha-sites.conf. This patch fixes that.

Test plan:
1) view koha-sites.conf and notice how 'gr' is missing from the
   ZEBRA_LANGUAGE options
2) apply the patch
3) observe that koha-sites.conf now includes 'gr' as an option

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 705571a2b870fbb652ca210e32ee3e7ca050e75f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 93b7683780ba6c79ce22307c8c8cbd31f3c73a56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21133: [17.11] RMaint fixup
Fridolin Somers [Wed, 10 Oct 2018 12:22:01 +0000 (14:22 +0200)]
Bug 21133: [17.11] RMaint fixup

6 years agoBug 21133: [18.05.x] Fix use statements order
Jonathan Druart [Tue, 31 Jul 2018 18:24:10 +0000 (15:24 -0300)]
Bug 21133: [18.05.x] Fix use statements order

Basically the idea is:
1. Undefined subroutine &C4::Items::ModZebra called at /home/vagrant/kohaclone/C4/Items.pm line 302.

=> Then use C4::Items before C4::Biblio

2. Undefined subroutine &C4::Circulation::GetItem called at /home/vagrant/kohaclone/C4/Circulation.pm line 1290

=> Then use C4::Circulation before C4::Items

And sometimes these 2 rules do not work...

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6427906fcccea22327db3c1d78847fed5ba9e7fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20785: Advanced Editor does not honor MarcFieldDocURL
Pasi Kallinen [Fri, 24 Aug 2018 08:05:04 +0000 (11:05 +0300)]
Bug 20785: Advanced Editor does not honor MarcFieldDocURL

The advanced MARC editor, Rancor, doesn't obey MarcFieldDocURL.
Make it do so.

Test plan:

1) Enable EnableAdvancedCatalogingEditor
2) Set MarcFieldDocURL to eg. http://{MARC}.example.com/{LANG}/{FIELD}
3) Go to Cataloging -> Advanced editor
4) Go to any field and press Ctrl-H
5) Marc field documentation on www.loc.gov or ifla.org should open
6) Apply patch
7) Repeat 3 and 4. The Marc field docs should open on the URL you set

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ca839922fd4bf3c455454f6dd9182203b1481831)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0f2d80328d74c661ecd318f603a18743e3c699bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21078: overdrive.js Catch error if window.opener is not accessible
Nick Clemens [Sat, 14 Jul 2018 14:29:53 +0000 (14:29 +0000)]
Bug 21078: overdrive.js Catch error if window.opener is not accessible

To Test:
0 - Enable overdrive search results on your koha
1 - From a source develop a link to your koha instance that opens a new
window:
<a target="_blank"
href="http://localhost:8080/cgi-bin/koha/opac-search.pl?q=love">Test</a>
2 - Click that link
3 - Note Overdrive results do not load
4 - Note error in JS console
5 - Apply patch
6 - Click the link again
7 - Note OD results load
8 - Note no error in console

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6975a6836a21f42675a9394602246891c19d9522)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 20b0ca1f63c6ad97a05476236036996058b784c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20241: Fix display of publication year in subscription record search for MARC21
Katrin Fischer [Sat, 11 Aug 2018 23:55:35 +0000 (23:55 +0000)]
Bug 20241: Fix display of publication year in subscription record search for MARC21

The old problem: UNIMARC uses biblio.publicationyear, MARC21 uses
biblio.copyrightdate. Patch adds a fallback, if there is nothing
in publicationyear, copyrightdate will be displayed.

To test:
  - In a MARC21 database
  - Add a new subscription
  - Search for records
  - Verify the publication year column remains empty
  - Apply patch
  - Repeat search
  - Verify that the year now shows

https://bugs.koha-community.org/show_bug.cgi?id=20421

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8df47bdde678773f028f312b4cd8000a12425281)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 419f889bb0e0220d81b9883d27aeea128a5b8888)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21362: Advanced editor: Fix tab navigation in fixed fields
Ere Maijala [Fri, 13 Oct 2017 11:07:21 +0000 (14:07 +0300)]
Bug 21362: Advanced editor: Fix tab navigation in fixed fields

Also minor tweaks to how the fields look.

Test plan:

1. Try moving from field to field and inside control fields with tab/shift-tab.
2. Make sure focus doesn't get stuck in any position.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 024643f51c4e0ca1803dd5013bb857e98cd924e5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e74f433418e4494c68e996c6d1061d485d67c49e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 16739: Show note instead of 500 error for 'Generate EDIFACT' when no EDI account...
Jon Knight [Mon, 14 May 2018 15:30:55 +0000 (15:30 +0000)]
Bug 16739: Show note instead of 500 error for 'Generate EDIFACT' when no EDI account is configured

When a book seller (vendor) does not have EDI account information configured
the basketgroup display still shows a button to generate EDIFACT output which
results in 500 error when clicked.  This patch fixes two aspects of this:

a) it stops the button being displayed in the first place, replacing it with
a message that explains there is not EDIFACT configuration for the vendor.

b) if, somehow, an edifact print operation is passed to the basketgroup
script it detects the lack of an EAN and redirects back to the basket group
display page with a warning message.

To test:
1) Create a vendor with no EDI details.
2) Create a basket with some items in, then close it and add it to a basket
   group for this vendor.
   3) Go to that vendor's basket groups, click on the "Closed" tab and then
      click on the 'generate edifact order' button. You should get a 500 error.
   4) Apply this patch.
   5) Repeat 3, except this time you should find that the 'generate edifact
      order' button has been replaced with a note that there is
      "No EDIFACT configuration for <vendor>".

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 121b8105bcb00909b1e8081442148c1939c101a6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 43b6644818f71c2d3c4bf09c6c40b36f5c0522c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21398: Make search field mandatory when adding to a basket from an existing record
Jonathan Druart [Sat, 22 Sep 2018 14:08:16 +0000 (11:08 -0300)]
Bug 21398: Make search field mandatory when adding to a basket from an existing record

Test plan:
- Create a basket
- Click the "Add to basket" button
- Click "Search" on the first line
=> Without this patch you get an ugly screen: https://snag.gy/U8X3ZK.jpg
=> With this patch applied you will not be able to submit without
filling the input in

QA note: Yes, we could handle that controller side as well, but much
more work.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bf89e4e124fb38982fa8b9708af1fb67fd16f982)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 01588a68aa74c6fe32329178840e9cc542e2829c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20616: (QA follow-up) Make alert translatable
Katrin Fischer [Mon, 23 Apr 2018 04:15:56 +0000 (04:15 +0000)]
Bug 20616: (QA follow-up) Make alert translatable

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 582d566aac5af0dbb065b9f057e43eb5ccb19a1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20616: Prevent "edit serials" form submission if no serial is selected
Jonathan Druart [Mon, 23 Apr 2018 19:19:50 +0000 (16:19 -0300)]
Bug 20616: Prevent "edit serials" form submission if no serial is selected

In order to prevent the form to submit and gives an ugly error if no
issues are selected we will make sure at least one is checked otherwise
an alert will be displayed.

Test plan:
- create a subscrpition
- go to the serials collection page
- don't check any checkboxes for serials
- click 'Edit serials'

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
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 e14ee4ad0a033354052726ff401f8ee4f64dd2b9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21407: Can't enter new macros in the advanced cataloging editor (rancor)
Owen Leonard [Tue, 25 Sep 2018 13:51:02 +0000 (13:51 +0000)]
Bug 21407: Can't enter new macros in the advanced cataloging editor (rancor)

This patch upgrades Codemirror to the latest version (5.40.2). Doing so
fixes a problem with the advanced cataloging editor's macro editor which
appears in the latest version of Firefox (62): The first line of the
macro editor is not visible.

To test, apply the patch and clear your browser cache if necessary.
EnableAdvancedCatalogingEditor must be set to "Enable."

- Go to Cataloging -> Advanced editor.
- Click the "Macros" toolbar button.
- In the main part of this modal window you should see a blank line
  marked "1."
- Click "New macro..."
- The editor's line 1 should now be editable. Enter text to confirm that
  it works correctly.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 01470fab9eabd3750746b540389de7a6d85fda05)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9fbd65ca5228641042975169e8217a0f14ac28c4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21297: Display public lists to existing lists when adding a new item
Jonathan Druart [Fri, 14 Sep 2018 22:56:44 +0000 (15:56 -0700)]
Bug 21297: Display public lists to existing lists when adding a new item

If there are no private lists the public lists are not displayed.

Test plan:
1) Add 10 public lists (This is when the 'More lists' menu item becomes
view-able)
2) Select an item
3) Click Add to list
4) Select 'More Lists' menu item
5) Note that 'Select an existing list' is an available option

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 33010595113b5ec279f93b1127d20b466e1ea023)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5d677af3b4b5095145c359f69f6304f24fe2d590)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20669: Add upgrade method to plugins
Kyle M Hall [Thu, 26 Apr 2018 19:07:07 +0000 (15:07 -0400)]
Bug 20669: Add upgrade method to plugins

It would be nice if plugins had an upgrade method to handle altering tables and such when a new version of a plugin is installed. Right now it must be done in a completely bespoke manner.

Test Plan:
1) Apply this patch
2) Download the 2 most recent releases of the Kitchen Sink plugin
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases
3) Install the earlier release
4) Look at the configuration page, at the bottom it should say the
   plugin has never been upgraded
5) Install the newer release
6) Reload the configuration page, it should now say that the plugin
   was upgraded and give you the date and time of the upgrade

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 100385196ecadb34669190caa241ed73ea2a5a1c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b3f2a13a4368d9f8bec74a6da920649d56732b71)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21397: Mark "Routing list" tab as active when selected
Jonathan Druart [Fri, 21 Sep 2018 21:35:06 +0000 (18:35 -0300)]
Bug 21397: Mark "Routing list" tab as active when selected

/members/routing-lists.pl?borrowernumber=5 show the different tab of the
menu but "Routing lists" is not displayed as the selected one (active).

"routinglistview" must be set and passed to the template

Test plan:
Enable the RoutingSerials pref
and hit /members/routing-lists.pl?borrowernumber=42

The "Routing lists" tab must be selected/active

Followed test plan and tab now shows as active.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 270a408949e69b97aff87a208a559c4736e20426)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1d9377b11a509b7e273aa71545a4181b04804ab1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21038: Reserves should be holds
Owen Leonard [Mon, 16 Jul 2018 18:41:13 +0000 (18:41 +0000)]
Bug 21038: Reserves should be holds

This patch corrects the text of the warning about discharges cancelling
holds.

To test, apply the patch and view the discharge for a patron who has
holds:

 - "Borrower" is changed to "patron"
 - "reserves" is changed to "holds"
 - "canceled" (18 instances in the templates) is changed to "cancelled"
   (51 instances).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8202f95ad7001a5046f9f40e6322406b253ba3ed)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 585a10e070136b231d88b8ff4099b4085a2b656c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21141: Handle non-existent itemnumbers in batch item modification/deletion
Jonathan Druart [Mon, 6 Aug 2018 18:26:49 +0000 (15:26 -0300)]
Bug 21141: Handle non-existent itemnumbers in batch item modification/deletion

The itemnumber list passed from a file in the batch item
modification/deletion tools is not tested.
Like barcodes we should make sure they refer to a valid items in the DB.

Test plan:
- Create a file with barcodes, itemnumbers and random lines
- Use the batch item modification and deletion tools with this file
You should see a table with a list of invalid barcodes and itemnumbers.

Without this patch you got the following error:
Can't call method "title" on an undefined value at
/home/vagrant/kohaclone/tools/batchMod.pl line 580

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e8e29d3140007b9b92d97ed2f1df7445c6eeb4f9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 54d960cb86b91bb21cc7c92e1feef9970faaf8a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19500: Add missing span for 'other'
Jonathan Druart [Fri, 17 Aug 2018 16:20:04 +0000 (13:20 -0300)]
Bug 19500: Add missing span for 'other'

To stay consistent in the DOM structure it would make sense to have it
there as well

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 717cb3f893e33a1f54299abbd81a5f9bc339a225)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9520e771374d5416595b182608209639f23b6b1b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19500: (QA follow-up) Add spans to ease translation
Katrin Fischer [Sun, 12 Aug 2018 19:42:30 +0000 (19:42 +0000)]
Bug 19500: (QA follow-up) Add spans to ease translation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a0d775b9cce90b6a029bd92eb3971383a05f55e2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f024667a0e32e8fc754c1bebfbaed6df82548e12)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19500: Make module names on letters overview page translatable
Katrin Fischer [Fri, 10 Aug 2018 22:54:11 +0000 (22:54 +0000)]
Bug 19500: Make module names on letters overview page translatable

While the module pull down on adding and editing a letter is
written out and fully translatable, the overview page showed
the internal 'module code'.

Patch also renames the "Members" module into the "Patrons" module
to match Koha's terminology.

To test:
- Before applying the patch:
  - Add or edit a notice, look at the pull down for module
  - Go back to the overview page
  - Verify the module names don't match
- Apply the patch:
  - Check again, pull downs should now match
  - Verify that Members is now Patrons everywhere

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5e9480937ae0a4bb901330138e1760d690d5f548)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1015a6e416ce99ca6060583085a25ea183d99017)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20994: Fix capitaization "Save to Lists"
Katrin Fischer [Wed, 8 Aug 2018 20:28:29 +0000 (20:28 +0000)]
Bug 20994: Fix capitaization "Save to Lists"

On the OPAC result list, below each result, there is a link:
"Save to Lists".

Patch changes this to "Save to lists" following our
capitalization rules.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d5296743a4b4e6e6004bdb68926a3584e55435e4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit acba1272764455af6164daa8e9246561b7b41bd3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoRevert "Bug 21353: Display checkboxes to merge patron even if cannot manage lists"
Fridolin Somers [Wed, 3 Oct 2018 13:41:59 +0000 (15:41 +0200)]
Revert "Bug 21353: Display checkboxes to merge patron even if cannot manage lists"

This reverts commit 63ab79d6e478d42f13ac48f62828a1059dff1aad.

6 years agoRevert "Bug 21353: (follow-up) same check for select/clear all links"
Fridolin Somers [Wed, 3 Oct 2018 13:41:49 +0000 (15:41 +0200)]
Revert "Bug 21353: (follow-up) same check for select/clear all links"

This reverts commit 3ef1e4ac01ceadc2721449b668dc0da376b6f3c0.

6 years agoBug 5458: DBRev 17.11.10.001
Nick Clemens [Wed, 26 Sep 2018 16:17:06 +0000 (16:17 +0000)]
Bug 5458: DBRev 17.11.10.001

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b5becc84f5f2e8f82b765b5ebf3f87a84d89cfd8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d0affd28266fb9e7461521c703dd640e19c82b99)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 5458: increase ccode column to varchar 80
Fridolin Somers [Tue, 4 Sep 2018 08:40:29 +0000 (10:40 +0200)]
Bug 5458: increase ccode column to varchar 80

Koha allows you to define an authorised value having length 80, but then you
can't use it.

Here is why:
The SQL field items.ccode is a varchar(10).
The SQL field authorised_values.authorised_value is a varchar(80).
Therefore the authorised value is truncated to length 10 in items.ccode and the mapping from authorised value to description string fails in Koha.

This patch increases ccode column to varchar 80, like location.

Test plan :
1) Dont apply patches
2) Check there is on item field a subfield with authorised value category CCODE
3) Check this subfield is linked with database column items.ccode
4) Create an authorised values in category CCODE with 'DOCUMENTATION'
5) Edit an item on ccode and choose 'DOCUMENTATION'
6) Save item
7) Look at items.ccode in database or export in MARCXML
8) The value is troncated to 'DOCUMENTAT'
9) Apply patches and update database with installer/data/mysql/atomicupdate/bug_5458.sql
10) Repeate step 5 to 7
11) The value is not truncated 'DOCUMENTATION'

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c59ef0452ccbae17de3b839da4fa2c9f7f6b2e6f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 892492cbda442564a33b1abdf374d43c024de22c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20023: (QA follow-up) Tiny simplification
Marcel de Rooy [Fri, 21 Sep 2018 09:38:15 +0000 (11:38 +0200)]
Bug 20023: (QA follow-up) Tiny simplification

Remove empty emails from the list rightaway.
Would be tempted to lc the params->{email} at the start btw..

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit eec74a2cd1847a859b4fab37c42882ba192ee560)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c5bb4d6529f9dcd2457639c8b7735dfc7001d244)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20023: Password recovery using email should be case insensitive
Blou [Mon, 17 Sep 2018 20:34:19 +0000 (16:34 -0400)]
Bug 20023: Password recovery using email should be case insensitive

When entering an email to recover the password, a user should not have to know or remember the casing of the given email.

Test
0) enable OpacResetPassword
1) On the OPAC, click "Forgot your password"
2) Enter your email address as in your user account BUT WITH A DIFFERENT CASING
3) Submit.  This will fail.
4) Apply the patch, redo with success.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit cc3bc2920744e35256b45b784c9788a64fe6dd04)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0f019c89c18733c0e0220f41012a06c3b39df595)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21196: Use replacement cost from the item type if not set at item level
Jonathan Druart [Mon, 13 Aug 2018 15:40:22 +0000 (12:40 -0300)]
Bug 21196: Use replacement cost from the item type if not set at item level

When circ rules are set to cap at item replacement cost, calcfine only
checks the price in the item record, not the default replacement cost by
item type.

Note: We do not take '0' into account, what if you do not want to set
a replacement cost for an item? It is how it is done in chargelostitem
so keeping the existing behaviour, but that may be considered as a bug (?)

Test plan:
- Set useDefaultReplacementCost to use
- Set a default replacement cost for a given item type
- Create an item of that type with a replacementcost=0
- Create a circ rule for that item type that accrues fines but caps at
replacement cost
- check the item out, forcing a due date in the past
- check that item in
=> Fines should have been generated

Signed-off-by: Caroline Cyr La rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a62742f4260425af8e69a88822b7affc9cc93c68)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 43b671ac858e9ae63b3ce8e74e555a41600bc383)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21196: Add tests
Jonathan Druart [Mon, 13 Aug 2018 15:36:41 +0000 (12:36 -0300)]
Bug 21196: Add tests

Signed-off-by: Caroline Cyr La rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d415e51180cac0152c2ab0f95e846b196883f42e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fe4c609d3224f3f71e4a000e2f7857efbefb71ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21353: (follow-up) same check for select/clear all links
Jonathan Druart [Sun, 16 Sep 2018 17:41:49 +0000 (10:41 -0700)]
Bug 21353: (follow-up) same check for select/clear all links

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bf908a5f07ffbd492c42483aace120dae8316048)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 28a404bc3124cb45863db8872cb0ee7c839fda5d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21353: Display checkboxes to merge patron even if cannot manage lists
Jonathan Druart [Sat, 15 Sep 2018 18:02:05 +0000 (11:02 -0700)]
Bug 21353: Display checkboxes to merge patron even if cannot manage lists

When permission 'manage_patron_lists' is off, there is no checkbox on
/cgi-bin/koha/members/member.pl to merge patrons.

Test plan:
Remove permission manage_patron_lists
Add permission edit_borrowers
Search for patrons
=> Without this patch you will not be able to select patrons to merge
(checkboxes are not displayed)

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d60b0a2e4d3359c127f1e801db9e35dd217f8790)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ffbd4d22e134ba9c1af511dcb0a56a4473f1a789)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21323: Handle multi params in redirect after login
Jonathan Druart [Fri, 14 Sep 2018 23:10:56 +0000 (16:10 -0700)]
Bug 21323: Handle multi params in redirect after login

Multi params are not handle correctly after login

Test plan:
[0] Use staff interface
[1] Use advance search and tick itemtype more than one checkbox
[2] Copy result url
[3] Logout
[4] Paste url in browser
[5] Type username and password
[6] In search result page, results limit description under breadcrumbs
will show all limits

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c6a26d2c9e767623c7bc0698297bbc165301e7ed)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c088efd6c959d12dd8c1743e3eeb9f12d41a77e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21281: (QA follow-up) Introduce _add_backtics
Marcel de Rooy [Fri, 21 Sep 2018 07:15:08 +0000 (09:15 +0200)]
Bug 21281: (QA follow-up) Introduce _add_backtics

Added a (initially trivial) test in Creators/Lib.t too.
Sometimes you start something, but you end somewhere else ;)

The test seems a bit slower now (regex, lookahead, etc). But this should
not hurt label creators in daily use.
Advantages: code is even more solid, consolidated in one place and can be
tested on its own.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit db683b285cfb31deb9dbdafbc5a18e0b471ffa65)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 75b0e7a0787d82caa987afc67206fad2b5811e4c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21281: Correct t/db_dependent/Creators/Lib.t failures
Mark Tompsett [Wed, 5 Sep 2018 18:41:32 +0000 (18:41 +0000)]
Bug 21281: Correct t/db_dependent/Creators/Lib.t failures

TEST PLAN
---------
1) apply first patch
2) kshell kohadev
3) prove -r -v t/db_dependent/Creators/
   -- failures
4) apply this patch
5) repeat 2,3
   -- no failures
6) run koha qa test tools

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 78124100ec6708de99bea3e4e181da3897130d0e)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a54c1b9a1ca86dcab11e4008727221edc42eb69a)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21281: Surround creator_templates.rows with backquotes
Jonathan Druart [Wed, 29 Aug 2018 20:05:50 +0000 (17:05 -0300)]
Bug 21281: Surround creator_templates.rows with backquotes

'rows' is a reserved word since MariaDB 10.2.4 and MySQL
https://mariadb.com/kb/en/library/mariadb-1024-release-notes/
https://dev.mysql.com/doc/refman/8.0/en/keywords.html

Test plan:
Do not apply this patch and make sure you recreate the reported issue
Apply this patch and confirm that it is now fixed.

QA will take care for the changes in installer and test files

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7de47202f2876892524c8b68de962c0776f32881)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9f306898886efe1c2a29f2b622885ec1dfa4fe9a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 18635: Unit tests
Nick Clemens [Fri, 19 May 2017 01:07:11 +0000 (21:07 -0400)]
Bug 18635: Unit tests

I also adjust a few tests that assume value of $nb_of_patrons to not
rely on existing datas

To test:
1 - Apply this patch only
2 - Prove t/db_dependent/Koha/Patrons.t
3 - Tests fail
4 - Apply other patch
5 - Tests pass

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ac0f3b880a4220317ddde107c508c32f75b09aa1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2e2d4b26a43e54d7e97a4da03cc294486d7c7922)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoUpdate release notes for 17.11.10 release v17.11.10
Fridolin Somers [Mon, 24 Sep 2018 14:15:04 +0000 (16:15 +0200)]
Update release notes for 17.11.10 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoIncrement version for 17.11.10 release
Fridolin Somers [Mon, 24 Sep 2018 14:10:00 +0000 (16:10 +0200)]
Increment version for 17.11.10 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoMerge remote-tracking branch 'translate/17.11.10-translate-20180924' into 17.11.x
Fridolin Somers [Mon, 24 Sep 2018 14:08:49 +0000 (16:08 +0200)]
Merge remote-tracking branch 'translate/17.11.10-translate-20180924' into 17.11.x

6 years agoBug 21288: correct DBRev 17.11.09.003
Fridolin Somers [Mon, 24 Sep 2018 14:05:35 +0000 (16:05 +0200)]
Bug 21288: correct DBRev 17.11.09.003

6 years agoTranslation updates for Koha 17.11.10
Koha translators [Mon, 24 Sep 2018 14:02:25 +0000 (11:02 -0300)]
Translation updates for Koha 17.11.10

6 years agoBug 13692: series link is taking you to just 800a instead of whole 800
Owen Leonard [Fri, 3 Aug 2018 15:13:57 +0000 (15:13 +0000)]
Bug 13692: series link is taking you to just 800a instead of whole 800

This patch modifies the OPAC and staff client's XSL template for the
detail page so that series links based on a traced 490 tag use both
author and series title from the 800 tag.

To test you should have multiple titles in the same series with matching
490 and 800 tags in each record. Apply the patch and restart Plack if
necessary.

View the detail page for one of the series' titles. The "Series:" link
should link to a search which uses both series title and author.
Clicking the link should return the correct results.

Test both the OPAC and staff client.

Signed-off-by: John Sterbenz <jsterben@umich.edu>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit cf5a92461835725fe44bb726c98bcfbf909dfdc8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 145eef6a9037b93cd8902f0a77582fcadbf517bc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21262: Do not format numbers for editing if too big
Nick Clemens [Thu, 23 Aug 2018 14:44:31 +0000 (14:44 +0000)]
Bug 21262: Do not format numbers for editing if too big

This patch copies the code from bug 15770 to the format_for_editing
sub.

It also corrects schema issue, listing the purpose for two acq columns
instead of claing unused

To test:
1 - Edit a fund
2 - Set warning at amount to: 100000000000000
3 - Save budget
4 - Try to edit - internal server error
5 - Apply patch
6 - Should be able to edit budget
7 - Number should appear unformatted

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 quick notes:
1. Code must be moved to a subroutine if reused later
2. It would have prefered to have the comment of the 2 DB columns on a separate patch
(even separate bug report). As it's minor and that the patch will certainly backported
I will not block it.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7a84297ac4b29f4bdaf1bc4d01def71eb924d4fa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ad16c9f5b20525303eb631107883cb37e36de8cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21360: Prevent IssueSlip.t to fail when run at 23:59
Jonathan Druart [Sun, 16 Sep 2018 16:49:46 +0000 (09:49 -0700)]
Bug 21360: Prevent IssueSlip.t to fail when run at 23:59

Not sure what happened on bug 15029 (Make the IssueSlip tests pass even if
launched after 23:00) but we should have tested with 23:59, not 23:50...

koha_1       |     # Looks like you planned 3 tests but ran 2.
koha_1       |
koha_1       | #   Failed test 'Issue slip'
koha_1       | #   at t/db_dependent/Members/IssueSlip.t line 294.
koha_1       | Label not found for "last SKIP" at /usr/share/perl5/Test/More.pm line 1370.
koha_1       | # Looks like your test exited with 255 just after 1.
koha_1       | [23:59:10] t/db_dependent/Members/IssueSlip.t
koha_1       | Dubious, test returned 255 (wstat 65280, 0xff00)
koha_1       | Failed 3/3 subtests

Test plan:
0/ Don't apply this patch
1/ sudo date -s "2018-09-15 23:59:00";prove t/db_dependent/Members/IssueSlip.t
=> You should get the error
2/ Apply this patch and repeat 1.
=> Tests should pass now!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 60788555b3d79902ccef9f20cf76d4c764efcba0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c28d8f0600806f9930d115b2fdbccc21f5e86436)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21288: DBRev 18.05.03.002
Nick Clemens [Sat, 15 Sep 2018 21:44:05 +0000 (21:44 +0000)]
Bug 21288: DBRev 18.05.03.002

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 11e513f83f0c5fdd0d47de14b7c09635faf58ae4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 44ce16d0069fdff7b487753277c11d368a083ccb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21288: Slowness in acquisition caused by GetInvoices
Pasi Kallinen [Thu, 30 Aug 2018 08:29:54 +0000 (11:29 +0300)]
Bug 21288: Slowness in acquisition caused by GetInvoices

The SQL query done by GetInvoices is quite slow on our production server,
taking about a minute.

In the query, there's this join:

  LEFT JOIN subscription ON biblio.biblionumber = subscription.biblionumber

but there's no index on subscription.biblionumber. Adding the index speeds
up the query so it only takes up about 3 seconds.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit cb406f72b0266c97ac904754cc9637035000f5ca)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40536fedd39a0a22c3e93a00721b573d66392e09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20765: Fix search for items by acqdate in label batch
Fridolin Somers [Mon, 14 May 2018 14:18:29 +0000 (16:18 +0200)]
Bug 20765: Fix search for items by acqdate in label batch

In Tools >  Label creator, when creating a batch you can add items using a search.

This search has filters on acquisition date.
Actually those filters does not work.
The create a search using CCL syntaxe to query Zebra search engine.

The cause is that operator "ge" or "le" must be before "st-date-normalized" in CCL query.
Looks like it is because of "st-date-normalized" uses "r=o" in ccl.properties.

Test plan :
1) Check in advance search you have indexed acquisition date
2) Go to Tools > Label creator
3) Click on New > Label batch
4) Click on Add item(s)
5) Enter a relevent date in "Added on or after date" and in "Added on or before date"
6) Click on "Search"
=> SUCCESS: You get results
7) Apply the patch
8) Retry the 'Add item(s)' step
=> SUCCESS: Patch doesn't change behaviour for old Zebra
9) Get rid of the patch on your working branch
10) Use the latest Zebra:
- /etc/apt/sources.list.d/indexdata.list:
deb http://ftp.indexdata.dk/debian jessie main
- Add the repo key:
  $ wget http://ftp.indexdata.dk/debian/indexdata.asc -O- | sudo apt-key add -
- Upgrade:
  $ sudo apt update; sudo apt dist-upgrade
  $ sudo koha-rebuild-zebra -f -a -b -v kohadev
  $ restart_all
11) Retry the 'Add item(s)' step
=> FAIL: No results!
9) Apply the patch, retry
=> SUCCESS: Search results!
- Sign off :-D

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
It doesn't break with 2.0.59-1 (stretch/jessie), and fixes the problem
for 2.1.X.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a6f8eac4edb6463d8ff16928d6f2cddcf4dfbfc2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 06f0209840d290bb1a7340f4b1af8d55e932f7c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19179: (QA follow-up) Replace second E-mail
Marcel de Rooy [Fri, 14 Sep 2018 09:53:37 +0000 (11:53 +0200)]
Bug 19179: (QA follow-up) Replace second E-mail

Better write here exactly what we need to type in the pref text box.
Since E-mail will not work and Email will :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b0ef7174fe601bbf39408e455365ea563949b4bb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 31db0813d36f21a0c898b75841a3e34364619a84)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19179: Email option for SMSSendDriver is not documented
Charlotte Cordwell [Fri, 7 Sep 2018 03:35:36 +0000 (03:35 +0000)]
Bug 19179: Email option for SMSSendDriver is not documented

'Email' is not documented as a valid setting.

1) Apply patch.
2) Go to Administration --> search SMSSendDriver
3) Check if SMSSendDriver has this message is at the end of the box:
   "If you would prefer to receive SMS via E-mail set SMSSendDriver to Email"

Signed-off-by: Michal Denar <black23@gmail.coml>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2d6cf8bd7a0e290c8bb947ed1880f1e906d0e74c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9f221f9ae8b16846bd3b9b35b19d4b5434050f95)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21127: Remove jqTransform jQuery plugin from the OPAC
Owen Leonard [Fri, 27 Jul 2018 12:43:50 +0000 (12:43 +0000)]
Bug 21127: Remove jqTransform jQuery plugin from the OPAC

This patch removes the jqTransform jQuery plugin from the OPAC. It was
added for the CCSR theme, which no longer exists.

http://git.koha-community.org/gitweb/?p=koha.git;a=commit;h=c7c2e9efbde273f2b77786316b7502a8847072bd

There will be no visible changes to the OPAC after applying the patch.
Search the Koha codebase for references to jqTransform and confirm that
none exist.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 83e515820abb6e2fa8ddf30f61b3f4972a48ed10)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 903b880f330026d476d761901a2099972159a94c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21248: Fix COinS carp in MARC details page on unknown record
Pasi Kallinen [Mon, 20 Aug 2018 04:30:45 +0000 (07:30 +0300)]
Bug 21248: Fix COinS carp in MARC details page on unknown record

Looking up a nonexistent record in the MARC details -page causes
the COinS to carp. The fix is trivial, just move the COinS call
couple lines, after the record existence check.

TEST PLAN
---------
1) reset_all for kohadevbox
2) log in to staff client - admin/admin
3) search catalogue for green
4) tweak the top URL to have a bad biblionumber (eg. 9999)
5) cat /var/log/koha/kohadev/plack-err.log
   -- floody! with errors.
6) echo | sudo tee /var/log/koha/kohadev/plack-err.log
7) restart_all
8) repeat steps 2 through 5.
   -- just nice starting messages, not floody.
9) run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 030047da428521c248868e3ee5d655afd3bed05b)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7fe692bf0ec4dd6744c81c068c400927ccc0c54d)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13779: (QA follow-up) Correct checkauth call in offline_circ/download.pl
Marcel de Rooy [Fri, 7 Sep 2018 07:50:40 +0000 (09:50 +0200)]
Bug 13779: (QA follow-up) Correct checkauth call in offline_circ/download.pl

Script offline_circ/download.pl does not use the return values of
checkauth. So should not assign them to bad chosen variables that do
not correspond with checkauth but with get_template_and_user.

Test plan:
Look for $template, $loggedinuser, $cookie, $flags in the code.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bf7082f854a1db9eb5b7eb77e5f450d018d8e07b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ee2d5ae04dc4c5fed9f09c9067c3de0037cdba8e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 13779: sessionID declared twice in C4::Auth::checkauth()
David Cook [Thu, 19 Jul 2018 06:57:22 +0000 (16:57 +1000)]
Bug 13779: sessionID declared twice in C4::Auth::checkauth()

The bug is that $sessionID is declared twice in C4::Auth::checkauth().
At the moment, this doesn't actually create a problem, because no
one seems to be using the $sessionID which is returned by checkauth(),
except in the case of opac/external/overdrive/auth.pl which skips
the second declartion as it doesn't require auth.

This patch removes the redefining of the $sessionID variable.

In terms of testing, try logging in with a username and password
and see if it works. The only risk this patch would pose is breaking
auth I would think, since nothing is actually using the return value
from checkauth() for $sessionID.

NOTE:
It was initially defined near the top of the function (~line 791).
I believe the scoping would mean the correct version of $sessionID
would be used in the latter lines for the unset'ing.
I have skimmed code to see if the sessionID return value is used.
I did not test overdrive, as I do not know how. However, this is
the only area, I think this could possibly break. This change makes
sense to me.

QA: Please test overdrive.
opac/external/overdrive/auth.pl only checks if the value is set, so
   this patch might fix/break something there?
opac/svc/overdrive same kind of check.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This is a (tiny) code improvement. Now we consistently return the session
id that is also stored in the returned cookie. (Which can be an 'anon'
session.)
Fact is that Koha almost everywhere ignores the returned session id and
sometimes gets the session from the cookie (obviously). The session id is
also passed to the template by get_template_and_user but never used in
templates.
As mentioned, the two overdrive scripts are the exception. But since both
test on both $user && $sessionID, they will not choke on an anynonomous
session id without userid. So theoretically fine, but not tested.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 331af8521b5fba4b5553c182888a4017b2ce9c3a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 89f6aacecc787affd07856d6c092f21bacab7993)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20776: Add Selenium::Remote::Driver to the dependency list
Tomas Cohen Arazi [Thu, 17 May 2018 13:33:32 +0000 (10:33 -0300)]
Bug 20776: Add Selenium::Remote::Driver to the dependency list

This dependency is missing from the PerlDependencies.pm file.
This patch adds it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 418c65d2e28eb6a2c9e3bb56505918434cf5f04c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1c58af16bedfe8502c0afb83912b2e4661871b93)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21267: Set X-FORWARDED-PROTO https if required
Tomas Cohen Arazi [Fri, 24 Aug 2018 13:45:52 +0000 (10:45 -0300)]
Bug 21267: Set X-FORWARDED-PROTO https if required

This patch makes the apache configuration for the reverse proxy
(required for Plack) so it sets the X-FORWARDED-PROTO header correctly
for Plack::Middleware::ReverseProxy to use it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Ulrich Kleiber <ulrich.kleiber@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Since we actually resolve 19799 now (Changing language on OPAC redirects
back to homepage), I will move that code to a new enh report.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 302dd7bf8233ebf640bfde82fc050f8b08b2757c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ee1eec9d255e3a9341c9e17558d6d1f835add5ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21168: Handle deleted checked-in items on checking in
Jonathan Druart [Fri, 10 Aug 2018 20:02:38 +0000 (17:02 -0300)]
Bug 21168: Handle deleted checked-in items on checking in

circ/returns.pl generates a server error when attempting to checkin an item while
the list of previously-returned items contains an item that has been deleted.
Error text: Can't call method "biblio" on an undefined value at /usr/share/koha/intranet/cgi-bin/circ/returns.pl line 606.

Test plan:
- checkout two items
- checkin item1
- on a separate tab, delete item1
- on the original tab (which still shows item1 in the list of Checked-In Items), attempt to check in item2
=> No error appears

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 823c76cdc58b7b80b365a4f313fed3462f0df720)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a87364d0ffbf906a4888f5d6d66e1a74cf280f58)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21231: BlockReturnofLostItems does not prevent lost items being found
Kyle M Hall [Thu, 16 Aug 2018 11:11:17 +0000 (07:11 -0400)]
Bug 21231: BlockReturnofLostItems does not prevent lost items being found

When the syspref BlockReturnOfLostItems is set to Block, the item is blocked from being returned, but is still considered found -- it's set to lost=0 and a refund is applied to the patron (if circ rules allow). The item can then be checked in a second time and returned as it is no longer lost.

Test Plan:
1) Set an item to lost
2) Set BlockReturnOfLostItems to Block
3) Check the lost item in
4) Checkin  message should say item is lost and cannot be returned
5) Check lost status of item, it should remain unchanged

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ca2430480eaa4338b3e4aed766589b1406565d69)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3af501884e136454bca1c5a78c1a6b56e876f6be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21231: Add Unit Test
Kyle M Hall [Thu, 16 Aug 2018 11:10:43 +0000 (07:10 -0400)]
Bug 21231: Add Unit Test

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 44d7063209137696d0c844ff82880a973029e534)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1bb7e7c0167be0feffc86b574620c5fc65120993)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20984: Add 300$f to display
Joy Nelson [Fri, 22 Jun 2018 20:48:25 +0000 (13:48 -0700)]
Bug 20984: Add 300$f to display

Adding Type of Unit (300$f) to the Opac details and staff side searches results and details display

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a122a5333445299da8a01e47a65b25f733e6ce7c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 516d156bb2aec724e429414f7053e3a2f8fffda1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 17625: adding subfields f and g to XSLT display
Joy Nelson [Fri, 22 Jun 2018 18:56:11 +0000 (11:56 -0700)]
Bug 17625: adding subfields f and g to XSLT display

Adding 245$f and 245$g to the Results and Detail pages on OPAC and staff side

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
Signed-off-by: Cab Vinton <bibliwho@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fe9c6450979b5b7fd05821dd22c523ea6d10d3cd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7a53a3defe45099f02c0bbb4d077e01303feca38)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21150: add the biblionumber to the output
Jonathan Druart [Tue, 7 Aug 2018 14:14:54 +0000 (11:14 -0300)]
Bug 21150: add the biblionumber to the output

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 76141a352ed5ff8c9541c0d4b1c99e22e5339add)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit bacb859d1c637b7d9d32b2205c97cc00557e9888)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21150: Search for item types inconsistencies
Jonathan Druart [Fri, 3 Aug 2018 17:59:33 +0000 (14:59 -0300)]
Bug 21150: Search for item types inconsistencies

search_for_data_inconsistencies.pl will now display errors if:
1.item-level_itypes is set to "specific item" and items.itype is not set
or not set to an item type defined in the system (itemtypes.itemtype)
2.item-level_itypes is set to "biblio record" and biblioitems.itemtype is not set
or not set to an item type defined in the system (itemtypes.itemtype)

Test plan:
Use the script and the different possible combinations to display the
errors

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6fd1a8c11484e8c1cd771aea0c6ac98a2ab18f40)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 41b06b411c3ad2a5006980507c344c568357c752)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20509: Add to script documentation
Katrin Fischer [Tue, 31 Jul 2018 16:23:43 +0000 (16:23 +0000)]
Bug 20509: Add to script documentation

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9b73cc22890aadae0fa6afd9d82d5109cc47fd80)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7ba665179bb35a3ddf940f506e5dfed06f11b346)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20509: Search for not defined authority codes
Jonathan Druart [Wed, 27 Jun 2018 18:35:57 +0000 (15:35 -0300)]
Bug 20509: Search for not defined authority codes

This patch adds a new check in
misc/maintenance/search_for_data_inconsistencies.pl to search for not
defined authority codes.

Test plan:
Set some auth_header.authtypecode to not defined authority codes in Koha
(UPDATE auth_header SET authtypecode="XXX" WHERE authid=42;)
Then run `misc/maintenance/search_for_data_inconsistencies.pl`

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9558a118dacd74b77c27f63fc41611945aeff052)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c2387c58f1a4d2ed2fd1180957871634ae5f93ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21011: (follow-up) Fix pod, fix missing homebranch condition, change mode to...
Josef Moravec [Wed, 27 Jun 2018 20:27:09 +0000 (20:27 +0000)]
Bug 21011: (follow-up) Fix pod, fix missing homebranch condition, change mode to executable

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5892ab07118b04a8071b49c40b441df326e15f07)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5ec194dfa9a1198bf5578bd3c7fac613da529f3c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21011: Search for items with not defined homebranch and/or holdingbranch
Jonathan Druart [Wed, 27 Jun 2018 18:32:56 +0000 (15:32 -0300)]
Bug 21011: Search for items with not defined homebranch and/or holdingbranch

From bug 5789: scripts can fail if items.homebranch and/or
items.holdingbranch is not defined

This script will help people catching these migration issues.

Test plan:
Update your items table to set some homebranch or holdingbranch to NULL
Run this script
It will display the different items with not defined values in these
fields.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7d47bb311827298ddc30297bbd388e8f8905db48)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b5b74454cd0c5f8cb5b46ac60ca94b37e1503fc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20631: Remove unused RemoveLostItem from C4::Accounts
Katrin Fischer [Wed, 8 Aug 2018 20:34:32 +0000 (20:34 +0000)]
Bug 20631: Remove unused RemoveLostItem from C4::Accounts

RemoveLostItem was 'used' in C4::Accounts, but is not
actually used there.

Call has been removed by
  commit ed9cf81c3aa8fd82f9347556364e9d2e6cef8a82
  Bug 15896 - Use Koha::Account::pay internally for makepayment

To test:
- Verify that the routine was actually not used!

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9ccfa48f6ee8ec44d1621874383b10f68d939f34)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8b1944bbd876d2928536b0c457922eb71e9aa54b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20504: Fix lang attribute in html tag on systempreferences page
Katrin Fischer [Thu, 9 Aug 2018 17:46:09 +0000 (17:46 +0000)]
Bug 20504: Fix lang attribute in html tag on systempreferences page

On the system preferences page the lang attribute of the
html tag is always empty.

To test:
- Go to systempreferences
- Check the html source and look at the html tag,
  it should read: <html lang="">
- Apply patch
- Check the html source again: <html lang="en">
  Verify the language code shown matches the currently
  selected language in the staff interface
- Verify the language system preferences work correctly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The problem was actually that
  $lang = $template->param( 'lang' );
should certainly be $lang = $input->param( 'lang' );
and, as it, it overrides the value of 'lang' passed from C4::Auth

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 56c50a66169f956584050a8630a71cfa7d5984cb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 32b01b264277a77dbb79133f5af8eeecbe64d997)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 7996: (QA follow-up) Remove unnecessary permission check view logs template
Katrin Fischer [Mon, 20 Aug 2018 07:04:37 +0000 (07:04 +0000)]
Bug 7996: (QA follow-up) Remove unnecessary permission check view logs template

Permission is checked in the perl file, no need to check again
in the template.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3484db7187ca4ca62a617d9362b8c64c37f60cfd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b1aa841e1ed21dc300dc188aa76fd57b33044c95)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 7996: Correct wrong permissions for modification log
Nick Clemens [Fri, 17 Aug 2018 11:07:41 +0000 (11:07 +0000)]
Bug 7996: Correct wrong permissions for modification log

To test:
 1 - Create a staff patron with catalogue,borrowers,and view_system_logs
     permissions
 2 - Log in using that patron
 3 - Go to tools
 4 - Click 'Log viewer'
 5 - You get a blank page
 6 - View borrower circ screen, note you do not see 'Modification log'
 7 - Edit a borrower, note you do not see 'Modification log'
 8 - Apply patch
 9 - 'Log Viewer' should now load correctly
10 - You should see 'Modification log' tab during circ
11 - You should see 'Modification log' tab when editing patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a750ebdbd994ef2a793e632eea4e35bbc7f1ec6d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d8b3095f7d533bd2151d710085259f29349faf5b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19511: Local cover images not centered in table column in staff client search...
Owen Leonard [Thu, 26 Jul 2018 15:36:24 +0000 (15:36 +0000)]
Bug 19511: Local cover images not centered in table column in staff client search results

This patch modifies the JavaScript which embeds local cover images in
staff client catalog search results. It now adds the "thumbail" class to
the image, matching Amazon cover images.

To test you should have one or more titles with local cover images
attached. Apply the patch and clear your browser cache if necessary.

Enable both the AmazonCoverImages and LocalCoverImages system
preferences and perform a search which will return titles with local
cover images. Confirm that local covers are styled like Amazon covers.

Tested and confirmed local cover images are appearing quite nicely now.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit afa51869c39e1a450314a6d13098571566cc241c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 683589ec9556d65c9995125c962ce7c471495937)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21144: DBRev 17.11.09.002
Nick Clemens [Tue, 21 Aug 2018 11:49:55 +0000 (11:49 +0000)]
Bug 21144: DBRev 17.11.09.002

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit df06587b763de2acd2d4e1afa3da8ad1841f7577)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4ee626a6f362bbf96342613b7f64f1b0e3b2503e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21144: Add ROADTYPE to default authorised values categories
Katrin Fischer [Thu, 2 Aug 2018 00:19:42 +0000 (02:19 +0200)]
Bug 21144: Add ROADTYPE to default authorised values categories

The ROADTYPE category was missing from the default list of
authorised value categories available.

To test:
- Verify ROADTYPE is not listed as authorised value category
- Apply patch and run database update
- Verify ROADTYPE is now listed
- Add an entry, for example: AV = Avenue
- Add or edit a patron, verify a pull down with your entry
  shows on the form.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 266d7b5fa844b512cf68f4b08d6c07474c2ccc42)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6c099d4360060829a230eeb243333182346d3d59)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21142: Open uploaded files in utf-8 - batch mod/del
Jonathan Druart [Fri, 17 Aug 2018 15:07:55 +0000 (12:07 -0300)]
Bug 21142: Open uploaded files in utf-8 - batch mod/del

Batch item/record modification/deletion tools does not open uploaded
files in utf-8

Test plan:
Edit and delete records and items using a file which will contain:
valid and invalid barcodes with and without utf-8 chars (💕)

You should see the warning message:
 "The *** 39999000💕001679 does not exist in the database."

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f5f31679bf260d17e996fbe8e2e77f695ac7ddfc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0d7ba4634ad795703cbb97e371e07ae9252a6c53)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21238: Prevent TemplateToolkit.t to fail on slow servers
Jonathan Druart [Thu, 16 Aug 2018 15:29:43 +0000 (12:29 -0300)]
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers

It failed 3x in the last 6 runs (on node 1), we should mock
DateTime->now to prevent it to fail again.

The error is:
koha_1       |         #   Failed test at
t/db_dependent/Letters/TemplateToolkit.t line 724.

When comparing <<today>> replacement:
koha_1       |         # 08/16/2018 14:25<br />
[...]
koha_1       |         # 08/16/2018 14:24<br />

Let's mock DateTime->now to prevent it to fail again.

Test plan:
0. Do not apply this patch
1. Add "sleep(60);" at line ~715, before "# Add a second checkout"
2. Run the tests
=> Fail!
3. Apply this patch
4. Run the tests again
=> Pass!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d24d77d495a56e76046907ab19e9474cab28169c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fba97f0772ad6fd40b359e626ce9fb82f3d92182)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 21230: Prevent Reserves.t to fail randomly
Jonathan Druart [Wed, 15 Aug 2018 15:21:38 +0000 (12:21 -0300)]
Bug 21230: Prevent Reserves.t to fail randomly

The following test can fail if the hold has been generated with found => 'W':
 #   Failed test 'No tests run for subtest "_koha_notify_reserve() tests"'
 #   at t/db_dependent/Reserves.t line 675.
Can't call method "to_address" on an undefined value at
t/db_dependent/Reserves.t line 661.
 # Looks like your test exited with 255 just after 56.

We should call AddReserve instead.

Test plan:
0. Do not apply this patch
1. Do the following change:
    my $hold = $builder->build({
            source => 'Reserve',
            value => {
               borrowernumber=>$hold_borrower,
               found => 'W', # This line is added, do not forget the comma above
            }
        });
2. Prove it makes the test fail
3. stash the changes and apply this patch
4. Make sure the tests pass

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c957b52ef8bba734043157445470bedc36feae5e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c359d56f25a0b346b71a3fd8700b07e4713640d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20795: Inform the user about this change, add to pod
Jonathan Druart [Wed, 1 Aug 2018 14:22:14 +0000 (11:22 -0300)]
Bug 20795: Inform the user about this change, add to pod

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e97f6ab9be6108cbe4d61ea8dd4b876527bd67ba)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40bfb7913da164f03ff44956218a8e314f87aeba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>