]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 24272: Correctly encode output to prevent 'Wide character in say'
Jonathan Druart [Wed, 20 Jan 2021 09:02:45 +0000 (10:02 +0100)]
Bug 24272: Correctly encode output to prevent 'Wide character in say'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 67b1b20e33f5d73ea515ea3b4d244dde73576448)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3fd8e4a13c361ad33d4cb02a7d77155f752b9f06)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit fb5974f7886413d316e1a2c2d0b6afe9f42dcdda)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24272: Use Pod2Usage and surround values with ''
Jonathan Druart [Wed, 20 Jan 2021 09:02:10 +0000 (10:02 +0100)]
Bug 24272: Use Pod2Usage and surround values with ''

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b1915293441b7f61d0e61c6b7dd105de1bbd5d8e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1601911977dc427e11428190bf62f416023c381b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 3cdc534a398eb24ccd113a55abd19d2c58ca1a01)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24272: (follow-up) Test defined not true
Nick Clemens [Fri, 15 Jan 2021 11:00:39 +0000 (11:00 +0000)]
Bug 24272: (follow-up) Test defined not true

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit da8aae4d65716f066af784cd60e9c8784d954dbe)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24272: add check_sysprefs_cache.pl
Nick [Thu, 19 Dec 2019 03:20:36 +0000 (03:20 +0000)]
Bug 24272: add check_sysprefs_cache.pl

This script ensure that no sysprefs have been changed directly in the database and/or
that the cache has not become corrupted. We have occasionally seen this happen on production sites

To test:
1 - In the staff interface go to Administration
2 - Search for system preference 'IntranetUserJS'
3 - Add content to the syspref:
    console.log('Hi!');
4 - On the command line launch mysql
    sudo koha-mysql kohadev
5 - Alter the syspref directly
    UPDATE systempreferences SET value = "console.log('Bye!');" WHERE variable = 'IntranetUserJS';
6 - run the script
    perl misc/maintenance/check_syspref_cache.pl
7 - You are warned about the altered system preference

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit de5527f37d898e756cac4d8ed9de63c6576c1241)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5a1e18efd87c34ef9f158c4a6f663d30ab3a4e43)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit ff6951e83bd9eeb2bfd2ec4794ce6c8b3e72a33c)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27416: Make "Modify tag" and "Add tag" translatable
Jonathan Druart [Wed, 13 Jan 2021 10:11:36 +0000 (11:11 +0100)]
Bug 27416: Make "Modify tag" and "Add tag" translatable

Those two strings are not translatable as they are passed from the
controller.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4491cdd803226c22c585f3a23f6aa77000841bed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 054428a57d4b810bc3278d625de573a66cb5d076)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit ae21f41f4840182f7812f03d3d70ee2d7ae637f7)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 17429: document the --plack/--noplack options of koha-list
Andreas Roussos [Tue, 29 Dec 2020 09:41:38 +0000 (10:41 +0100)]
Bug 17429: document the --plack/--noplack options of koha-list

The man page of koha-list does not list the --plack and --noplack
options.

This patch fixes that.

Test plan:

1) View the current man page for `koha-list` (with `man koha-list`)
   and notice how the --plack and --noplack options are missing.

2) Apply this patch.

3) Run the following command to re-generate the man page:

   xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \
   debian/docs/koha-list.xml

   View the manual page again (with `man -l koha-list.8`), the
   two options are now displayed under SYNOPSIS and OPTIONS.

4) Make sure this test passes:
   prove -v xt/verify-debian-docbook.t

Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.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 920d3efcdfe1efc79e81017f8340227063ae2973)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dd2489c17544becb33bff1193c35875a14abad6a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 756a61450289a506f0d2ab1fe2700c4100c5750f)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 15448: Remove items fetch
Jonathan Druart [Thu, 14 Jan 2021 09:44:46 +0000 (10:44 +0100)]
Bug 15448: Remove items fetch

We fetch them already too many times.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6cd68dd05bdac2787fa0b67b7f90a5836c57745c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 54a9ef09bfe7fe8eff67a173dc7b79a278aba88f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit bcb997bda846b589c29bb54c0ee3484989bd56c4)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 15448: Fix ISE
Jonathan Druart [Thu, 14 Jan 2021 09:42:53 +0000 (10:42 +0100)]
Bug 15448: Fix ISE

The method Koha::Items->itemnumber is not covered by tests!

Trace begun at /kohadevbox/koha/Koha/Objects.pm line 592
Koha::Objects::AUTOLOAD('Koha::Items=HASH(0x55981fd94790)') called at /kohadevbox/koha/opac/opac-reserve.pl line 465

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9790b5ca3a1b8a92d56a14207d6245c02dfe7fd6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 60e08d51bb814eb1dae834afa0c259539eaf2c61)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 6906be6c69a8603881bd1425024d8cdeb177e33b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 15448: (follow-up) Adapt to changes on bug 24254
Tomas Cohen Arazi [Mon, 21 Dec 2020 19:30:31 +0000 (16:30 -0300)]
Bug 15448: (follow-up) Adapt to changes on bug 24254

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8af3ecdd538f22bfbf4d99bda629283fe856f3de)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 655c4427c7d2c9e4d05c016fa52833feb9c59892)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 7f297d7f51486e3403197b53a5c0687d376000fb)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 15448: (follow-up) Fetch the patron category once
Tomas Cohen Arazi [Fri, 4 Dec 2020 11:33:43 +0000 (08:33 -0300)]
Bug 15448: (follow-up) Fetch the patron category once

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c9f66f5e6b5360a57885c26436c7eb3f2747bd28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cdfea7001131055c8d91459d4c48dbc4adb4741e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit bbf2348bf070609ad876ccb4e82d4b98a9b3774b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 15448: Filter out items hidden in OPAC on placing hold
Tomas Cohen Arazi [Fri, 4 Dec 2020 11:21:36 +0000 (08:21 -0300)]
Bug 15448: Filter out items hidden in OPAC on placing hold

This patch leverages on bug 24254's
Koha::Items->filter_by_visible_in_opac to filter out items that
shouldn't be presented to the end user in the OPAC interface.

To test:
1. Circulation and Fine rules for item-level holds are set to allow.
2. Setting the OpacHiddenItems preference to "ccode: [SUPPRESS]"
3. An item with collection Code Suppress is set.
4. Search for the title in the OPAC.
=> SUCCESS: The Suppress ccode item isn't shown.
5. View the detail page for the title.
=> SUCCESS: The suppress ccode item isn't shown.
6. Place a hold on the item:
  -- Click "Show more options"
  -- Select "A specific item"
=> FAIL: the ccode with the opachiddenitems rule has an item that appear in the list to place a hold
7. Apply this patch and repeat 6
=> SUCCESS: The item doesn't show!
8. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 051f5519861cb2365ddd06d08a9047648af2318b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 284b2da589aabb2475b1292b1cf843be818b384e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 41605172eaebee255876abc21e1607a92cf21b4b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27299: Remove tokenization for phrase register/index with ICU
David Cook [Tue, 22 Dec 2020 22:57:38 +0000 (09:57 +1100)]
Bug 27299: Remove tokenization for phrase register/index with ICU

