Commit graph

38650 commits

Author SHA1 Message Date
d669694426 Bug 25701: (bug 14419 follow-up) Always display facet groups in the same order
It seems that this regression comes from bug 14419, but I have not found
a logic reason behind that.
This patch restores the behaviour we always had: facet groups must be
displayed in a given order: the Zebra index (au, ccode, holdingbranch,
etc.)

Test plan:
Apply this patch, restart all and confirm that the facets are not moving
up and down when you refresh your search result page.

QA note:
I think the following line must be removed
@facets_loop = sort {defined $a->{expand} && defined $b->{expand} && $a->{expand} cmp $b->{expand}} @facets_loop;

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-15 10:29:53 +02:00
ca7eb99eef Bug 24003: (follow-up) Add all userenv parameters
This patch makes the API set more userenv params than just the
borrowernumber. To test:

1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_*
=> SUCCESS: All tests pass
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-15 10:29:44 +02:00
6b2d8b6779 Bug 24003: (follow-up) Move interface setting to a more readable place
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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-15 10:29:44 +02:00
682d7896dd Bug 24003: Make the API set userenv on authentication
This patch makes the authentication step stash the user that got
authenticated so code outside the Mojo part of Koha can use it (i.e.
through the use of C4::Context->userenv).

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t \
           t/db_dependent/api/v1/auth_basic.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!

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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-15 10:29:44 +02:00
f1a3fad1fc Bug 24003: Regression tests
This patch adds regression tests for the different authentication
mechanisms Koha supports. It highlights the fact that Koha expects
userenv to be set on authentication.

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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-15 10:29:44 +02:00
bbac95d9fb Bug 25526: Equality matching is case sensative
TEST PLAN:
1. Have a fine on a Patron's account.
2. Choose the "Write off Selected" button
3. Enter an amount less than the amount owed by the patron.
4. Koha will give a yellow box with a note "You must collect a value
   greater than or equal to 2.00." The $2.00 is the amount that is
   attempted to write off (the amount less than the amount owed).
5. Apply patch
6. Again try to writeoff an amount less than the amount owed.
7. You should be able to write it off.
8. Try paying an amount more than owed, you should still get an
   error. You shouldn't be able to write off more than the amount.
9. Follow the above steps via 'Pay selected' as aposed to 'Writeoff
   selected'.
10. You should not be able to 'Tender' less than the amount you have
    'Paid'.
11. Disable Javascript and run through all the above steps. You should
    still be blocked where relevant.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-15 10:29:34 +02:00
9ac43fd97b Bug 25492: Your Account Menu button does nothing on mobile devices
This patch removes some redundant code from the OPAC JavaScript which
was causing problems with the show/hide action on two controls which are
shown only at narrower browser widths: The "Your account" menu shown
when the user is on a user-related page, and the "Refine your search"
menu shown on the search results page.

To test, apply the patch and go to the OPAC. Narrow your browser width
to below 768 pixels.

 - Perform a search.
 - On the search results page you should see a "Refine your search"
   link at the top of the results. Clicking it should expand and
   collapse the facets menu.
 - Log in to the OPAC.
 - On the "Your summary" page there should be a "Your account menu" link
   at the top of the main part of the page. Clicking it should expand
   and collapse the account menu.
 - Verify that these menus display correctly when you widen and narrow
   the browser window.

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>
2020-06-12 10:32:35 +02:00
74c7530e3d Bug 17842: Simplify the code
There is no need for all the conditions.
From Encode::encode POD:
  "If the $string is undef, then undef is returned."

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 10:32:35 +02:00
13ec430ecc Bug 17842: UTF-8 encode ISO2709 MARC download from cart
The cart was outputing ISO2709 MARC records with Latin-1
encoding. Records containing non-latin1 characters were
automatically re-encoded as UTF-8 by browsers, which led to
inconsistent character encodings for downloaded MARC files.

This patch explicitly encodes ISO2709 MARC characters from
the cart download as UTF-8 encoded bytes, which resolves the problem.

