]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 21865: add confirm to remove_unused_authorities.pl script
Fridolin Somers [Mon, 19 Nov 2018 14:45:49 +0000 (15:45 +0100)]
Bug 21865: add confirm to remove_unused_authorities.pl script

Like in most scripts in misc, add confirm argument
to ensure script is not run without knowing what it does.

Test plan:
1) Run misc/migration_tools/remove_unused_authorities.pl -h
2) You see help line for confirm
3) Run misc/migration_tools/remove_unused_authorities.pl
4) You see help and script does nothing
5) Run misc/migration_tools/remove_unused_authorities.pl -c
6) Script runs like wanted

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 21865: ES compatiblity of remove_unused_authorities.pl
Fridolin Somers [Mon, 19 Nov 2018 14:19:46 +0000 (15:19 +0100)]
Bug 21865: ES compatiblity of remove_unused_authorities.pl

The script misc/migration_tools/remove_unused_authorities.pl directly checks if Zebra search is OK.

This patch changes so that this test is only if Zebra is the search engine.
It also adds a test on the search off any authority number indexed (index 'an').
With Zebra its : an,alwaysmatches=''
With ES its : an:*
This test ensure that biblios records are indexed and that not all autorities will be deleted.

Test plan:
1) On a catalog create a new authority
2) Use Zebra in systempreference SearchEngine
3) Stop Zebra server
4) Run misc/migration_tools/remove_unused_authorities.pl -c
5) The script does nothing and says :
   Zebra server seems not to be available. This script needs Zebra runs.
6) Restart Zebra server
7) Delete biblio index base
8) Run misc/migration_tools/remove_unused_authorities.pl -c
9) The script does nothing and says :
   Searching authority number in biblio records seems not to be available : an,alwaysmatches=''
10) Use ElasticSearch in systempreference SearchEngine
11) Delete biblio index base
12) Run misc/migration_tools/remove_unused_authorities.pl -c
13) The script does nothing and says :
    Searching authority number in biblio records seems not to be available : an:*

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 21865: improve remove_unused_authorities.pl script
Fridolin Somers [Mon, 19 Nov 2018 13:46:05 +0000 (14:46 +0100)]
Bug 21865: improve remove_unused_authorities.pl script

remove_unused_authorities.pl script can be improved.

This patch changes changes verbosity so than test mode can be used
to know the autorities that are used and those that can be deleted.
It also writes a line in output if limited authority type(s).

This patch also removes the unused vars $thresholdmin and $thresholdmax.

It also changes the query to use SQL with parameters for authority types.

Test plan :
1) On a catalog create a new authority
2) Be sure catalog is well indexed
3) Run misc/migration_tools/remove_unused_authorities.pl -t
4) You will see the line :
   *** Testing only, authorities will not be deleted. ***
5) You will see lines of :
   authid=x type=y : used X time(s)
6) You will see the line for the authority created in 1) :
   authid=x type=y : can be deleted
7) You will see at the end :
   x authorities parsed
   y can be deleted because unused
   z unchanged because used
8) Run misc/migration_tools/remove_unused_authorities.pl
9) You don't see the line :
   *** Testing only, authorities will not be deleted. ***
10) You will see lines of :
   authid=x type=y : used X time(s)
11) You will see the line for the authority created in 1) :
   authid=x type=y : deleted
12) You will see at the end :
   x authorities parsed
   y deleted because unused
   z unchanged because used
13) Run misc/migration_tools/remove_unused_authorities.pl --auth NP --auth CO
14) You see the line :
    Restricted to authority type(s) : NP,CO.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25053: Clarify the description of syspref PatronSelfRegistrationExpireTemporaryAc...
David Roberts [Sat, 4 Apr 2020 23:13:00 +0000 (23:13 +0000)]
Bug 25053: Clarify the description of syspref PatronSelfRegistrationExpireTemporaryAccountsDelay

This patch changes the wording of this system preference.

To test:

1) Check the current wording of this system preference.
2) Install the patch.
3) Check that the wording of this system preference has changed to "Delete patrons still in the category indicated by PatronSelfRegistrationDefaultCategory X days after account creation."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24547: Add more action logs for holds
Kyle M Hall [Thu, 30 Jan 2020 15:29:05 +0000 (10:29 -0500)]
Bug 24547: Add more action logs for holds

It seems like ModReserveFill and ModReserveAffect should both produce action logs for holds.

Test Plan:
1) Apply this patch
2) Place a hold
3) Check in the item to trap the hold
4) Check out the item to fill the hold
5) Check the action logs for that reserve id
6) Note the new logs!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25027: Use localStorage instead of sessionStorage for results browser
Jonathan Druart [Tue, 31 Mar 2020 14:39:12 +0000 (16:39 +0200)]
Bug 25027: Use localStorage instead of sessionStorage for results browser

Staff side, when a search a done and a result clicked, a browser appears
on the left, to navigate between the different results.

We use sessionStorage to know the list of biblionumber from the result.

As sessionStorage is only for the current tab, we do some ugly things,
to catch the click events, then open the new tab, attach it to the
current window, and put the focus back on the result list.

We really should not do that, and let the user decide what they want to
do with their clicks!

To do so, let use the correct storage, localStorage, and have the
results shared between the windows.

We may need to clear that at some point, isn't it?

Test plan:
Launch a search, click result (left or middle), confirm you see the
browser and that the window/tab opened like any other websites
(depending on your web browser settings).

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20370: Misleading comment for bcrypt - #encrypt it; Instead it should be #hash it
David Roberts [Mon, 13 Apr 2020 01:22:07 +0000 (01:22 +0000)]
Bug 20370: Misleading comment for bcrypt - #encrypt it; Instead it should be #hash it

This patch changes the wording of the comment

To test:

1) Check the wording of Line 67 of Koha/AuthUtils.pm
2) Apply the patch
3) Check that the wording has changed from "Encrypt it" to "Hash it"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24993: fix increment
Liz Rea [Thu, 9 Apr 2020 15:50:04 +0000 (15:50 +0000)]
Bug 24993: fix increment

Aparently ((i++)) isn't portable, changed for an admittedly uglier
but functional increment.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24993: Make sure we are not going to loop indefinitely
Jonathan Druart [Wed, 8 Apr 2020 09:57:06 +0000 (11:57 +0200)]
Bug 24993: Make sure we are not going to loop indefinitely

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24993: Make sure SIP server is stopped before restarting it
Jonathan Druart [Thu, 2 Apr 2020 10:36:16 +0000 (12:36 +0200)]
Bug 24993: Make sure SIP server is stopped before restarting it

Sometimes doing koha-sip --restart instance happens too fast and
the SIP server is not started.