This patch removes tokenization for phrase register/index when
using ICU.

This should cause "exact" searches to work the same way with ICU
as they do with CHR.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7f9c909d5a603c40125064e7e32f24e595d596e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3a841a3a74a6165af996f8ca9c8affe8c5192f9e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 83716bc4ac3676a151845e2e507d6aef90dd1e13)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24254: (QA follow-up) Inlines opachiddenitems handling
Martin Renvoize [Thu, 14 Jan 2021 11:28:35 +0000 (11:28 +0000)]
Bug 24254: (QA follow-up) Inlines opachiddenitems handling

We decided to inline the opachiddenitems filter as we don't believe it
will be used exclusively.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 67f5a2607798f19a7bcd5e5f006f72bf196edd9e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24254: Implement separate filters and add patron param
Tomas Cohen Arazi [Mon, 21 Dec 2020 18:50:13 +0000 (15:50 -0300)]
Bug 24254: Implement separate filters and add patron param

This patch introduces two new methods for stacking filters on
Koha::Items:

- filter_out_lost
_ filter_out_opachiddenitems

This two filters are what actually happened inside the
filter_by_visible_in_opac. Everything is covered by tests.

In the process I added a Koha::Patron param to the method that is
internally used to decide if the OPACHiddenItems syspref needs to be
honoured or not. This *could* be better done with a fallback to
C4::Context->userenv if no param is passed.

I decided to leave that part for later, if we really find it would help
(e.g. if bug 10589 gets some action and we really need something here to
 handle that).

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 172747f9adc0c39440dfe3f7930e2ad87b387d75)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24254: Read the OpacHiddenItems preference internally
Tomas Cohen Arazi [Sat, 19 Dec 2020 13:21:18 +0000 (10:21 -0300)]
Bug 24254: Read the OpacHiddenItems preference internally

After discussing the 'rules' parameter usefulness we decided it was not
the best idea, and the gains in terms of 'performance' would me
meaningless (in-memory caching of sysprefs). This patch makes a really
minor tweak to the tests so they mock the C4::Context->yaml_preference
method, but keeping the same original rules to highlight no behaviour
change takes place.

Then the rules parameter is removed from the calls, and the tests should
keep passing.

A minor change to make $rules = undef is made to highlight the // {}
behaviour when reading the syspref..

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 2369428d7049f9847ed4ac578684a81fe03df4d0)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24254: Compare itemlost with 0
Tomas Cohen Arazi [Sat, 19 Dec 2020 13:05:16 +0000 (10:05 -0300)]
Bug 24254: Compare itemlost with 0

On C4::Search and C4::Circulation the uses of the items.itemlost field
highlight the fact that the comparisson itemlost <= 0 was wrong, as it
is evaluated as a Perl boolean.

The column can only be an int and NOT NULL, so we need to check if it is
0 to ponder if not hidden.

This patch changes the tests to reflect this, and adjust the
Koha::Items->filter_by_visible_in_opac implementation to adapt to this.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4ffe7ddac04b0240b8007df6521fe6e65e403241)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24254: Add Koha::Items->filter_by_visible_in_opac
Tomas Cohen Arazi [Thu, 3 Dec 2020 18:11:14 +0000 (15:11 -0300)]
Bug 24254: Add Koha::Items->filter_by_visible_in_opac

This patch adds a method based on the original idea from Nick, but on
Koha::Items.

The idea is to build a proper filter, based on the current rules for
hiding things, directly on the DBIC query. The caller takes care of
knowing if the filtering should apply (i.e. checking the patron category
exceptions) and then it would do something like:

    my @items;
    if ( <patron_category_does_not_have_exception> ) {
        @items = $biblio->items->filter_by_visible_in_opac(
            {
                rules => $rules
            }
        );
    }
    else {
        # still want to enforce 'hidelostitems'
        @items = $biblio->items->filter_by_visible_in_opac;
    }

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Look at the use cases on the tests, read the code
=> SUCCESS: It all makes sense
4. Compare with Koha::Item->hidden_in_opac
=> SUCCESS: It all makes sense
5. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 11bdc847a38fa3631e39fbc19c05ea7e5e64afd3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24254: Unit tests
Tomas Cohen Arazi [Thu, 3 Dec 2020 18:11:00 +0000 (15:11 -0300)]
Bug 24254: Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit ff6d138fafc51d5d94bc46f665436dede1d52133)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26713: Add pagination to bottom of saved SQL reports table
Owen Leonard [Thu, 3 Dec 2020 12:06:46 +0000 (12:06 +0000)]
Bug 26713: Add pagination to bottom of saved SQL reports table

This patch adds a second pagination menu to the bottom of the report
results table.

To test, apply the patch and go to Reports.

- Run a report which will return multiple pages of results (greater
  than 20).
- The results should display with a pagination bar at the top and bottom
  of the table.
- Confirm that both pagination menus work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dbc74154754c4d5d03baa7c96b8511e0c2e0d036)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 544b4c44930053a8c173eaafb304fa8b362de572)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit fd9d8ff6030b69e8d887cfba7cba628747305ada)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27196: [19.11.x] Don't explode if item that is waiting if checked in by SIP
Jonathan Druart [Mon, 14 Dec 2020 14:54:54 +0000 (15:54 +0100)]
Bug 27196: [19.11.x] Don't explode if item that is waiting if checked in by SIP

AddReserve doesn't take a hash in 19.11 - amended the call in the tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 24863: QueryFuzzy syspref says it requires Zebra but ElasticSearch has some support.
Lisette Scheer [Sat, 24 Oct 2020 19:09:59 +0000 (19:09 +0000)]
Bug 24863: QueryFuzzy syspref says it requires Zebra but ElasticSearch has some support.

This patch updates the description of the QueryFuzzy system preference
to make it more clear how it works with Zebra and how Elasticsearch has
some amount of fuzzy available for searches.

To test:
1. Go to administration
2. Search for QueryFuzzy
3. Observe the current description, which only includes Zebra.
4. Apply patch
5. Repeat steps 1-2
6. Observe the updated description.
7. Sign off

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 137cf586551be4affb112eba3a61bc49b0099342)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c0466fd4425739e464f697687cd9b0639a0bf16c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit db65e8ff873020214ae339e8efad29b5f4179834)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27308: Skip blank lines when inserting new
Nick Clemens [Thu, 24 Dec 2020 13:35:28 +0000 (13:35 +0000)]
Bug 27308: Skip blank lines when inserting new

The intent of the macro insert new function is to add a new field at the correct numerical place in the record. If you have a blank line while editing, however, the new line will be inserted at the blank line, rather than checking the rest of the record.

To test:
1 - Create a macro like
    new 690=‡aLOCAL SUBJECT