Test Plan:
0) Don't apply patch
1) Create bib record with only ASCII characters
2) Add a ü character to the title
3) Save bib record
4) Download bib record from cart (opac and staff client)
5) Using xxd or some other program, note that the ü is
represented by a FC byte (latin-1 encoded)
6) Apply the patch
7) Download bib record from cart (opac and staff client)
8) Using xxd or some other program, note that the ü is
represented by C3 BC bytes (utf-8 encoded)
9) Success

(Note that you could potentially use Notepad++ or some other
program to open the downloaded file and just note the encoding
that it finds. You could also try "chardetect" instead. Lots
of options for figuring out the encoding.)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 10:32:35 +02:00
4365b64403 Bug 25653: Update tab selector to use 'active' and include all options
It looks like the functionality was broken when ui tabs were upgraded
and mainmainentry was added

To test:
1 - Browse to Authorities
2 - Search in each tab
3 - Note all search results revert to 'Search main heading a only'
4 - Apply patch
5 - Note selection is retained after search

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 10:32:35 +02:00
369a4e39b4 Bug 14543: (QA follow-up) Add missing filter
This patch adds a missing `| html` filter to the tax_rate value option
that the patchset adds

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 10:32:35 +02:00
5ae7554667 Bug 14543: Order lines updated that have a tax rate not in gist will have tax rate set to 0!
If the tax rate for a given order line has been removed from the system
preference gist, that tax rate will show in the pulldown as 0. If a
librarian then saves the order line the original tax rate will be
overwritten with 0%!

Test Plan:
1) Find an order line
2) Remove the tax rate set for that order line from the syspref gist
3) Edit the order line
4) Note the tax rate is 0
5) Apply this patch
6) Edit the order line
7) Note the tax rate now displays with a warning

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>
2020-06-12 10:32:35 +02:00
4c548cb08f Bug 25634: Warn if koha-shell returns non-zero in koha-foreach
By putting koha-shell in an if statement, "set -e" will no longer
cause the entire koha-foreach program to exit, if koha-shell
returns a non-zero status.

If a non-zero status is returned, we warn on it, and the caller
of koha-foreach can interpret that command visually.

To Test:
1) Write a shell script that says "Hello" and then exits with a 1
status
2) Run koha-foreach against that shell script with multiple instances
available to koha-foreach
3) Before the patch, koha-foreach will die after the first "Hello"
4) After the patch, koha-foreach will continue, through all the
instances, and report which instances returned non-zero statuses
by which command.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 10:32:30 +02:00
88cd45b090 Bug 25693: Set correct permissions on logdir after an upgrade
Since bug 25172 we are failing loudly if the permissions are not correct
and that the logger cannot init successfully.

We must set the correct permission on upgrading.
koha-create deals with new installs

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 09:57:56 +02:00
4714b08f72 Bug 25677: Checkbox options for EDI accounts cannot be enabled
Checking any of the checkboxes in the EDI Account editor does nothing.
They always remain set to "off".

Test Plan:
1) Browse to edi_accounts.pl
2) Create a new EDI account, check all the checkboxes
3) Edit the account, note none of the checkboxes are checked
4) Apply this patch
5) Repeat steps 1-2
6) Note the checkboxes remain checked

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 09:57:47 +02:00
79f7879303 Bug 25557: Correct basket.pl column config
This patch corrects the column configuration tool for basket.pl
TO TEST:
1. Go to Acquisitions and look at basket.pl
2. Open another tab and go to column configuration and try to hide some columns like Quantity.
3. See that the wrong columns are being hidden.
4. Apply patch
5. Trying hiding each column in the table and make sure the correct one is being hidden.
6. Rejoice!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 09:57:38 +02:00
Julian Maurice
4d003ad9cd Bug 25651: Fix modification of authorised value
When modifying an existing authorised value, the category is not
correctly passed to the template and so it is not passed to the
POST request, which results in the authorised value switching to
category '', which effectively make it disappear from the interface.
This patch fixes that.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 09:57:31 +02:00
f32825ae26 Bug 25707: (QA follow-up) Clearer message about what's going on
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 09:57:22 +02:00
e239e13bc9 Bug 25707: (bug 11529 follow-up) Do not update marc mappings, print old mappings to upgrade log
This patch removes the update of marc frameworks from the updatedatabase script and warns the
"MARC to Keyword" (fieldmappings ) to the upgrade log so they can be replaced manually

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-12 09:57:22 +02:00
c9be26ad5a Bug 25538: Default to --login|-i if no command passed
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>
2020-06-11 18:00:32 +02:00
e5ffbb4dd4 Bug 25538: Use sudo -i in koha-shell
See man sudo, -i parameter.
Should we expect regressions?