To test:
- have SIP enabled and running for your instance
- issue a restart, make sure it restarts
  sudo koha-sip --restart inst

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25008: Overload Koha::RecordProcessor->options to update filters
Tomas Cohen Arazi [Mon, 30 Mar 2020 13:06:43 +0000 (10:06 -0300)]
Bug 25008: Overload Koha::RecordProcessor->options to update filters

This patch overloads the 'options' accessor generated by Class:Accessor.
It does so the passed options are used to refresh the loaded filters.

Tests are added for this overloaded method as well.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25008: Tests for ->options
Tomas Cohen Arazi [Mon, 30 Mar 2020 13:20:11 +0000 (10:20 -0300)]
Bug 25008: Tests for ->options

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25008: Regression tests
Tomas Cohen Arazi [Fri, 27 Mar 2020 20:53:32 +0000 (17:53 -0300)]
Bug 25008: Regression tests

This patch highlights a behaviour of Koha::RecordProcessor that is
unexpected: if you change the original options using ->options, the
loaded filters don't pick the change. That's because the filter objects
are loaded on ->new, and they are never updated.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/RecordProcessor.t
=> FAIL: Test prove ->options doesn't update the filters!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24764: TinyMCE shouldnt do automatic code cleanup when editing HTML in News Feature
Lucas Gass [Thu, 26 Mar 2020 22:46:26 +0000 (22:46 +0000)]
Bug 24764: TinyMCE shouldnt do automatic code cleanup when editing HTML in News Feature

TEST PLAN:
1. Make a new news item and use the TinyMCE editor, click on the <> icon to go to the Source code editor
2. Add some HTML like <i class="fa fa-facebook-official" aria-hidden="true">TEST</i> and save it.
3. Go back in and notice that TinyMCE has changed it to: <p><em class="fa fa-facebook-official">TEST</em></p>
4. It should not auto clean up and also it should not autowrap with <p> tag.
5. Apply patch patch, and repeat step 2. Save again.
6. It should not have automatiicly changed any HTML or added any <p> wrapper.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24903: Add tests for _handle_seqno
Marcel de Rooy [Thu, 19 Mar 2020 13:39:14 +0000 (14:39 +0100)]
Bug 24903: Add tests for _handle_seqno

Trivial tests.

Test plan:
Run t/Serials/ModSerialStatus.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24903: Special characters like parentheses in numbering pattern cause duplication...
Marcel de Rooy [Thu, 19 Mar 2020 13:20:38 +0000 (14:20 +0100)]
Bug 24903: Special characters like parentheses in numbering pattern cause duplication in recievedlist

Test plan:
Use serial with a numbering pattern with parentheses like "2018 (No. 1)".
Mark serial issue as arrived, check receivedlist on summary.
Edit issue again, check if not duplicated on receivedlist.
Mark issue as missing or not available, check missinglist.
Mark missing issue as not missing, check list again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25038: Fix tabs on the OPAC reading history view
Jonathan Druart [Tue, 7 Apr 2020 11:25:09 +0000 (13:25 +0200)]
Bug 25038: Fix tabs on the OPAC reading history view

OPAC reading history table has three tabs for different checkout types: All, Checkouts, On-site checkouts.

However, all of your checkouts are visible every tab regardless of checkout type.

Test plan:
1. Enable OnSiteCheckouts system preference
2. Perform two checkouts: one normal checkout, one on-site checkout
3. Go to OPAC /cgi-bin/koha/opac-readingrecord.pl
4. Observe your checkouts all are visible in first tab
5. Select second tab and notice that the table is now filtered
6. Same with third tab

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24966: Add unit tests
Kyle M Hall [Fri, 10 Apr 2020 10:43:51 +0000 (06:43 -0400)]
Bug 24966: Add unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24966: (QA follow-up) Fix return value of hold_patron_bcode
Marcel de Rooy [Fri, 10 Apr 2020 09:50:13 +0000 (09:50 +0000)]
Bug 24966: (QA follow-up) Fix return value of hold_patron_bcode

It is used in list context, but we need a scalar value.
Can be fixed by adding scalar's, or returning empty string as here.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25040: monkeypatch Schema::Loader for recent MariaDB
Martin Renvoize [Fri, 3 Apr 2020 10:16:39 +0000 (11:16 +0100)]
Bug 25040: monkeypatch Schema::Loader for recent MariaDB

Recent versions of MariaDB changed the output of 'DESCRIBE' for
timestamp columns with defaults from `CURRENT_TIMESTAMP` to
`current_timestamp()`.  As such the code inside
DBIx::Class::Schema::Loader which catches such cases and outputs
`\"current_timestamp"` as a sensible cross platform default is missed
and this leads of inconsistent class files and bugs with out default
lookup code in Koha::Objects.

This patch serves as a backport of the code I have submitted upstream
such that out developers can continue to use update_dbix_class_files.pl
to build their schema classes from the database and regardless of their
db server version get a consistently correct output.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25050: Adjust marc_records_to_documents to search entire mapping array
Nick Clemens [Fri, 3 Apr 2020 12:14:27 +0000 (12:14 +0000)]
Bug 25050: Adjust marc_records_to_documents to search entire mapping array

There was an assumption in the ES code that match-heading mappings will appear in
a specified portion of the mappings array.

Certain mappings setups will not meet this assumption.
We need to move our searching up one level

The key seems to be having a mapping for a complete field, say 150, in both the
match-heading and another field as well as having mappings for ungrouped fields like
150a 150ab etc.

The unit test coverage should be sufficient for testing

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25050: Unit tests
Nick Clemens [Fri, 3 Apr 2020 12:12:49 +0000 (12:12 +0000)]
Bug 25050: Unit tests

This patch simplay alters the data we use for the tests, doing so causes them to fail

To test:
1 - Apply only this patch
2 - prove -v t/Koha/SearchEngine/Elasticsearch.t
3 - It fails!
4 - Apply next patch
5 - It passes!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24266: (alternate patch) Only use defined borrowernumbers in reconcile_balances...
Aleisha Amohia [Mon, 16 Mar 2020 22:09:51 +0000 (22:09 +0000)]
Bug 24266: (alternate patch) Only use defined borrowernumbers in reconcile_balances.pl cron

I believe the error is triggered when borrowernumbers are left empty in
the accountlines table. Not sure why this would happen, but it appears
to be what causes the problem.

Do not apply the first patch if testing this patch.

To test:
1) sudo koha-mysql INSTANCENAME
2) Create a test borrower, add any payment etc to create an accountline,
    then delete this borrower
3) ensure the AccountAutoReconcile syspref is disabled
4) Go to another borrower's accounting tab
5) Create a manual credit or debit. Confirm this shows in the 'Make a
payment' tab as an amount that COULD be applied, but isn't automatically
applied
6) in your terminal, run the reconcile_balances.pl script
7) Confirm the error does not show in the logs and the balance for
the borrower is correctly reconciled.