2 - Insert a blank line into your record somewhere before where the 690 should be inserted
3 - Run the macro
4 - Line is inserted before the blank line
5 - Apply patch
6 - Reload (ensure cache is cleared and JS files are reloaded)
7 - Remove the previously created field, but leave the blank
8 - Run the macro
9 - Field is created at correct position

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 27308: (QA follow-up) Remove commented line

I don't think we need to keep the original line as a comment.. this
patch simply cleans it up.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3b0f86b53173d30da5dbb42710a7c9bf9edaa3bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d27b1018a96667c6fce8fc746e968e9a206858a0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 79618eb5a654dc3c01119372e8e7fbc0fd3c7340)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoUpdate release notes to remove reverted patch v19.11.14
Victor Grousset/tuxayo [Sat, 23 Jan 2021 01:54:36 +0000 (02:54 +0100)]
Update release notes to remove reverted patch

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoRevert "Bug 27196: [20.05.x] Don't explode if item that is waiting if checked in...
Victor Grousset/tuxayo [Sat, 23 Jan 2021 01:02:57 +0000 (02:02 +0100)]
Revert "Bug 27196: [20.05.x] Don't explode if item that is waiting if checked in by SIP"

Patch not working, forgot to undo the backport before pushing.

This reverts commit e8ea682d492f029811d503dc2788a54a29a0bd35.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoUpdate release notes for 19.11.14 release
Victor Grousset/tuxayo [Sat, 23 Jan 2021 00:08:57 +0000 (01:08 +0100)]
Update release notes for 19.11.14 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoIncrement version for 19.11.14 release
Victor Grousset/tuxayo [Fri, 22 Jan 2021 23:04:06 +0000 (00:04 +0100)]
Increment version for 19.11.14 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoFix translations for Koha 19.11.14
Victor Grousset/tuxayo [Fri, 22 Jan 2021 22:51:05 +0000 (23:51 +0100)]
Fix translations for Koha 19.11.14

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoTranslation updates for Koha 19.11.14
Koha translators [Fri, 22 Jan 2021 21:43:11 +0000 (18:43 -0300)]
Translation updates for Koha 19.11.14

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27196: [20.05.x] Don't explode if item that is waiting if checked in by SIP
Jonathan Druart [Mon, 14 Dec 2020 14:54:54 +0000 (15:54 +0100)]
Bug 27196: [20.05.x] Don't explode if item that is waiting if checked in by SIP

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 5f1bcdf49a99f995c8cc00c45bc30498c066c9e3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27090: Opac basket: fix the 'In transit from' and 'to'
Christophe Croullebois [Wed, 25 Nov 2020 10:29:40 +0000 (11:29 +0100)]
Bug 27090: Opac basket: fix the 'In transit from' and 'to'

To see the 'In  transit from' and 'to' fields in an Opac basket we have :

<span class="item-status intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %]
    to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span>

But in koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc we have no :

[% USE Branches %]

This patch just corrects this lack

Test plan:
1° find an item in a transit status or create one with this status
2° put it in an Opac basket
3° note that in the location column of the Opac basket the 'In transit from' and 'to' fields are empty.
4° apply the patch
5° check again and validate that the 2 fields are now filled

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7be57c66085071fea763a572ac2a6ceb82641297)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b9750c8f94c4b35eb1a7ef75512b7e6a70ec7b8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 0c9ce94c25f41f070f66fbfeb0ab5982553fb289)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl
Jonathan Druart [Fri, 18 Dec 2020 13:41:12 +0000 (14:41 +0100)]
Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl

To prevent
DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1588, <GEN45> line 1.

Test plan:
1 - Export more than 100 records
2 - Use bulkmarcimport (with -commit=10) to import them
    perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10
3 - Modify a record to make the import fail (for instance having a too long
lccn)
4 - Use bulkmarcimport (with -commit=10) to import them
    perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10
5 - Notice that the import stops but that the imported record are imported (apart from the last batch of 10)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4a90c0b647fdfdb0a39b43f6b10adba3bca53215)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f0dadd169b08f3b486ea387cdbb7f93c13b8d3db)
(cherry picked from commit d26a4df948456b6d001b87458791686b0898323e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27137: Correctly show biblio title after successfully moving item
Aleisha Amohia [Thu, 3 Dec 2020 02:50:15 +0000 (15:50 +1300)]
Bug 27137: Correctly show biblio title after successfully moving item

In Bug 11529 we changed the variable that was passed to the template but
missed updating the template.

This patch ensures we correctly access the variable to show the title of
the biblio.

To test:
1) Create two biblios (Biblio A and Biblio B)
2) Add an item to Biblio A (Item A)
3) Go to Biblio B
4) In the cataloguing toolbar, click Edit, then Attach item
5) Enter the barcode for Item A and submit
6) Notice the item has successfully moved by Biblio B's title does not
show
7) Apply patch
8) Go to Biblio A
9) In the cataloguing toolbar, click Edit, then Attach item
10) Enter the barcode for Item A and submit
11) Confirm Biblio A's title shows correctly

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4817f8ee4f7fa50a4f60d54e1827ecc91cf9ee49)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 25826: fix failing test
Jonathan Druart [Mon, 10 Aug 2020 08:00:34 +0000 (10:00 +0200)]
Bug 25826: fix failing test

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 5cef1d0cd80e271c579e3ae2c5eb7eb44a9a8349)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 25826: (QA follow-up) Add filters
Nick Clemens [Thu, 6 Aug 2020 12:40:20 +0000 (12:40 +0000)]
Bug 25826: (QA follow-up) Add filters

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit e50c54d8129c6342dc37006669c4f42261e07dd6)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 25826: Forbid changing the hidden attributes for biblionumber
Tomas Cohen Arazi [Mon, 27 Jul 2020 15:18:36 +0000 (12:18 -0300)]
Bug 25826: Forbid changing the hidden attributes for biblionumber

This patch tweaks the UI so it forbids changing the hidden values when
they are correct (i.e. when they are not hidden in OPAC and intranet).

To test:
1. Apply the first patch
2. Play with the hidden values of the subfield you have mapped to
   biblio.biblionumber in your picked framework. This is usually 999$c
   in MARC21, and 001 in UNIMARC.
=> SUCCESS: When you verify the about.pl, it mentions issues when you
hide in some of the interfaces
3. Apply this patch and reload everything
4. Repeat 2
=> SUCCESS: If your framework is 'ok', it prevents you from editing this
values, otherwise you can change them.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 155b2f65e04c2b3b8e9120308ee6603d44a9c01e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 25826: Add a warning to the about page
Jonathan Druart [Wed, 22 Jul 2020 14:43:38 +0000 (16:43 +0200)]
Bug 25826: Add a warning to the about page

This patch adds a warning to the about page if the biblionumber field is
hidden at the OPAC or staff interface.

Test plan:
Hide the biblionumber to some framework
Confirm that there is a warning on the about page

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 6b8748248b6ef27783a222bbed83da9e5207fd7a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27085: Corrections in overdue_notices.pl help text
Timothy Alexis Vass [Wed, 25 Nov 2020 07:45:39 +0000 (07:45 +0000)]
Bug 27085: Corrections in overdue_notices.pl help text