Test plan:
0. Use D11 or U18.
Don't apply this patch
1.
$ echo $KOHA_INTRANET_URL
$ sudo koha-shell kohadev
$ echo $KOHA_INTRANET_URL
2. Apply this patch
$ cp debian/scripts/koha-shell /usr/sbin/koha-shell
3. Repeat 1.

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>
2020-06-11 18:00:32 +02:00
7c4d244405 Bug 25538: Don't run search_utf8.t if KOHA_*_URL empty
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>
2020-06-11 18:00:32 +02:00
d6c12e2471 Bug 25638: Make the tests pass - ignoring the actual issue
The API related tests still don't pass with the previous modifications.
They pass on D10 but fail on U18 and I did not manage to find where the
problems come from.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-09 16:15:07 +02:00
9555ca1c73 Bug 25638: Update TODO
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-07 12:01:00 +02:00
f4f3c8f18b Bug 25638: Fix regression
Now that float/decimal columns are not treated similar to integer ones,
the default value handling we had set for numeric values is not trapping
the float/decimal cases as it should.

We love tests!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-07 12:01:00 +02:00
8dfbc46aa4 Bug 25638: Fix float/decimal comparison in API related tests
The previous fix from bug 25513 does not work in all versions we are
supporting.

Let's hack the float/decimal columns in the same way we did for integer.

prove t/db_dependent/api/v1/acquisitions_vendors.t \
      t/db_dependent/api/v1/patrons_accounts.t \
      t/db_dependent/api/v1/acquisitions_orders.t

Note that there is another error on U20 for acquisitions_orders.t

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>
2020-06-07 12:00:59 +02:00
59ae6ced7f Bug 25638: Revert "Bug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON"
This reverts commit a79cf4150e.

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>
2020-06-07 12:00:59 +02:00
0569072fc1 Bug 25638: Add tests for JSON conversion vs DBD::mysql
We have the situation of needing to cast numbers so they are not
confused in JSON with strings by DBD::mysql returning them with the
wrong internal flags.

We have also recently removed the cast, and adding it back now.
This test could help us detect this situation in case we make changes in
the area, and even on specific libraries versions.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-07 12:00:59 +02:00
2f828d433d Bug 25641: Fix Koha/XSLT/Base.t failures on U20
There is a change in the version number.
On U20 we get
  Opening and ending tag mismatch: a line 0 and b
On others (D9, D10, U18) we get:
  Opening and ending tag mismatch: a line 1 and b

I did not find where it did come from, so assuming it's just a minor
change and won't have side-effects.

Test plan:
Make sure the tests pass on U20 and another OS

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-07 12:00:49 +02:00
7df314f0b2 Bug 25633: Update debian/control.ini file for 20.05 release cycle
update maintainer details

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-02 11:30:13 +02:00
34fba17f82 Bug 25591: Update list-deps for Debian 10 and Ubuntu 20.04
update list-deps for libcpan-meta-perl package

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-02 11:29:49 +02:00
5d9a51332d Bug 25591: Update list-deps for Debian 10 and Ubuntu 20.04
This patch removes version-specific packages from the debian/control file,
which fixes a bug where koha-common can only be installed on the debian
version that the package was built on

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>
2020-06-02 11:29:49 +02:00
0e49829779 Bug 17084: Automatic debian/control updates (master)
update for 20.05 release cycle

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-02 11:28:02 +02:00
14606d515a Koha 20.06 - start of a new dev cycle
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-02 11:20:53 +02:00
d148412c1d
Update release notes for 20.05.00 release
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-05-31 22:01:25 +01:00
bcea97744b
Update contributors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-05-31 21:37:51 +01:00
aef33d840c
Translation fixes
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-05-31 21:34:23 +01:00
Koha translators
50d619d156
Translation updates for Koha 20.05.00
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-05-31 21:16:45 +01:00
9c5ff1df9d
Bug 24846: Add sponsorship details
Sponsored-by: PTFS Europe
Sponsored-by: ByWater Solutions
Sponsored-by: BibLibre
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-05-29 20:10:16 +01:00
Devinim
a7778ed858 Bug 25592: Add Devinim to about page
This adds Devinim to the 'Contributing companies and
institutions' section on Koha's about page.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-05-29 11:46:29 +02:00
7b1e8c59fe Bug 25618: Fix wrong package install path for misc dir
root@koha-debian9:/# koha-z3950-responder --start d9
[....] Starting Z39.50/SRU daemon for d9:Can't open perl script "/usr/share/koha/bin/z3950_responder.pl/z3950_responder.pl": Not a directory
 failed!