Sponsored-by: Horowhenua District Council
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25095: Remove warn left in FeePayment.pm
Kyle M Hall [Thu, 9 Apr 2020 12:24:44 +0000 (08:24 -0400)]
Bug 25095: Remove warn left in FeePayment.pm

It appears that a debugging statement was accidentally left in FeePayment.pm by bug 5605.

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22778: Add unit test
Kyle M Hall [Wed, 8 Apr 2020 14:52:23 +0000 (10:52 -0400)]
Bug 22778: Add unit test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22778: Suggestions with no "suggester" can cause errors
Kyle M Hall [Thu, 25 Apr 2019 19:50:35 +0000 (15:50 -0400)]
Bug 22778: Suggestions with no "suggester" can cause errors

If one tries to modify a suggestion that has no suggester you will get the following error:

Can't call method "lang" on an undefined value at /usr/share/koha/lib/C4/Suggestions.pm line 506

Koha assumes that every suggestion has a borrowernumber in suggestedby

Test Plan:
1) Create a suggestion with an unpopulated suggestedby
2) Attempt to modify that suggestion
3) Note the error
4) Apply this patch
5) Restart all teh things
6) Attempt to modify that suggestion
7) No error!

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23514: Split Call Numbers for all layout types
Theodoros Theodoropoulos [Wed, 8 Apr 2020 07:21:12 +0000 (08:21 +0100)]
Bug 23514: Split Call Numbers for all layout types

This patch ensures call numbers are properly split for layout types
other than 'BAR'.

Test plan:

1. Go to Label Creator and choose/create a Label Layout with "Choose
layout type: Biblio"
2. make sure you have at least "itemcallnumber" in Bibliographic data to
print/Data fields
3. check "Split call numbers" box and save the layout (ie testlayout)
4. create a label batch, using items that have a call number (ie
DC611.B848 H84 1997). LCC is used here, but you may try with Dewey as
well.
5. export selected batch using any template and the layout you created
in previous step to a PDF
6. Call numbers are splitted (as expected) in the resulting PDF file
7. edit the layout you created in the previous step (ie testlayout) and
change the  "Choose layout type:" to either Biblio/Barcode (BIBBAR) or
Barcode/Biblio (BARBIB)
8. export the same batch using the same template and layout as before
9. Call numbers are NOT splitted at all

After patch is applied, call numbers splitting functions are applied
even in Biblio/Barcode (BIBBAR) or Barcode/Biblio (BARBIB) layout types.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25081: Fix wrong comment
Jonathan Druart [Wed, 8 Apr 2020 09:45:51 +0000 (11:45 +0200)]
Bug 25081: Fix wrong comment

Not directly related to previous patch, coming from 23435.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25081: Fix creation of new item for a received issue
Janusz Kaczmarek [Tue, 7 Apr 2020 20:23:20 +0000 (22:23 +0200)]
Bug 25081: Fix creation of new item for a received issue

The Bug 23435 introduced the idea of multiple copies added while
receiving a new issue.  Unfortunately, under some circumstances, it
causes no items being added at all.  It occurs stochastically, only
under some conditions.  But it is quite likely to happen while receiving
a supplemental issue.

The reason fot hist is that, in serials-edit.pl, line ca 292 and infra,
@num_copies is treated in the same way as @tags, while it should be
treated similarly to @bibnums.  It will be obvious after examining the
content of parameters tag, subfield, field_value, ..., number_of_copies.
In other words, for every edited issue number_of_copies is a scalar.

Nota bene:
a) beter to initialize $countdistinct with zero;
b) note that in master, now, before applying the patch,
$itemhash{$item}->{'num_copies'} is treated once as a scalar
and in the next line--as an array:

$itemhash{$item}->{'num_copies'} //= 1;

for (my $copy = 0; $copy < $itemhash{$item}->{'num_copies'}[$index];){

TEST PLAN
=========
1. Have a subscription with the option "Create an item
record when receiving this serial" active and try to receive a
supplemental issue.  Control that a new item under the biblio record
(usually) will not be created.
2. Apply the patch.
3. Repeat p. 1 -- a new item should be created.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22937: Add hint to groups editor
Kyle M Hall [Fri, 27 Mar 2020 16:01:05 +0000 (12:01 -0400)]
Bug 22937: Add hint to groups editor

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25046: Add test
Jonathan Druart [Wed, 8 Apr 2020 09:28:31 +0000 (11:28 +0200)]
Bug 25046: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25046: Include borrowers.othernames in SELECT statement
Andreas Roussos [Thu, 2 Apr 2020 17:14:57 +0000 (19:14 +0200)]
Bug 25046: Include borrowers.othernames in SELECT statement

In C4/Utils/DataTables/Members.pm, the SELECT statement that fetches
patron data from the database does not include borrowers.othernames
in the field list. As a consequence, when the output is in the form
of a DataTable, the Template Toolkit files that refer to .othernames
(such as the patron-title.inc include) won't display the information
from the 'Other name' input field if that field has been filled in.

This patch fixes that.

Test plan:
0) Have a few patrons with some data in the 'Other name' field.
1) Perform a generic search in Home > Patrons to ensure you will get
   a DataTable with results.
2) Observe that the 'Name' column does not include 'Other name' info.
3) Apply the patch, and restart Plack if necessary.
4) Repeat your search: this time you should see the information from
   the 'Other name' field, it will be next to the patron's First name
   and within parentheses.

Sponsored-by: Eugenides Foundation Library
Signed-off-by: Devinim <nazli@devinim.com.tr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24826: Remove warnings from Sendmail
Jonathan Druart [Wed, 11 Mar 2020 15:21:06 +0000 (16:21 +0100)]
Bug 24826: Remove warnings from Sendmail

Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24940: Serials statistics wizard: order vendor list alphabetically
David Roberts [Fri, 3 Apr 2020 15:23:01 +0000 (15:23 +0000)]
Bug 24940: Serials statistics wizard: order vendor list alphabetically

This patch changes the dropdown from being sorted by aqbookseller.id to
aqbookseller.name

To test:
1) Add at least 2 vendors:
 - First: ZZZZ
 - Second: AAAA
2) Add subscriptions for each of the vendors
3) Check the pull down in the serials statistics wizard and verify it
lists them as ZZZZ, AAAA
4) Apply the patch
5) Re-check the pull down in the wizard and check that the vendors are
now listed AAAA,ZZZZ

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25019: Make the ViewPolicy filter initialization standard
Tomas Cohen Arazi [Mon, 30 Mar 2020 12:39:13 +0000 (09:39 -0300)]
Bug 25019: Make the ViewPolicy filter initialization standard

This patch makes the ViewPolicy filter use the 'params' accessor instead
of relying of ->{options} which has no accessor. This will allow
interacting with the filter object be similar through all the filters in
the chain.

