Commit graph

37637 commits

Author SHA1 Message Date
6285224143
Bug 23463: Fix cn_source for new item
get_dirty_columns only work for existing items.

This fixes t/db_dependent/ShelfBrowser.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:34 +00:00
a494bb1b49
Bug 23463: Fix IsItemIssued.t
It seems that some of those tests could be removed as safe_delete is
widely tested in Koha/Item.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:34 +00:00
974caa4304
Bug 23463: Fix tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:34 +00:00
de9ce93cf2
Bug 23463: Fix safe_return return value in deletion tools
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:33 +00:00
57eb6e4226
Bug 23463: (follow-up) Fix timestamp default value
For discussion, this patch revert the changes made previously.

This line exists in Koha::Item->store as it is the translation of:
    if (exists $item->{'timestamp'}) {
        delete $item->{'timestamp'};
    }
that was coming from _do_column_fixes_for_mod (called from ModItem)

To preserve existing behavior I would be in favor of keeping it like that to
avoid regression, and deal with it separately if we want to improve/remove it.

So basically here we are setting it to undef in Koha::Item->store to make it
handle correctly by the parent Koha::Object->store. I agree that's kind of weird
and must be improved.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:33 +00:00
794e8f992e
Bug 23463: Move DelItem.t and Items_DelItemCheck.t tests to a Koha/Item.t subtest
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:33 +00:00
f70a738bca
Bug 23463: Fix timestamp default value
This sounds wrong as we should let the DBMS do that, but it was failing.
Here we are doing the same as Koha::Patron->store for dateenrolled