-library      <branchname>     only deal with overdues from this library (repeatable : several libraries can be given)
Should be <branchcode>

Help text should also be proper sentences.

To test:
0) Run misc/cronjobs/overdue_notices.pl -h
1) Check that the text is now:
   -library      <branchcode>     Only deal with overdues from this library.
2) Check that the rest of the help text are proper sentences,
   with leading capital letter and punctuation.
3) Sign off.

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 49246b7a2028344103bc249312a0f2619a192dfe)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27043: Add to number_of_replicas and number_of_shards to index config
Fridolin Somers [Tue, 17 Nov 2020 13:49:58 +0000 (14:49 +0100)]
Bug 27043: Add to number_of_replicas and number_of_shards to index config

With Elasticsearch 6 (>6.4), we have a warning on index creation :
  the default number of shards will change from [5] to [1] in 7.0.0

See https://github.com/elastic/elasticsearch/pull/30587

I propose to add number_of_shards in index config.

Also add number_of_replicas that is better explicit.
In case on only one node, it must be 0.

Test plan :
1) Use Elasticsearch
2) Apply patch and flush memcached
3) Rebuild indexes : misc/search_tools/rebuild_elasticsearch.pl -v -b -d
4) Check you dont have a warning about number of shards
5) Check the settings of index :
   curl '<cluster>:9200/<myindex>_biblios/_settings?pretty&filter_path=**.number_of_*'
6) You should see :
   "number_of_shards" : "5",
   "number_of_replicas" : "1"

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3dc90c66c7e3e53c6fab1792ebac65767e770c5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 31b3763546e6fb5b55572e49786d0583b3abfa1a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit ce3d0ff93e2898147c38271c2ab847b6ce4fce31)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27252: DBRev 19.11.13.001
Andrew Fuerste-Henry [Thu, 7 Jan 2021 19:58:23 +0000 (19:58 +0000)]
Bug 27252: DBRev 19.11.13.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit f40b7c2b6c9eb9d030a8344de4b6173a5e98f0fe)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27252: Default to cross fields off
Nick Clemens [Wed, 23 Dec 2020 14:30:50 +0000 (14:30 +0000)]
Bug 27252: Default to cross fields off

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit bef49a44495e415eb0e4f1bca6c652b17dacfb55)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27252: Add deprecation warning, cross_fields pref, and add version to ES info
Nick Clemens [Wed, 16 Dec 2020 18:50:55 +0000 (18:50 +0000)]
Bug 27252: Add deprecation warning, cross_fields pref, and add version to ES info

This patch prepares Koha to officially no longer support Elasticsearch 5.X

It adds a new system preference 'ElasticsearchCrossFields' to allow users to choose whether or not
to enable this feature

It updates the about page to add a deprecation warning if a site is running ES5

To test:
 1 - Be running Koha with Elasticsearch 5.X
 2 - Attempt to search
   Error: Unable to perform your search. Please try again.
 3 - Apply patch
 4 - Update database
 5 - Searching works
 6 - Find syspref 'ElasticsearchCrossFields'
 7 - Enable it
 8 - Searching is now broken
 9 - Check the about page
 10 - you can now see the Elasticsearch version
 11 - The systeminformation tab has a deprectaion warning
 12 - Set SearchEngine preference to 'Zebra'
 13 - View the about page - no warnings
 14 - Test again with ES6 - searching should "work" with either pref setting
 15 - There should be no warning on about pages

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 01f79488a66136bec10ba848634350a185eb24bb)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27070: Add cross_fields type to our searches
Nick Clemens [Fri, 20 Nov 2020 19:11:10 +0000 (19:11 +0000)]
Bug 27070: Add cross_fields type to our searches

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

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

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

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 03f15d13c5bb931c03aa1487a3887bdaa034b06f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4c4d8fbdfd31c67169e403cba998350c22b7f8c4)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27004: Prevent claim resolution to fail
Jonathan Druart [Mon, 21 Dec 2020 10:05:26 +0000 (11:05 +0100)]
Bug 27004: Prevent claim resolution to fail

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

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

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

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 92dbe809021ea1f7ee44e51387b48d9ffbda1fea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8e3f33e5d6e79d2df1a5077e4dc68364867566c9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit a5c20fc188c634fc8c7b6d00f542dc7589d2e9a8)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27004: Regression tests
Tomas Cohen Arazi [Tue, 29 Dec 2020 17:35:27 +0000 (14:35 -0300)]
Bug 27004: Regression tests

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

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c4702149b2a9d3ec6216a7526a2c52b91de5d4cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f1b6a5321b6593e54b2870229404df8544f37e9e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4d05aeb9c304f0a5551019e7f440bb51c9fb9193)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27276: Fix syntax error
Kyle M Hall [Mon, 4 Jan 2021 13:12:25 +0000 (08:12 -0500)]
Bug 27276: Fix syntax error

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4f112b782b706d906fb39dd0d7a708f7d12da45f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 289068c0d5c6ea8a45551a27aa8075d59ed6e759)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 9a1447ac2b2868f2d813af98f3d4afb2118c4249)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27276: Prevent borrowers-force-messaging-defaults.pl to crash
Jonathan Druart [Fri, 18 Dec 2020 13:28:13 +0000 (14:28 +0100)]
Bug 27276: Prevent borrowers-force-messaging-defaults.pl to crash

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

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f228c9ee9fc7094054b687b26ae4306254922019)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1b4f18148ba2192afb247ac3e8b87676f4647245)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4d85ad1a8f2e41cfc980cbd90d3bad0fbc7dface)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27055: Fix compatibility with newer Firefox+Selenium version
Victor Grousset/tuxayo [Thu, 19 Nov 2020 12:47:45 +0000 (13:47 +0100)]
Bug 27055: Fix compatibility with newer Firefox+Selenium version

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