Test plan:
On a dev install, copy the debian script and run it
Same on a package install

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-05-29 11:44:54 +02:00
46e23b3a03 Bug 25617: (QA follow-up) Add responses to tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-05-29 11:30:02 +02:00
dd0c7c55fc Bug 25617: (bug 25133 follow-up) 12 PM is not 24 but 0
There was an error in the precedent code, in 12hr format, 12PM is
actually 00:00

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-05-29 11:30:02 +02:00
a79cf4150e Bug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON
This patch removes a problematic integer casting happening in TO_JSON.
The original need for this cast (a DBD::mysql bug) is now fixed. We
remove the cast as it is causing random failures.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> FAIL: Tests fail with select high values (i.e. casting gives wrong
        results)
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests now pass!
5. Sign off :-D

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>
2020-05-28 17:02:26 +02:00
9d8f9f1d3b Bug 25513: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-05-28 17:02:26 +02:00
f1cc9d6b59 Bug 25601: (bug 18928 follow-up) Fix "Unset" for "return policy for $branch"
returnbranch has to pass an itemtype key when setting the rule (here
setting it to unlimited for any item types)

Test plan:
1. Go the "Circulation and fine rules" admin page
2. Set a rule for "Default checkout, hold and return policy"
3. Unset it
4. Select a library
5. Set a rule for "Default checkout, hold and return policy"
6. Unset it

Display should be consistent with what you selected

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>
2020-05-28 17:02:13 +02:00
Didier Gautheron
218322597e Bug 25608: (bug 23463 follow-up) Fix inventory regression
Follow-up work
  commit bbb504c86f
  Bug 23463: Replace ModItem with Koha::Item->store

Test plan :
    - Create a biblio with default framework
    - Create an item with barcode='000AAA1', callnumber='ZZZAAA1'
    - Create an item with barcode='000AAA2', callnumber='ZZZAAA2'
    - Create a file 'barecodes.txt' containing 2 lines '000AAA1' and '000AAA2'
    - Go to inventory tool : /cgi-bin/koha/tools/inventory.pl
    - Choose file in 'Barcode file'
    - Enter item callnumber between 'ZZZ' and 'ZZZa'
    - Check 'Compare barcodes list to results'
    - Submit
    => without patch, you get an error trace
    - Apply patch, it works

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended commit title.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-05-28 17:02:04 +02:00
051b2d0142 Bug 25444: More minor improvements to simplified loop
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-05-28 17:01:55 +02:00
6b1a53da6d Bug 25444: Simplify the code using a loop
In order to prevent typos or further regressions it is better (I think)
to have this code into a loop

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-05-28 17:01:55 +02:00
8423070649 Bug 25444: Backup/restore course items fields correctly
This patch makes the code set the *_storage fields when adding new
fields to an existing course item. And reverts those fields correctly
when removing the item from the course.

If a new field is enabled on an existing course reserve, the storage
field is not given a value, so when the item goes off reserve, the
item field will always be updated to NULL.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/CourseReserves/CourseItems.t
=> FAIL: Tests fail, data is not reverted correctly
3. Apply this patch and repeat 2
=> SUCCESS: Tests pass! Data is correctly reverted
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-05-28 17:01:55 +02:00