To recreate the failure, prove t/db_dependent/Koha/Item.t without this
patch:
DBD::mysql::st execute failed: Column 'timestamp' cannot be null [for
Statement "UPDATE `items` SET `more_subfields_xml` = ?, `timestamp` = ?
WHERE ( `itemnumber` = ? )" with ParamValues: 0='<?xml version="1.0"
encoding="UTF-8"?>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:33 +00:00
cc6f25fec4
Bug 23463: (follow-up) Remove DelItemCheck and ItemSafeToDelete
Wrong replacement in additem.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:33 +00:00
18555f244a
Bug 23463: cn_sort needs to be updated if cn_source changed
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:33 +00:00
f76a75a3d3
Bug 23463: Replace recently added occurrences
Few occurrences have been added since this patchset has been originaly
written

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:32 +00:00
22f8584ead
Bug 23463: build cn_sort only if needed
No need to calculate cn_sort if not dirty when we store

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:32 +00:00
befc3f19f7
Bug 23463: Fix items.cn_source vs cn_source
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:32 +00:00
fce29fb77d
Bug 23463: update permanent_location if location has been updated
This change to Koha::Item->store seems correct here, but tests from /db_dependent/Items.t is failing now.

Adjusting them to make them pass.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:32 +00:00
bef6c36156
Bug 23463: Fix AutomaticItemModificationByAge.t
We do not want to log if nothing changed

How could we do that better?

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:32 +00:00
eeaf0b19e0
Bug 23463: Getting less item-level_itypes warnings (?)
So, we get less warnings. I do not really understand why...

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:32 +00:00
4bce8c68fe
Bug 23463: Fix failing tests
And adding a FIXME about discard_changes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:32 +00:00
2088b6857e
Bug 23463: Fix CancelReceipt.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:31 +00:00
2677da8f17
Bug 23463: Remove no longer needed subs related to default values
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:31 +00:00
a3687711b0
Bug 23463: Remove DelItemCheck and ItemSafeToDelete
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:31 +00:00
b844b19dfc
Bug 23463: Remove DelItem
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:31 +00:00
fc09b0d491
Bug 23463: Remove ModItem
There should not be any calls left

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:31 +00:00
6ae8919e92
Bug 23463: Remove _mod_item_dates
We did not do anything useful here.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:31 +00:00
516e76d1b5
Bug 23463: _do_column_fixes_for_mod dealt with integer location and timestamp moved
That's done in Koha::Item->store, and Koha::Object->store for integers.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:30 +00:00
7ec06a1ae8
Bug 23463: _set_derived_columns_for_mod was only used for cn_sort
Same as _set_defaults_for_add

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:30 +00:00
7d35052a14
Bug 23463: Move plugin hook
From C4::Items to Koha::Item

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:30 +00:00
df520d2d62
Bug 23463: remove trivial UpdateHoldingbranch sub
We do not need this subroutine, moving it where it is used.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:30 +00:00
bbb504c86f
Bug 23463: Replace ModItem with Koha::Item->store
Starting to replace the ModItem calls with Koha::Item->store

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:30 +00:00
0c8d8e867b
Bug 23463: AddItem removing
We are done with AddItem, only need to log and index.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:30 +00:00
488a6f98a6
Bug 23463: Replace _set_derived_columns_for_add
Remove the unique call to _set_derived_columns_for_add
Even if design to deal with other values it only dealts with cn_sort

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:29 +00:00
02134d7604
Bug 23463: Remove _set_defaults_for_add
_set_defaults_for_add is no longer needed as it is handled by dbic and koha::object->store

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:29 +00:00
2075a22ed3
Bug 23463: Replace AddItem calls with Koha::Item->store
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:26 +00:00
9b33b8babd
Bug 23463: fix for testbuilder - set default value items.damaged=0
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:22 +00:00
150b835ab3
Bug 23463: Remove uneeded SearchItemsByField subroutine
It is no longer used.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:17 +00:00
826eda128e
Bug 23463: Replace SearchItemsByField by SearchItems
The subroutine SearchItemsByField is only called once and can be
replaced easily with SearchItems

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-23 09:26:09 +00:00
fcaed6ef24
Bug 24297: Record 'Manual' trigger transfers
To test:
1 - Apply patches, restart_all
2 - Gi to Circulation->Transfer
3 - Transfer an item
4 - Check the branch transfers table
5 - The reason is set to 'Manual'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 16:04:07 +00:00
f04e77c7e5
Bug 24436: DBRev 19.12.00.049
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 16:02:15 +00:00
9364ceba0c
Bug 24436: Add handling for reserve transfer triggers
To test:
1 - Place a hold for pickup at a different branch than you are signed in at on an item owned by current branch
2 - Check in the item
3 - Confirm the transfer
4 - Check the branchtransfers table and note the reason is 'Reserve'
5 - Set the preference CanMarkHoldsToPullAsLost to allow
6 - Place a hold on an item at branch you are singed in at
7 - Ensure you are not using strict sql modes (bug 22431)
8 - Go to Circulation->Holds to pull
9 - Mark hold as lost
10 - Check branchtransfers and confirm reason is "LostReserve"
11 - Check in item from step 1 at the correct branch
12 - Go to Circulation->Holds awaiting pickup
13 - Cancel the reserve
14 - Check branchtransfers and confirm reason is "CancelReserve"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:59:45 +00:00
46da9fcecc
Bug 24436: Add 'Reserve' options to branchtransfers trigger
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:59:40 +00:00
3ebe29bf2a
Bug 24299: DBRev 19.12.00.048
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:58:07 +00:00
3b6326a6ed
Bug 24299: Add Unit test for 'reason' in transferbook
Test plan
1/ Run test and verify it passes
2/ Signoff

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:54:58 +00:00
5013a1bf85
Bug 24299: Record 'RotatingCollection' as a transfer trigger
This patch adds support for passing a trigger to
C4::Circulation::transferbook and passes 'RotatingCollection' to it when
called inside the rotating collections routine.

Test plan:
1/ Perform a rotating collection transfer operations
2/ Check the database for instances of 'RotatingCollection' in the
branchtransfers.reason field.
3/ Signoff

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:54:55 +00:00
12cae89523
Bug 24299: Add 'RotatingCollection' branchtransfer trigger
This patch adds the RotatingCollection value to the database enum for
branchtransfer.reason

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:54:49 +00:00
Aleisha Amohia
77c66abf7a
Bug 24688: Check the priority of the fulfilled hold when fixing priorities
Currently when fixing priorities of existing holds, priorities aren't
fixed when checking out a middle priority hold because the hold has been
fulfilled and deleted. This patch adds a check for, if the hold can't be
found, an old hold with the required reserve_id.

To test:
1. Place at least four holds on a biblio for different borrowers
2. Check out an item to the 3rd priority borrower
3. Check the existing holds table for the biblio. The priorities might be
out of order, or try clicking the dropdowns and there might be an empty
dropdown option, or open the browser developer tools and notice the option
values in the select are missing value=3.
4. Apply patch and restart memcached
5. Check out an item to the 2nd priority borrower
6. Check the existing holds table for the biblio. Confirm the priorities
have been fixed and are now consecutive with no gaps.

Sponsored-by: Chartered Accountants Australia and New Zealand
Signed-off-by: Emmi Takkinen <emmi.takkinen@outlook.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:41:31 +00:00
3944f20beb
Bug 24892: Resolve uninitialized warns from opac-memberentry
Especially line 500 (current master).

Use of uninitialized value $new_data{"sort2"} in string eq at /usr/share/koha/opac/opac-memberentry.pl line 500.
Use of uninitialized value in string eq at /usr/share/koha/opac/opac-memberentry.pl line 500.

Simple fix, not completely trivial due to adding xor ;)