Fix some uses of get_attribute()

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

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

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

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

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

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

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c3406257e78a9407320d22820807f767b4c4df3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 51fcc453f9db5c196cc62cb29f3321f32f5dd54e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 09518a3773823e339304a3f187f1184b89ddf902)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27099: Stage for import button not showing up
Owen Leonard [Mon, 14 Dec 2020 12:30:03 +0000 (12:30 +0000)]
Bug 27099: Stage for import button not showing up

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

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

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

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

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

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

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

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 0937c0902b64d0f9747e96b7be09f7250e031c68)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoUpdate release notes for 19.11.13 release v19.11.13
Victor Grousset/tuxayo [Wed, 6 Jan 2021 18:44:08 +0000 (19:44 +0100)]
Update release notes for 19.11.13 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoIncrement version for 19.11.13 release
Victor Grousset/tuxayo [Wed, 6 Jan 2021 17:17:27 +0000 (18:17 +0100)]
Increment version for 19.11.13 release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoFix translations for Koha 19.11.13
Victor Grousset/tuxayo [Wed, 6 Jan 2021 17:10:15 +0000 (18:10 +0100)]
Fix translations for Koha 19.11.13

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoTranslation updates for Koha 19.11.13
Koha translators [Wed, 6 Jan 2021 12:14:30 +0000 (09:14 -0300)]
Translation updates for Koha 19.11.13

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 14564: Set permissions on configuration backups
Mirko Tietgen [Sun, 19 Jul 2015 15:16:12 +0000 (17:16 +0200)]
Bug 14564: Set permissions on configuration backups

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

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

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6982680ae9e71d5d038e894842125860fcc986d6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e906a737f2f77d79b125ac292172d93191b672f3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 227e59584373257f23f9f8dafc749a6ca88fa7ba)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27108: Add 21.05 release team to teams.yaml
Martin Renvoize [Fri, 27 Nov 2020 14:08:24 +0000 (14:08 +0000)]
Bug 27108: Add 21.05 release team to teams.yaml

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit adf0293c7bc6b46dbd9c10e86a4684c602b23e16)
(cherry picked from commit ebd18bb7645ed29248e27a3fc67df348008e3120)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27166: [20.05.x] Set destination_loc to item->homebranch
Nick Clemens [Tue, 8 Dec 2020 14:18:35 +0000 (14:18 +0000)]
Bug 27166: [20.05.x] Set destination_loc to item->homebranch

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

In 20.05.x we don't have the item object, so we can just use the SIP transaction item

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

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit d58beb621e967955766d42c81951ebb417838847)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27166: Unit tests
Nick Clemens [Tue, 8 Dec 2020 14:18:11 +0000 (14:18 +0000)]
Bug 27166: Unit tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 409d1114d9eed91fd3ca9c19fd409965c17d6157)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 25189: Don't create authority if results found
Nick Clemens [Tue, 28 Apr 2020 15:34:20 +0000 (15:34 +0000)]
Bug 25189: Don't create authority if results found

Automatic authority creation assumes that if we don't match we need a new authority.

Using the Default linker, however, we don't match if there exists more than one match.
This leads to repeatedly generating authorities once there is a duplicate in the system

We shoudl instead only create a new authority if there are no results

To test:
1 - Set Linker Module to 'Default'
2 - Enable  AutoCreateAuthorities  and  BiblioAddsAuthorities and  CatalogModuleRelink and LinkerRelink
3 - Add two copies of a single authority via Z39
4 - Add a heading for that authority to a bib record
5 - Save the record and note a new authority is generated
6 - Repeat and see another is generated
7 - Apply patch
8 - Restart all the things
9 - Save the record again, no new authority created

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 980419ed15cd4e5ae8be552218f939f5faea18c4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e5baeac0fdbc5fc83256effeff304e736c7dc154)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 25189: Unit tests
Nick Clemens [Tue, 28 Apr 2020 13:29:52 +0000 (13:29 +0000)]
Bug 25189: Unit tests

Adds new test for not adding authority if some already exist

Also replaces use of 'SearchAuthorities' as it is Zebra specific

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 258d0b0ecd6450fea09677f0607efdedb33cc16c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6a395eab2d3ce6c9564b387eaa8f863632518997)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug ?????: Compile SCSS, forgotten in a previous release
Victor Grousset/tuxayo [Fri, 18 Dec 2020 20:15:33 +0000 (21:15 +0100)]
Bug ?????: Compile SCSS, forgotten in a previous release

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 12430: [19.11] Fix buildQuery.t
Victor Grousset/tuxayo [Fri, 18 Dec 2020 19:59:35 +0000 (20:59 +0100)]
Bug 12430: [19.11] Fix buildQuery.t

Output is different in 19.11

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 12430: Fix Search.t failure
Jonathan Druart [Wed, 9 Dec 2020 09:52:15 +0000 (10:52 +0100)]
Bug 12430: Fix Search.t failure

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

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit b8eaa1de2e0eb80c171e141754b712fe3426b8f1)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 12430: Fix selenium/regressions.t failure
Jonathan Druart [Fri, 4 Dec 2020 16:05:30 +0000 (17:05 +0100)]
Bug 12430: Fix selenium/regressions.t failure

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 48e74cebedea733e0a6528cd275c1b2925ff46bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 965ad535b503a6a786388feb40498ab1b79fe735)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 64ccd1c48299b457413a9ede0c9f26dc61f003c5)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 12430: Add unit tests for C4::Search::buildQuery
David Cook [Tue, 18 Feb 2020 03:02:55 +0000 (03:02 +0000)]
Bug 12430: Add unit tests for C4::Search::buildQuery

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 66b2bb7ca898007533f775a2bdc413c9d00c6ca7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a5e9ad5db2ae5cd0011f8ebb50a3abadddee2193)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 168c21049842cfcba29c1600d73cff7b5b29d26d)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 12430: Use releance ranking without QueryWeightFields
David Cook [Tue, 17 Jun 2014 06:59:32 +0000 (16:59 +1000)]
Bug 12430: Use releance ranking without QueryWeightFields

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

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

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

_TEST PLAN_

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

5) Apply patch

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

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

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f6b5dfa4b718fb74654448b5663cb264b5c376b7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 913cf92b2d8d4b1a948e32c941c903359afa7f02)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 66b76dd33d623cc6165cab8a2a6c8f71f28834e3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27079: Unit tests
Martin Renvoize [Wed, 25 Nov 2020 14:10:34 +0000 (14:10 +0000)]
Bug 27079: Unit tests

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

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 442802d77629586fe906f1055ce386ace8165d8c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit bb7ef5294f19a1261389b28e3605c26c8624ea16)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27079: Floating point comparison correction
Martin Renvoize [Wed, 25 Nov 2020 12:58:56 +0000 (12:58 +0000)]
Bug 27079: Floating point comparison correction

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

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

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f99a22f276e429863d4168f7f92c60e66deeb82d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 198c3be9f0036b5b828d14941b3eae1898526b6a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27092: Remove note about "synced repo" from README.md
Jonathan Druart [Wed, 25 Nov 2020 15:31:58 +0000 (16:31 +0100)]
Bug 27092: Remove note about "synced repo" from README.md

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

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit c8385e537c90054a54c37c5e9ad90f9ce845a002)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26518: (QA follow-up) Expect warnings, don't supress them
Nick Clemens [Mon, 23 Nov 2020 12:09:47 +0000 (12:09 +0000)]
Bug 26518: (QA follow-up) Expect warnings, don't supress them

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 9561eea563acdd07c166d0088a9904bdbfd3806a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26518: Move BiblioAutoLink within the transaction
Jonathan Druart [Mon, 12 Oct 2020 13:01:22 +0000 (15:01 +0200)]
Bug 26518: Move BiblioAutoLink within the transaction

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

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit b68261d3c3452d0669d6d683c3a9e1cd61a8bb70)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26518: Hide expected DBI warnings
Jonathan Druart [Fri, 9 Oct 2020 10:09:08 +0000 (12:09 +0200)]
Bug 26518: Hide expected DBI warnings

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 089c12ec09469a513e4ad88d1df1bacbe9c2376e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26518: Raise exception if the insert failed
Jonathan Druart [Tue, 29 Sep 2020 11:29:49 +0000 (13:29 +0200)]
Bug 26518: Raise exception if the insert failed

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 3e5ee1083d4f682964042ff68a4b8c88fa04e759)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26518: Use Koha::Biblio[item] in AddBiblio
Jonathan Druart [Tue, 29 Sep 2020 11:29:33 +0000 (13:29 +0200)]
Bug 26518: Use Koha::Biblio[item] in AddBiblio