To test, we just need to verify no behaviour change takes place:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Filter_MARC_ViewPolicy.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20754: DBRev 19.11.05.002
Joy Nelson [Wed, 29 Apr 2020 20:43:09 +0000 (20:43 +0000)]
Bug 20754: DBRev 19.11.05.002

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20754: DB revision to remove double accepted shares
Marcel de Rooy [Fri, 4 May 2018 08:42:38 +0000 (10:42 +0200)]
Bug 20754: DB revision to remove double accepted shares

[Originally submitted for bug 11943, parked at 20754.]
[Attempt to revive it now.]

Although it is no problem to have them, we could do a cleanup.
This patch just removes duplicate rows from the table.

Note: I considered adding a unique index like:
    ALTER TABLE virtualshelfshares ADD UNIQUE INDEX (shelfnumber, borrowernumber, invitekey);
But the possible NULL values in borrowernumber and/or invitekey require
additional code changes. So I left it alone.

Test plan:
[1] Create two records with same borrowernumber and shelfnumber in the shares
    table, if not present already.
[2] Run updatedatabase.pl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24604: Add 'Pay' button under Transactions tab in patron accounting
Julian Maurice [Thu, 6 Feb 2020 15:15:43 +0000 (16:15 +0100)]
Bug 24604: Add 'Pay' button under Transactions tab in patron accounting

It does the same thing as the 'Pay' button under 'Make a payment' tab.
It is nothing more than a shortcut.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 18227: (QA follow-up) Add fix to koha-common.postinst
Tomas Cohen Arazi [Wed, 1 Apr 2020 03:11:19 +0000 (00:11 -0300)]
Bug 18227: (QA follow-up) Add fix to koha-common.postinst

Now koha-common.postinst has a way to patch log4perl configs on
instances, we should patch the Z3950 responder config accordingly,
before it is backported to 19.11 or the 20.05 release :-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: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 18227: Handle utf8 in Koha::Logger
Olli-Antti Kivilahti [Wed, 8 Mar 2017 10:51:43 +0000 (12:51 +0200)]
Bug 18227: Handle utf8 in Koha::Logger

No more wide characters in print when logging to a file with Koha::Logger.

Test with this string

"♯Turpo :"

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: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25010: DBRev 19.11.05.001
Joy Nelson [Wed, 29 Apr 2020 19:55:46 +0000 (19:55 +0000)]
Bug 25010: DBRev 19.11.05.001

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25010: Fix typo 'rewewal' in debit types
Katrin Fischer [Thu, 26 Mar 2020 21:30:06 +0000 (21:30 +0000)]
Bug 25010: Fix typo 'rewewal' in debit types

This fixes a typo in the debit type description of
RENT_DAILY_RENEW

1) Go to Administration > Debit types
2) Show all debit types
3) Check for the typo
4) Apply patch
5) Verify that the typo is gone
6) Check account_debit_types table for type:
   SELECT * FROM account_debit_types;
7) Run database update
8) Repeat and verify typo is gone

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25024: Do not escape $
Jonathan Druart [Wed, 1 Apr 2020 08:58:28 +0000 (10:58 +0200)]
Bug 25024: Do not escape $

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25024: Make grep match full string
Nick Clemens [Tue, 31 Mar 2020 13:55:21 +0000 (13:55 +0000)]
Bug 25024: Make grep match full string

To test:
1 - Create or have a branch with code CPL
2 - Create two new branches 'ACPL' and 'CPLA'
3 - In branch transfer limits disallow some itype or collection from another branch (FPL) to ACPL and CPLA
4 - Set UseBranchTransferLimits to 'Enforce'
5 - Find a biblio with one item belonging to FPL
6 - On opac, attempt to place a hold
7 - Note that ACPL and CPLA don't show in dropdown, OK
8 - Note that CPL is disabled, NOT OK
9 - Apply patch
10 - Place hold
11 - CPL is now enabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23601: Prevent default for auxclick
Nick Clemens [Mon, 30 Mar 2020 15:16:36 +0000 (15:16 +0000)]
Bug 23601: Prevent default for auxclick

The issue appears to be that the default action is not prevented for middle click because it registers
an 'auxclick' event as opposed to a 'click' event

To test:
1 - Perform a search in staff client
2 - Shift-click and hold on a result
3 - Note a new tab opens
4 - Release the click, no change
5 - Middle click and hold on a result
6 - New tab opens
7 - Release, a second new tab opens
8 - Apply patch
9 - Reload page
10 - Middle click and hold
11 - New tab opens
12 - Release
13 - No new tab

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24964: [19.11.x] Do not fetch all patrons for owner/users of funds
Jonathan Druart [Mon, 6 Apr 2020 09:44:18 +0000 (11:44 +0200)]
Bug 24964: [19.11.x] Do not fetch all patrons for owner/users of funds

admin/add_user_search.pl sets 'patrons_with_acq_perm_only', to only
retrieve patrons with acq (order_manage) permissions.

The original bug was hidden in the existing code, but the behavior was
terrible.
To prevent patrons matching the permissions contrainst to be hidden, we
fetched ALL the patrons from the DB, then filtered them depending on
their permissions. This might have awful performance on DB with lot of
patrons.

So basically with this patch we are adding the pagination back to the
"owner/users for funds" feature, as the permission filtering is now done
at DB level.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24964: [19.11.x] Fix perl critic warning
Kyle M Hall [Thu, 26 Mar 2020 12:53:59 +0000 (08:53 -0400)]
Bug 24964: [19.11.x] Fix perl critic warning

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24964: [19.11.x] Prevent random failures sorting by borrowernumber
Jonathan Druart [Wed, 25 Mar 2020 12:50:45 +0000 (13:50 +0100)]
Bug 24964: [19.11.x] Prevent random failures sorting by borrowernumber

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24964: [19.11.x] Do not filter patrons after they have been fetched
Jonathan Druart [Wed, 25 Mar 2020 10:21:15 +0000 (11:21 +0100)]
Bug 24964: [19.11.x] Do not filter patrons after they have been fetched

The svc/members/search script is called in different places.
In some places (Set owner for a fund, add users to a fund, or set a
manager to a suggestion), we need patrons to be filtered depending on
the permissions they have.
For instance you can only set a fund's owner with a patron that has
acquisition.order_manage.

Currently we have fetching X (default 20) patrons, then filter them
depending on their permission.
Says you have 3 patrons that have the correct permissions but are not in
the 20 first patrons, if you do not define a search term, the search
result will be empty.

This is not ideal and we should filter when requesting the DB.