Test plan:
Do not apply, update from opac memberentry. Check warns in log.
Apply patch, update again. Less warns?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:40:43 +00:00
Katrin Fischer
4c66b9c874
Bug 24848: Improve manual links for the label creator
Some of the manual links in the label creator tool were
not working correctly or pointing to the wrong pages.

A problem is the label-manage.pl file. This can show
different data depending on an added parameter. Example:
/cgi-bin/koha/labels/label-manage.pl?label_element=template

But it appears that parameters will be ignored when creating
links to the manual. So this patch links to the beginning
of the label creator section in the manual for now.

To test:
- Go to the lable creator
- Try the various pages of the tool
  - Note: All 'New ...' links should point to the
    correct section in the manual (batches, templates, ...)
    Except: Barcode range. This feature is new and not
    yet documented in the manual. Link goes to label creator section.
  - Note: All 'Manage ...' links should point to the
    beginning of the 'label creator' section in the manual

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:40:05 +00:00
64035301fc
Bug 24553: Use 'barcode' not 'item_id' when removing hold from SIP patron
The drop_hold routine was using the wrong parameter for item info in the patron's
array of holds. We store it as 'barcode' not 'item_id'. This is true for both waiting and unavailable
holds

To test:
1 - Apply unit tests patch
2 - prove -v t/db_dependent/SIP/ILS.t
3 - It fails
4 - Apply second patch
5 - prove -v t/db_dependent/SIP/ILS.t
6 - It passes!

You can also see bug 24175 - you cna hack sip_cli_emulator to allow cancelling a hold
and check the messages, test coverage is improved by this patch and should be sufficient
for testing

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:39:24 +00:00
5dcb02ec88
Bug 24553: Unit tests
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:39:14 +00:00
56195db216
Bug 22025: Remove warnings when importing patrons
The following warning is raised when importing patrons
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018

if one of the following headers is passed but does not have a value:
 * privacy
 * privacy_guarantor_fines
 * privacy_guarantor_checkouts
 * anonymized

Test plan:
- Do not apply the patch
- Generated a csv file with at least one those headers
- Import it using the import_patrons.pl script (or using the GUI)
- Notice the warnings without the patch
- Apply the patch
- Confirm that the warnings do not longer appear

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:38:25 +00:00
29243a3c82
Bug 22025: Add a regression test
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:38:17 +00:00
65f7a7190b
Bug 13775: Set main headings to mandatory in authority frameworks (UNIMARC)
Same as previously, for UNNIMARC

For unimarc_complet:
CLASS => 245
CO => 210
CO_UNI_TI => 235
EXP => 232
FAM => 220
GENRE/FORM => 280
NAME_COL => 245
NP => 200
NTEXP => 242
NTWORK => 241
PA => 260
PERS => 223
PUB => 217
SAUTTIT => 240
SNC => 250
SNG => 215
TM => 216
TU => 230
WORK => 231

For unimarc_lecture_pub:
CO => 210
NP => 200
SAUT => 200
SAUTTIT => 240
SCO => 210
SNC => 250
SNG => 215
STU => 230
TU => 230

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-20 15:37:35 +00:00