Bug 26518: Does not return from the catch block

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit db94f61c23ca1398d232d0d96ad70b62585883e0)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 27082: uncertainprice.pl does not handle pagination
Blou [Tue, 24 Nov 2020 22:03:32 +0000 (17:03 -0500)]
Bug 27082: uncertainprice.pl does not handle pagination

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

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

Sponsored by: CCSR

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5bc36cd672ad7d4abf839bed2d48da43f09415e9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 794229750f62439677c0b835bccaef2e59086613)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 25548: (follow-up) Remove those rewrite redirects in koha-httpd.conf
Fridolin Somers [Wed, 30 Sep 2020 12:54:57 +0000 (14:54 +0200)]
Bug 25548: (follow-up) Remove those rewrite redirects in koha-httpd.conf

In etc/koha-httpd.conf for dev install, those rewrite redirects are already commented.
Just remove them.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6267eb7cba91ad8177cc60c4c7cba0b26b473cee)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit b40b65677996dce2fccca1149029fcf5e8a17c68)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 25548: Remove Apache rewrite directives that trigger redirects
David Cook [Wed, 20 May 2020 05:08:05 +0000 (15:08 +1000)]
Bug 25548: Remove Apache rewrite directives that trigger redirects

Historically, we have used Apache rewrite directives to strip
query parameters with no arguments from the query
string (e.g. PARAM=&), and then redirect to the new URL.

However, this slows down user activity, and depending on your
HTTPS and proxy setup can cause suboptimal HTTP downgrades and
upgrades.

Test Plan:
0) Apply patch
1) Build Debian package
2) Install Debian package and reload Apache
3) Open developer tools on your favourite browser
4) Go to Network tab in developer tools
5) Go to /cgi-bin/koha/opac-main.pl
6) Search for "test"
7) Note a 200 status for "opac-search.pl?idx=&q=test"

If you got a 302 status for "opac-search.pl?idx=&q=test"
followed by a 200 status for "opac-search.pl?q=test", you
will know that your Apache configuration wasn't updated.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 181125242c33d439fb6bdbddccb6a86a03fa8c15)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit c7f66d7d14cea365e73ac5fcb2cf80e3b9f823fc)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 25752: Stay in cwd after koha-shell
Jonathan Druart [Mon, 15 Jun 2020 14:11:49 +0000 (16:11 +0200)]
Bug 25752: Stay in cwd after koha-shell

After bug 25538, after a koha-shell we are not longer in the current directory:

root@cec7bffd8100:koha(master)$ pwd
/kohadevbox/koha
root@cec7bffd8100:koha(master)$ sudo koha-shell kohadev
kohadev-koha@cec7bffd8100:~$ pwd
/var/lib/koha/kohadev

Test plan:
Repeat the commands above and confirm that with this version of the
script you get /kohadevbox/koha inside the koha-shell

Search for possible regressions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7555ecaafa3bd8bbf0514f3c2672cb41ff7e0aa7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ad985def456ec0312d76baa95bd04351940b58fb)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26854: Remove log of STDERR
Jonathan Druart [Thu, 19 Nov 2020 10:13:34 +0000 (11:13 +0100)]
Bug 26854: Remove log of STDERR

See discussion on comments 12-20

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c056385669cefa02e2a94f96d8edea570f3c887e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 7013f7188968f86179bd498abc94ff58bdba1613)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26854: Close STDERR when forking stage-marc-import.pl
David Cook [Thu, 29 Oct 2020 04:24:31 +0000 (04:24 +0000)]
Bug 26854: Close STDERR when forking stage-marc-import.pl

We need to close STDERR when forking stage-marc-import.pl,
or else the CGI session with Apache httpd does not properly
finish. This leads to unexpected behaviour across different httpd
versions, operating systems, etc.

This patch closes the STDERR file handle when forking a child
process to do MARC imports, and it re-opens STDERR to a log file
in the logdir directory to catch any import errors.

Test plan:
1. Apply the patch
2. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
3. Upload a MARC file with a large number of records (e.g. 30,000 records)
4. Open F12 dev tools
5. Click on "Network" tab
6. Clear all existing network logs
7. Click "Stage for import"
8. After ~30 seconds, the request to stage-marc-import.pl should return a 200 code
9. Immediately, calls to background-job-progress.pl should start, and the "Job progress"
bar should update at a maximum rate of every .5 seconds
(or more realistically 1-2 seconds)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f3cacc62cda58798e8f2de6cfdd636772d2158f0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit e5a3989e63e137f0d46dc6513e7e429c49b04f67)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26986: Prevent Selenium's StaleElementReferenceException
Jonathan Druart [Tue, 10 Nov 2020 10:37:55 +0000 (11:37 +0100)]
Bug 26986: Prevent Selenium's StaleElementReferenceException

This is a follow-up bug for bug 26162

By finding the element before the click I hope to get the good element,
even if the page changed in the meanwhile.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 836d9a38727859f06902a7be6790592431fe812e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit b0af61fdc77e089e57525627fcb8e8eecd4be42c)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 26516: Don't accept incorrect values for copyrightdate/publicationyear
Nick Clemens [Wed, 23 Sep 2020 14:42:40 +0000 (14:42 +0000)]
Bug 26516: Don't accept incorrect values for copyrightdate/publicationyear

The previous patch rejects incorrect values when saving to the db specifically for copyrightdate
An error is thrown for the int conversion when it fails

Rather than catching things when saving we can fix the value when generated, simply returning null when parsing
the record

To test:
1 - Add a new record to Koha making sure data is valid except 260$c:
    198-
2 - Save the record
3 - It fails
4 - Apply this patch
5 - Restart all the thigns
6 - Repeat
7 - Success!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e1400890ec8040ced8e3550eddbfd0d4e8af2347)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit c56972ddd3b9fc703a9123fc02140079957b1671)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 18267: (QA follow-up) fix typo: overriden => overridden
Victor Grousset/tuxayo [Fri, 20 Nov 2020 15:44:04 +0000 (16:44 +0100)]
Bug 18267: (QA follow-up) fix typo: overriden => overridden

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3acf7e226041f00a5743a9be30d998e6b73db2c5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit f549acf58b876d047ddf3811906a1e1b9c4aa97c)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoBug 18267: Refactored Edifact Price Calculations
Colin Campbell [Thu, 12 Nov 2020 11:42:05 +0000 (11:42 +0000)]
Bug 18267: Refactored Edifact Price Calculations