Test plan:
- Have more than 20 patrons, remove them their permissions
- Create 3 more:
1 superlibrarian
1 with the full acq permission
1 with acquisition.order_manage
- Create a fund and set a owner
- Search for patrons, without specifying a search term (to get them all)
=> Without this patch the new patrons you created are not displayed
=> With this patch they are!

Same test plan apply to set a manager to a suggestion (freshly pushed,
see bug 23590), with suggestions and suggestions.suggestions_manage

Note: The code has been written that way to rely on
C4::Auth::haspermission, but the SQL query is quite trivial and the gain
is important.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24964: [19.11.x] Add tests
Jonathan Druart [Wed, 25 Mar 2020 10:20:20 +0000 (11:20 +0100)]
Bug 24964: [19.11.x] Add tests

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24183: Add before_send_messages hook
Martin Renvoize [Thu, 5 Dec 2019 17:42:50 +0000 (17:42 +0000)]
Bug 24183: Add before_send_messages hook

This patch adds a simple hook to the process_message_queue cronjob
to allow plugins to pre-process messages in the messaging queue before
they are sent.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 19014: [19.11.x] Prevent auto_renew notices form sending if too early to renew
Nick Clemens [Mon, 30 Dec 2019 19:27:26 +0000 (19:27 +0000)]
Bug 19014: [19.11.x] Prevent auto_renew notices form sending if too early to renew

Bug 19014: Unit tests

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 19014: Return auto_too_soon before on_reserve

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 19014: on_reserve blocks auto_renew

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25022: Display problem in authority editor with repeatable field
Owen Leonard [Tue, 31 Mar 2020 14:20:23 +0000 (14:20 +0000)]
Bug 25022: Display problem in authority editor with repeatable field

This patch corrects an error in the structure of the authority editor
template so that repeating subfields do not generate invalid markup. The
correction was found by comparing with addbiblio.tt.

If you are viewing the diff, please note that some minor whitespace
changes have been made.

To reproduce, clone and and populate any repeatable subfield, save, and
open the authority for editing again. The clones subfield will be
formatting incorrectly, showing bullet points on each line.

To test, apply the patch and reload the authority editor showing the
record with the cloned subfield. It should display correctly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 17938: Fix display of label for repeated MARC 583 - Action note fields
Katrin Fischer [Thu, 26 Mar 2020 22:30:52 +0000 (22:30 +0000)]
Bug 17938: Fix display of label for repeated MARC 583 - Action note fields

When there are mulitple 583 on a record, the label "Action note" will be
repeated for each. This fixes it, so that the label only appears once and
multiple fields are separated by | following the existing pattern.

Also makes sure there is a space between $z and other subfields.

Note:
Ind. 1 = private - These won't display in the OPAC
Ind. 1 = 0 or empty - These will display in the OPAC
Staff will display all 583 independent from indicator.

To test:
- Add one or more records with none, one and muliple 583, at least one including $z
  For examples see:
  http://www.loc.gov/marc/bibliographic/bd583.html
- Verify display problems
- Apply patch
- Verify display is improved - one label and $z is followed by a space

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24941: Serials - Fix link to basket from acquisition details information
Katrin Fischer [Sat, 28 Mar 2020 00:22:35 +0000 (01:22 +0100)]
Bug 24941: Serials - Fix link to basket from acquisition details information

Adding orders from subscriptions makes acquisition information visible
in the serials module. In the table of acquisition data is a link back
to the basket - but this link is missing the basket number parameter -
it doesn't work. This patch fixes the TT variable to make it work.

To test:
- Add a subscription
- Add a new basket
- Add a order line using "Add from subscription"
- Go to the subscription details page, check the acquisitions tab
- Try the link to the basket - it should not work
- Apply patch
- Try the link again - now it should bring up the basket page with
  the order.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25012: Fix class on OPAC view link in staff detail page
Katrin Fischer [Fri, 27 Mar 2020 23:46:55 +0000 (00:46 +0100)]
Bug 25012: Fix class on OPAC view link in staff detail page

Probably a copy & paste error: the OPAC view link on the staff
detail page currently has the class succeeding_entry_note.

This patch changes it to opac_view to allow for independent
styling of the link.

Note: The link will only be visible when OPACBaseURL is set.

To test:
- Use the element inspector or check the source code for
  the class used on the OPAC view link on the staff detail page
- Apply patch
- Repeat and verify that the class has changed to opac_view

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25013: Fix capitalization: Edit Items on batch item edit
Katrin Fischer [Fri, 27 Mar 2020 23:54:21 +0000 (00:54 +0100)]
Bug 25013: Fix capitalization: Edit Items on batch item edit

Fixes a tiny string issue: Edit Items --> Edit items

To test:
- Go to tools / batch item edit
- Enter a barcode
- Check the heading above the edit item form
- Apply patch
- Verify the heading is now properly capitalized

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25014: Fix capitalization for "Call Number" in staff and OPAC sort options
Katrin Fischer [Sat, 28 Mar 2020 00:05:14 +0000 (01:05 +0100)]
Bug 25014: Fix capitalization for "Call Number" in staff and OPAC sort options

There are some ocurrences of "Call Number" in the sort option lists in
staff and OPAC. The patch changes them to "Call number".

To test:
- Check the sort option list in staff and OPAC for the typo
- Apply patch
- Verify it's now all corrected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25006: Make Koha::Item->as_marc_field skip undefined subfields
Tomas Cohen Arazi [Fri, 27 Mar 2020 19:38:15 +0000 (16:38 -0300)]
Bug 25006: Make Koha::Item->as_marc_field skip undefined subfields

This patch makes as_marc_field skip subfields that don't have a value or
contains an empty string (replicating C4::Items:1021 logic).

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item.t
=> FAIL: Tests fail because the generated MARC::Field contains undef
subfields.
3. Apply this patch
4. Repeat 2.
=> SUCCESS: Tests pass! Undefined and empty subfields are skipped!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25006: Regression tests
Tomas Cohen Arazi [Fri, 27 Mar 2020 19:36:25 +0000 (16:36 -0300)]
Bug 25006: Regression tests

This patch introduces regression tests for as_marc_field. It makes sure
there are empty subfields and then uses List::MoreUtils' all to verify
all generated MARC subfields contain something (i.e. the undef ones are
skipped).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 19475: Clear the caches at the end of the tests
Jonathan Druart [Mon, 30 Mar 2020 09:35:35 +0000 (11:35 +0200)]
Bug 19475: Clear the caches at the end of the tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 19475: Don't copy holiday if it already exists in target calendar
Emmi Takkinen [Wed, 4 Mar 2020 11:54:34 +0000 (13:54 +0200)]
Bug 19475: Don't copy holiday if it already exists in target calendar

Calendars copy tool created duplicate values to database.
Holidays in target calendar weren't checked before
inserting new holidays. This patch fixes this.