Refactored the price calculations for Quotes and Invoices
This takes in to account various combinations used by different
vendors. Makes the extraction of basic price, quantity and tax
information more reliable. Tests are in Edifact.t and EdiInvoice.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 36d46c6510ee93ffc52f6b914389c66351b16f33)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit a939f9ab174f9ab1e05f80832343474c6bc5a084)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
3 years agoUpdate release notes for 19.11.12 release v19.11.12
Aleisha Amohia [Tue, 24 Nov 2020 00:51:36 +0000 (13:51 +1300)]
Update release notes for 19.11.12 release

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoIncrement version for 19.11.12 release
Aleisha Amohia [Tue, 24 Nov 2020 00:45:39 +0000 (13:45 +1300)]
Increment version for 19.11.12 release

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoFixing po files for 19.11.12
Aleisha Amohia [Tue, 24 Nov 2020 00:42:58 +0000 (13:42 +1300)]
Fixing po files for 19.11.12

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoTranslation updates for Koha 19.11.12
Koha translators [Tue, 24 Nov 2020 00:32:06 +0000 (21:32 -0300)]
Translation updates for Koha 19.11.12

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 26904: OPAC password recovery allows regexp in email
Fridolin Somers [Tue, 3 Nov 2020 08:19:34 +0000 (09:19 +0100)]
Bug 26904: OPAC password recovery allows regexp in email

When using OPAC password recovery form, opac/opac-password-recovery.pl :
if one provides correct login and an email, there is a check that this email is one of patron's.

This check uses RegExp with case insensitive :
  if ( $email && !( any { /^$email$/i } @emails ) )

This is a security issue since one can simply enter '.*'.
Severity is normal because the login must be a correct.

I propose to use simple string compare with lowercase to be case insensitive.

Test plan :
1) Don't apply patch
2) Enable system preference 'OpacResetPassword'
3) Go to 'OPAC > Log in to your account > Forgot your password?'
4) Enter an existing userid or cardnumber and '.*' in 'Email'
5) The password recovery is created ! (check table 'borrower_password_recovery')
6) Apply patch
7) Enter an existing userid or cardnumber and '.*' in 'Email'
8) You get the message 'No account was found with the provided information.'
9) Enter an existing userid or cardnumber and in 'Email' the corresponding email but with different case
10) The password recovery is created (check table 'borrower_password_recovery')

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 904e926ba0f407b24aa3d94be5afe37b5e3ec075)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 57a9bf3ef2e4f25227a10f16cec7fb34e162199e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 25758: Return on_reserve over too_soon when not calling from automatic_renewals...
Nick Clemens [Fri, 4 Sep 2020 12:47:58 +0000 (12:47 +0000)]
Bug 25758: Return on_reserve over too_soon when not calling from automatic_renewals cron

Bug 19014 altered CanBookBeRenewed to return (auto_)too_soon over on_reserve

For cron purposes this is the correct behaviour.

For display purposes we wish to see on_reserve over too_soon

This patchset adds a switch to 'CanBookBeRenewed' to alter the priority of these statuses

To test:
 1 - set NoRenewalBeforePrecision to date only
 2 - set a circ rule to auto-renewal=yes, no renewal before=0, checkout period to 7 days
 3 - check item out
 4 - confirm item shows Scheduled For Automatic Renewal in issues table
 5 - place a hold on the item for another patron
 6 - reload issues table for patron 1, confirm checkout still shows "scheduled for automatic renewal" rather than "on hold"
 7 - change No Renewal Before value to 7
 8 - reload issues table for patron 1, confirm checkout now shows "on hold"
 9 - Apply patch
10 - restart_all
11 - Reload the issues table - confirm 'on_hold' still shows
12 - Change No Renewal Before to 0
13 - Refresh issues table, still shows 'On hold'
14 - perl misc/cronjobs/automatic_renewals.pl -v
15 - Result shows 'auto_too_soon'
16 - prove -v t/db_dependent/Circulation.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 26973: [20.05.x] (bug 26119 follow-up) Restore patron's attributes during self...
Jonathan Druart [Tue, 10 Nov 2020 11:55:17 +0000 (12:55 +0100)]
Bug 26973: [20.05.x] (bug 26119 follow-up) Restore patron's attributes during self-registration

The assumption on bug 26119 was wrong. We actually store patron's
attributes during self-registration if
PatronSelfRegistrationVerifyByEmail is not enabled.

Test plan:
Test the different combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
Confirm that the patron's attributes appears during self-registration if
PatronSelfRegistrationVerifyByEmail is not set.
Confirm that the patron's attributes are stored when they are displayed
on the self-registration form
Confirm that you can edit the patron's attributes in any cases (if they
are marked as editable at the OPAC)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ac5a9f2694cc6c1ac2929268024eff520602d20d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 26727: (follow-up) More markup corrections
Owen Leonard [Tue, 3 Nov 2020 18:00:57 +0000 (18:00 +0000)]
Bug 26727: (follow-up) More markup corrections

This patch makes more markup changes to the templates previously
modified in order to try to arrive at some agreeable solutions.

- In the value_builder EXAMPLE template, the <p> is unnecessary and is
  removed. Also removed is the script "type" attribute and obsolete
  CDATA markers.
- In the article request template an unnecessary <p> is removed.
- In the merge patrons template the submit button is now in a <fieldset
  class="action"> as is consistent with other forms.
- In the MARC modifications template I've added <div>s around each
  "line" in the form to add the line break, along with some CSS to add
  margins.
- The submit button is now inside a <fieldset class="action"> and the
  "Cancel" link now has the "cancel" class.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d5d736909ccd24b38e90e89b1484da73972d8645)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 45c29bbccf624a210f79ab6294df97038fb2bd29)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 26727: Fix <p/> appearing in the templates
Katrin Fischer [Sun, 18 Oct 2020 16:30:24 +0000 (16:30 +0000)]
Bug 26727: Fix <p/> appearing in the templates

The self-closing p is not valid in HTML5:

Error: Self-closing syntax (/>) used on a non-void HTML element.
Ignoring the slash and treating as a start tag.

To test:

1)
- Activate Article requests
- Search for a record to place an article request on in staff
- Look up the patron
- Verify the article request form looks ok
2)
- Search for a list of patrons
- Check 2 patrons and merge them using the button above the list
- Verify the distance between the button and the table looks ok
3)
- Create a new MARC modification template
- Create a new action
- Verify the distances between the first and second line of form
  elements looks ok
4)
- Place a hold in staff
- Click on the Suspend link in the holds table (not below)
- Verify the modal looks ok

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bbf0d21284924d6b7529017fc78178b98242aaee)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5643d5432906776d34ea5a13296b0f607fcae306)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 26190: Allow to close a basket with only cancelled order lines
Katrin Fischer [Sat, 17 Oct 2020 22:47:49 +0000 (22:47 +0000)]
Bug 26190: Allow to close a basket with only cancelled order lines

At the moment there are several cases, when closing a basket is not
possible:
- when there are no order lines in it
- when there are order lines with uncertain prices
- when the basket is marked as a standing order

The first case wasn't checked correctly as only pending/received
orders would be counted, but not cancelled orders.

To test:
- Create a basket
- Create an order line
- Verify the "close this basket" button shows
- Cancel the order line - the button disappears
- Apply the patch
- Verify the button appears and works now
- Create another basket - make sure you cannot close it
  without order lines
- Create an order line with uncertain price checked
  - you cannot close it
- Resolve the uncertain price - you can now close the basket.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2d6595a1bf0e04611c2a1d5c18489c6ee799a9aa)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 87cbd07be836291f860ecbd5cea5538863317164)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 26639: Add auto_savepoint to DBIC connection
Jonathan Druart [Fri, 26 Oct 2018 14:17:40 +0000 (11:17 -0300)]
Bug 26639: Add auto_savepoint to DBIC connection

See comment 0.

https://metacpan.org/pod/distribution/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#Nested-transactions-and-auto-savepoints

Otherwise:
DBIx::Class::Storage::txn_rollback(): A txn_rollback in nested transaction is ineffective! (depth 1) at t/db_dependent/Koha/Objects.t line 274

Possible side-effects? Slowness?

We need to push it to master ASAP and see how our test suite behave.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bd63fb2bb941294371a072fea9fc2f930ff5bf3f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 493e62aad82931304bdcf2c63152451aed781b16)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 26605: Correctly URI-encode query string in call number browse plugin
Phil Ringnalda [Fri, 2 Oct 2020 21:52:57 +0000 (14:52 -0700)]
Bug 26605: Correctly URI-encode query string in call number browse plugin

If you search for a call number like "M KRUEGER CO #11" in the
cn_browser.pl plugin, your query is cut off at "M KRUEGER CO " because
the hash isn't escaped, so the browser thinks you are opening a
window and trying to navigate to the element with the id 11 rather
than passing the #11 to the server.

To test:
1) Find the record you will use to test, determing the MARC
framework it uses by going to Edit > Edit record > Settings
2) In Administration > MARC bibliographic framework, click MARC
structure in the Actions menu for that framework
3) Navigate to the 952 tag, in the Actions menu click Edit subfields
4) In the tab for o, choose the Plugin cn_browser.pl and click
Save Changes
5) Click the Edit button next to one of the items on your record
6) In the Full call number field, add " CO #11" to the call number
7) Click the ... next to the field to open the Tag editor
8) In the popup window, verify that the search field includes the
" CO #11" you added to the call number

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
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 c52a9e4cf362949192d3d58adab287cd82effbf1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7ac243c96fef9fcf728d647f1e9d301506ccf08a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 18051: Set UTF8 Flag for record searches/imports from rancor
Nick Clemens [Thu, 29 Oct 2020 12:18:56 +0000 (12:18 +0000)]
Bug 18051: Set UTF8 Flag for record searches/imports from rancor

The advanced cataloging editor uses Koha::MetaSearcher to find and import records
from Z3950.

The records are correctly converted to UTF8, however, we need to set the flag in the
record to ensure they are parsed correctly later

To test:
 1 - Add OHIOLINK as a z39 source as described in earlier comments
 2 - Browse to Cataloging->Advanced editor
 3 - Click Search->Advanced
 4 - Select OHIOLINK
 5 - Search for author 'capek karel'
 6 - Note records look bad
 7 - Apply patch
 8 - Restart all the things
 9 - Repeat
10 - Success!

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 4d92e3d284e392ad681b095c02965fe57a85a5a1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5b5c58e08b04fa6c329d30d834329194ffd422bf)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 18050: move aqbudgetperiods table before aqbudgets, to fix sql error
Mason James [Mon, 26 Oct 2020 18:41:03 +0000 (07:41 +1300)]
Bug 18050: move aqbudgetperiods table before aqbudgets, to fix sql error

00:02:16.310 koha_1       | DBD::mysql::st execute failed: Can't create table `koha_kohadev`.`aqbudgets` (errno: 150 "Foreign key constraint is incorrectly formed") at /usr/share/perl5/DBIx/RunSQL.pm line 278, <$args{...}> line 1.
00:02:16.310 koha_1       | Something went wrong loading file /kohadevbox/koha/installer/data/mysql/kohastructure.sql ([SQL ERROR]: CREATE TABLE `aqbudgets` ( -- information related to Funds
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3df7a02d8198e7a0a0af5459c4c3d2192177b27f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 694f5ee9d8b21532c04598498e10f9f6c7e542c0)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 26606: Correctly URI-encode query string in URL loaded after deleting an authorit...
Phil Ringnalda [Fri, 2 Oct 2020 22:35:04 +0000 (15:35 -0700)]
Bug 26606: Correctly URI-encode query string in URL loaded after deleting an authority record

If you search for "this & that" and delete one of the results, after
it is deleted the search in the reloaded page is for "this " rather
than for "this & that". The template uses the url filter, which is
for filtering an entire URI where :, &, #, etc. should be left alone,
rather than the uri filter which is for filtering a URI component
where they should be encoded.

To test:
1) Go to Authorities > New authority > New from Z39.50/SRU
2) Search for the Author (corporate) this & that collective
3) Actions > Import, Save
4) From the detail for that authority, Edit > Edit as new (duplicate)
5) Edit the 110 field, add 2 at the end and Save
6) Search authorities for this & that
7) For one of the ones you created, Actions > Delete, confirm
8) The page that reloads should have a search for this & that, not
just for this

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.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 16e5a9d8dcf7ab332a455ff74e23115fde27a10f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 54362935908bd9c2061598a9a150c721e620456d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 18050: DBRev 19.11.11.002
Aleisha Amohia [Tue, 17 Nov 2020 04:56:18 +0000 (17:56 +1300)]
Bug 18050: DBRev 19.11.11.002

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 18050: (QA follow-up) Adjust conditions and make use of message text
Katrin Fischer [Mon, 5 Oct 2020 06:17:34 +0000 (06:17 +0000)]
Bug 18050: (QA follow-up) Adjust conditions and make use of message text

- When we run into invalid data, we use Augustin's suggested solution
  and copy the data into a separate table, setting the budget_period_id to
  NULL.
- We amend the output using the new $message.

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 3c8bef50a223e70fe3023222f5f940a2b1771b5d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a88f367c63a2d649625fe367fa64ce3c888638ab)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
3 years agoBug 18050: (follow-up) Force adding FK constraint
Agustin Moyano [Fri, 9 Oct 2020 18:14:26 +0000 (15:14 -0300)]
Bug 18050: (follow-up) Force adding FK constraint

When there are inconsistent budget_period_id in aqbudgets this patch
creates the table _bug_18050_aqbudgets with the original data, then sets
the column to null and warns the user that there is inconsistent data.

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 1193dddd8beb4a10a78e385b221c0f908d92dcf6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5fc0d24ca8c58407e4461142054cb67a4aec5a00)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>