To test:
1. Add holidays for branch A
2. Copy branch A calendar to branch B
3. Repeat copy to branch B
=> Check database, branch B has now duplicate holidays
4. Delete holidays from branches A and B
5. Apply patch
6. Repeat steps 1-3
=> Check database, no duplicates

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 19475: Add unit tests
Emmi Takkinen [Thu, 12 Mar 2020 10:35:39 +0000 (12:35 +0200)]
Bug 19475: Add unit tests

To test prove:
t/db_dependent/Holidays.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 9422: (RM follow-up) Rebase Correction
Martin Renvoize [Fri, 3 Apr 2020 13:10:07 +0000 (14:10 +0100)]
Bug 9422: (RM follow-up) Rebase Correction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 9422: Don't allow access to 'Upload patron images' when patronimages syspref...
Katrin Fischer [Sun, 10 Feb 2019 11:09:08 +0000 (12:09 +0100)]
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off

In addition to checking the patron image upload permission, this
adds a check for the patronimages system preference to the tools
home page and sidebar.

To test:
- Check that the patron image upload tool only displays when
  - system preference patronimages is set to 'Allow'
    and user is either
  - superlibrarian or
  - has bath_upload_patron_images permission
- Save URL of patron image uploader page
- Turn off patronimages
- Verify you get redirected to the home page of Koha when trying
  to access the page

Note: this redirect is already used by the stock rotation feature.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoUpdate release notes for 19.11.05 release v19.11.05
Joy Nelson [Wed, 22 Apr 2020 17:13:19 +0000 (17:13 +0000)]
Update release notes for 19.11.05 release

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoIncrement version for 19.11.05 release
Joy Nelson [Wed, 22 Apr 2020 16:52:21 +0000 (16:52 +0000)]
Increment version for 19.11.05 release

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 7611: Compiled CSS
Joy Nelson [Tue, 21 Apr 2020 19:57:26 +0000 (19:57 +0000)]
Bug 7611: Compiled CSS

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 7611: Adjust tests
Jonathan Druart [Tue, 18 Feb 2020 09:37:58 +0000 (10:37 +0100)]
Bug 7611: Adjust tests

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 7611: (follow-up) separate positive and negative statuses as in the past
Nick Clemens [Fri, 8 Nov 2019 15:49:08 +0000 (15:49 +0000)]
Bug 7611: (follow-up) separate positive and negative statuses as in the past

This patch preserves someting closer to previous functionality.

Negative not for loan are in the 'unavailable' section in red, positive ones are in the 'reference' section in green. Itemtype level will also be in green in reference

Item specific status will override an itemtype level.

The line break between 'reference' and 'unavailable' existed before and is preserved - negative not for loan and checked out items appear here

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 7611: (follow-up) Fix display of undefined statuses and add a class
Nick Clemens [Tue, 5 Nov 2019 16:32:45 +0000 (16:32 +0000)]
Bug 7611: (follow-up) Fix display of undefined statuses and add a class

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 7611: (follow-up) Add missing space
Nick [Tue, 15 Oct 2019 13:30:02 +0000 (13:30 +0000)]
Bug 7611: (follow-up) Add missing space

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 7611: Change negative notforloan as well
Nick [Thu, 29 Aug 2019 12:06:24 +0000 (12:06 +0000)]
Bug 7611: Change negative notforloan as well

This makes the changes apply to both positive and negative notforloan values

The extra line generated before is removed

Some spans are added and cleaned up and labels moved to CSS to allow for easier altering where needed

Itemtypes marked notforloan remain as reference, the label can be changed via css

To test:
 1 - Have a record with items in various statuses, ideally
   - 3 available, with 2 in one branch, 1 in another
   - 3 with itemtype not for loan, 2 in one branch, 1 in another
   - 3 in a positive not for loan status, 2 and 1 as above
   - 3 in a negative not for loan status, 2 and 1 as above
   - 1 in a different positive loan status, but with the same opac description as the negative above
 2 - Search the opac to include this record, take a screenshot
 3 - Apply patch
 4 - Restart all and refresh
 5 - Compare to screen shot
 6 - Differences include:
   - Positive statuses are now on separate line with opac description showing
   - Unavailable (not for loan items) now include callnumber and branch in display
   - Positive and negative notforloan with same description are combined where branches match
   - Inspect the elements, note new spans around 'Items available for
loan/reference'
 7 - Add to OPACUserCSS:
  .ItemSummary .ItemBranch{
    display:none;
  }
  .unavailable .ItemSummary .CallNumber,.unavailable .ItemSummary .LabelCallNumber{
    display:none;
  }
 8 - Note the branches are hidden, and callnumbe rhidden for unavailable
items

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search...
Mehdi Hamidi [Fri, 3 Mar 2017 19:33:29 +0000 (14:33 -0500)]
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results

Added : Call number for all not for loan status

XSLT Results template improvement : Use the NOT_LOAN authorised values

Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results.
Before this patch, these items were only considered as "unavailable".

Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats.

Patch sponsored by the CCSR ( http://www.ccsr.qc.ca )

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25142: Fix wrong grep logical test
Jonathan Druart [Tue, 14 Apr 2020 11:22:44 +0000 (13:22 +0200)]
Bug 25142: Fix wrong grep logical test

To test and understand what's going on, you can try that bit of code:
my @a = qw( a b c a);
my @b = qw( b c d );
my @c;
@c = grep { 'a' eq $_ } @a ? 'ok' : ();
say @c;
@c = ( grep { 'a' eq $_ } @a ) ? 'ok' : ();
say @c;
@c = grep { 'a' eq $_ } @a ? ('ok') : (undef);
say @c;

The problem here:
Have patrons in 3 branches CPL, MPL, SPL
Have a non superlibrarian with edit_borrowers permission but
without view_borrower_infos_from_any_libraries, from CPL
Create a library group with CPL, MPL
Use that non superlibrarian to search for patrons
You can search for patrons fro CPL and MPL
BUT, edit the value for CPL, use SPL (edit the DOM)
Search and... oops

Apply this patch, try again

Also use a superlibrarian patron (and/or with view_borrower_infos_from_any_libraries)
and confirm that they can see all patrons

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested with edit_borrowers permission but NOT view_borrower_infos_from_any_libraries
Editing the DOM I can search (not edit) from any branch
With patch no entries found :)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Amended test plan slightly (+ without)

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 16922: Add RewriteRule to apache-shared-intranet for dev package installs
Marcel de Rooy [Thu, 14 Jul 2016 11:51:21 +0000 (13:51 +0200)]
Bug 16922: Add RewriteRule to apache-shared-intranet for dev package installs

As a simple alternative to the solution in bug 9949 or just as an
additional measure, this patch adds a rewrite rule for intranet
in order to intercept potential misuse of perl scripts that could be
reached on a dev package install via the cgi-bin/koha scriptalias.

It simply rewrites them to the nonexistent "notfound", resulting in a
regular 404 error.

The rewrite rule does not harm regular installs and is just a little extra
step in securing a dev install. You should have more security measures in
place to secure your staff client.

QA Note: Although a rewrite rule may not be our first choice, this one
rule is more elegant and easier to maintain than e.g. a whole bunch of
aliases.

Note: This patch should have a regular and a dev install signoff.

Test plan:
[1] Make sure that this rewrite rule is inserted in your actual apache
    config via /etc/koha/apache-shared-intranet.conf. Restart Apache.
[2] For regular package installs:
    Try one of the URLs in step 3.
    Verify that your staff client still operates as usual. Test a few
    URLs inside some modules.
[3] For dev installs:
    Try some URLs like below.
    Expect 404 errors only, not 500s. If you do not see a 404, go back!
    /misc/stage_file.pl
    /t/db_dependent/default_search_class.pl
    /installer/data/mysql/updatedatabase.pl
    /Makefile.PL
[4] Do you see an additional directory to add to the regex? Please report.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25009: Avoid leakages in opac-showmarc.pl
Tomas Cohen Arazi [Fri, 27 Mar 2020 21:16:58 +0000 (18:16 -0300)]
Bug 25009: Avoid leakages in opac-showmarc.pl

This patch cleans opac-showmarc.pl so it doesn't allow retrieving
records from import batches without requiring any permissions in the
OPAC.

it does so by just removing the code portion that does that.

It also cleans the record fetch operation and how the record processor
is initialized to it actually works :-D

To test:
1. Perform a successful Z39.50 search in cataloguing (this fetches 20
   records usually)
2. Query your DB for a valid import_record_id:
  $ koha-mysql kohadev
  > SELECT * FROM import_records LIMIT 1;
3. Notice some of the MARCXML details (title, author, etc), and the
   import_record_id
4. Point your browser to the opac-showmarc.pl URL like this:
   http://kohadev.mydnsname.org:8080/cgi-bin/koha/opac-showmarc.pl?importid=20
=> FAIL: You get the record! (Bonus: no field/subfield takes place)
5. Hide some obvious subfield on the framework for a known (to you)
   biblionumber
6. Point your browser to:
   http://kohadev.mydnsname.org:8080/cgi-bin/koha/opac-showmarc.pl?id=<biblionumber_here>
=> FAIL: No filtering takes place
7. Apply this patch
8. Repeat 4
=> SUCCESS: You get an error because you did a bad request (no id param)
9. Repeat 6
=> SUCCESS: Subfield filtering actually works!
10. 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: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24487: Add 2 more tests
Jonathan Druart [Thu, 23 Jan 2020 09:47:17 +0000 (10:47 +0100)]
Bug 24487: Add 2 more tests

And make sure tests pass if there is no patron with borrowernumber=10 in
DB.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Ammended test description
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24487: Don't apply matching criteria to path parameters
Agustin Moyano [Thu, 23 Jan 2020 04:50:29 +0000 (01:50 -0300)]
Bug 24487: Don't apply matching criteria to path parameters

This patch separates query parameters from path parameters, and uses exact matching for the later.

To test:
1. Apply this patch
2. prove t/Koha/REST/Plugin/Query.t t/db_dependent/Koha/REST/Plugin/Objects.t
SUCCESS => tests ok
3. Sign off

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24487: Regresion test
Agustin Moyano [Wed, 22 Jan 2020 23:44:04 +0000 (20:44 -0300)]
Bug 24487: Regresion test

This patch introduces a regresion test where a path parameter is combined with 'contains' match criteria

To test:
1. apply this patch
2. prove t/db_dependent/Koha/REST/Plugin/Objects.t

Test should fail at this point.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24705: Fix tests for 19.11.x
Jonathan Druart [Tue, 7 Apr 2020 13:38:37 +0000 (15:38 +0200)]
Bug 24705: Fix tests for 19.11.x

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24553: Fix tests for 19.11.x
Jonathan Druart [Tue, 7 Apr 2020 13:30:06 +0000 (15:30 +0200)]
Bug 24553: Fix tests for 19.11.x

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24901: Fix tests for 19.11.x
Jonathan Druart [Tue, 7 Apr 2020 13:37:13 +0000 (15:37 +0200)]
Bug 24901: Fix tests for 19.11.x

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24901: Add tests for transferbook
Martin Renvoize [Thu, 19 Mar 2020 08:10:00 +0000 (08:10 +0000)]
Bug 24901: Add tests for transferbook

Test plan:
0/ Read the commit and confirm the new tests make sence
1/ Run the tests and verify they pass
2/ Signoff

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24901: Minor refactor of tests
Martin Renvoize [Wed, 18 Mar 2020 19:25:57 +0000 (19:25 +0000)]
Bug 24901: Minor refactor of tests

Test plan:
0/ Read the change and verify it makes sense

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24627: Compiled CSS
Joy Nelson [Wed, 15 Apr 2020 16:38:47 +0000 (16:38 +0000)]
Bug 24627: Compiled CSS

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22771: (QA follow-up) Fix POD
Nick Clemens [Tue, 24 Mar 2020 12:15:26 +0000 (12:15 +0000)]
Bug 22771: (QA follow-up) Fix POD

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22771: Fix mistakes in list of nonfiling character fields
David Gustafsson [Fri, 6 Mar 2020 13:07:53 +0000 (14:07 +0100)]
Bug 22771: Fix mistakes in list of nonfiling character fields

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22771: Respect nonfiling indicators for search fields
David Gustafsson [Wed, 26 Feb 2020 15:14:36 +0000 (16:14 +0100)]
Bug 22771: Respect nonfiling indicators for search fields

Strip initial characters from search fields in accordance with
nonfiling character indicators.

To test:

1) Apply patch
2) Run tests in t/Koha/SearchEngine/Elasticsearch.t
3) All tests should pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25000: SQL report not updated
Nazlı Çetin [Fri, 27 Mar 2020 12:25:46 +0000 (12:25 +0000)]
Bug 25000: SQL report not updated

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24386: Prevent double form submission on adding orders to basket from a file
Nick Clemens [Thu, 9 Jan 2020 15:53:45 +0000 (15:53 +0000)]
Bug 24386: Prevent double form submission on adding orders to basket from a file

To test:
 1 - Have a marc record file
 2 - Go to Acquisitions, find a vendor, then an open basket
 3 - Add to basket from a new file (if you already have one staged you can choose that instead)
 4 - Import the file, then add to basket
 5 - On the page where you select the records and set info select a record, set matching to 'Do not check' fill in the fund for the order
 6 - When ready, click save as many times as you can
 7 - When you go to the basket there are many copies of the order added
 8 - Don't despair, apply the patch
 9 - Repeat above
10 - When ready to add orders, click furiously
11 - The order is only added once!
12 - Success!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24765: Updated on date in Claims returned starts off as 12/31/1969
Kyle M Hall [Mon, 2 Mar 2020 14:36:47 +0000 (09:36 -0500)]
Bug 24765: Updated on date in Claims returned starts off as 12/31/1969

When an item is claimed returned by staff, there is a column called Updated On - this date field column should remain blank until this claimed returned has been updated.  Currently, when an item has been claimed returned, the date in the updated column states 12/31/1969. This date only shows up in the display, it is doesn't show up in the database like this.

Test Plan:
1) Enable return claims
2) Make a claim
3) Note the 'updated on' column has the date 1969-12-31
4) Apply this patch
5) Reload the page ( you may need to clear your browser cache )
6) Note the field is now blank

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24905: Make installer update log4perl.conf for instances
Tomas Cohen Arazi [Thu, 19 Mar 2020 13:51:40 +0000 (10:51 -0300)]
Bug 24905: Make installer update log4perl.conf for instances

This patch makes koha-common.postinst check if the log4perl.conf files
on the instances need tweaking. If they do, it appends the relevant
configuration text.

To test:
1. Install Koha 19.11 or earlier using the packages
2. Create an instance:
   $ koha-create --create-db test1
   $ koha-create --create-db test2
=> FAIL: /etc/koha/sites/test1/log4perl.conf doesn't include an entry for
z39.50
3. Apply this patch and run:
   $ docker run \
      --volume=/path/to/your/clone:/koha \
      --volume=/dest/path/for/debs:/debs \
      --privileged
      --env VERSION=19.12.00.047 \
      koha/koha-dpkg:master
Note: Paths need to be adjusted
4. Grab the .deb files and put them on the machine you're testing this
5. Edit /etc/koha/sites/test2/log4perl.conf and add the following text
   at the bottom: log4perl.logger.z3950
6. Install the debs:
   $ sudo dpkg -i koha-perldeps koha-deps koha-common
=> SUCCESS: Install process doesn't explode due to the addition
=> SUCCESS: /etc/koha/sites/test1/log4perl.conf has a new entry for log4perl.logger.z3950
=> SUCCESS: /etc/koha/sites/test2/log4perl.conf doesn't have a new entry for log4perl.logger.z3950
7. 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: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24905: Add missing entry in log4perl-site.conf.in
Tomas Cohen Arazi [Thu, 19 Mar 2020 12:47:25 +0000 (09:47 -0300)]
Bug 24905: Add missing entry in log4perl-site.conf.in

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24614: Fix Reports/Guided.t
Jonathan Druart [Fri, 27 Mar 2020 16:09:27 +0000 (17:09 +0100)]
Bug 24614: Fix Reports/Guided.t

DBD::mysql::st execute failed: Column 'public' cannot be null [for Statement "UPDATE `saved_sql` SET `last_modified` = ?, `notes` = ?, `public` = ?, `report_group` = ?, `report_name` = ?, `report_subgroup` = ?,
`savedsql` = ? WHERE ( `id` = ? )" with ParamValues: 0='2020-03-27T16:03:04', 1=undef, 2=undef, 3=undef, 4='Just another report', 5=undef, 6=undef, 7=25] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836.
    # Looks like you planned 17 tests but ran 6.

update_sql expect all the paramters to be set, otherwise it will be
nulled.

The best way to fix it is at test level. There is only 1 occurrence in
controller/module, and it sends all the parameters. That is the correct
way to do and will make things easier when we will removed them to use
Koha::Reports directly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24614: Use Koha::Reports from save_report and update_sql
Jonathan Druart [Tue, 11 Feb 2020 16:21:38 +0000 (17:21 +0100)]
Bug 24614: Use Koha::Reports from save_report and update_sql

In order to get the default value defined at DBMS level, we use
Koha::Reports (to inherit from Koha::Object->store) from the 2 add/edit
methods of C4::Reports::Guided.
A second step would be to remove completely those CRUD subroutines and
use directly Koha::Reports instead.

Test plan:
1. Add and edit some reports
2. Disable memcached, create a report, edit it
=> Should not crash
3. Make sure the tests make sense and that they pass after the second
patch.

The error was:
DBD::mysql::db do failed: Column 'cache_expiry' cannot be null [for
Statement "UPDATE saved_sql SET savedsql = ?, last_modified = now(),
report_name = ?, report_group = ?, report_subgroup = ?, notes = ?,
cache_expiry = ?, public = ? WHERE id = ? "] at
/kohadevbox/koha/C4/Reports/Guided.pm line 633.

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: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24614: Add tests
Jonathan Druart [Tue, 11 Feb 2020 16:21:15 +0000 (17:21 +0100)]
Bug 24614: Add tests

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: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24829: ClaimReturnedWarningThreshold is always triggered if patron has one or...
Kyle M Hall [Mon, 9 Mar 2020 13:33:54 +0000 (09:33 -0400)]
Bug 24829: ClaimReturnedWarningThreshold is always triggered if patron has one or more claims

ClaimReturnedWarningThreshold is supposed to display a warning if a patron has more than the number of claims specified in the system preference. Currently the warning is displayed for any number of claims over zero.

Test Plan:
1) Make 3 return claims for a patron
2) Set ClaimReturnedWarningThreshold to 4
3) Note the claims warning displays for the patron on circulation.pl
4) Apply this patch
5) Reload circulation.pl, the warning should go away
6) Set ClaimReturnedWarningThreshold to 2
7) Reload the page, the warning should reappear

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24875: Remove extra punctuation from tools start page
Katrin Fischer [Fri, 13 Mar 2020 20:30:06 +0000 (20:30 +0000)]
Bug 24875: Remove extra punctuation from tools start page

The patron clubs note was ending with .., but patch also removed
some single . to be consistent with the majority of entries on the
tools page.

To test:
- Check the tools start page for ending . in the notes
- Apply patch
- Verify the punctuation is now consistent

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24877: Add link from vendor to linked subscriptions
Katrin Fischer [Fri, 13 Mar 2020 20:52:24 +0000 (20:52 +0000)]
Bug 24877: Add link from vendor to linked subscriptions

Koha shows the number of subscriptions linked to a vendor,
but there is no way to look them up. This adds a link to the
subscription search with the vendor name, so there is an easy way
to find the subscriptions.

To test:
- Be superlibrarian or have serials permission
- Make sure you have one or more subscriptions linked to vendors
- Go to the vendor's detail page in acquisitions
- Verify the number of subscriptions is now a link
- Verify the search results are correct when clicking on it
- Remove permissions (no serials, not superlibrarian)
- Verify now the number shows, but is not linked

Signed-off-by: Nazlı Çetin <nazli@devinim.com.tr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>