koha.git
3 years agoUpdate release notes for 20.05.00 release v20.05.00
Martin Renvoize [Sun, 31 May 2020 21:01:13 +0000]
Update release notes for 20.05.00 release

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

3 years agoUpdate contributors
Martin Renvoize [Sun, 31 May 2020 20:37:41 +0000]
Update contributors

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

3 years agoTranslation fixes
Martin Renvoize [Sun, 31 May 2020 20:33:04 +0000]
Translation fixes

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

3 years agoTranslation updates for Koha 20.05.00
Koha translators [Sun, 31 May 2020 19:54:51 +0000]
Translation updates for Koha 20.05.00

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

3 years agoBug 24846: Add sponsorship details
Martin Renvoize [Fri, 29 May 2020 19:04:16 +0000]
Bug 24846: Add sponsorship details

Sponsored-by: PTFS Europe
Sponsored-by: ByWater Solutions
Sponsored-by: BibLibre
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25592: Add Devinim to about page
Devinim [Fri, 22 May 2020 22:11:31 +0000]
Bug 25592: Add Devinim to about page

This adds Devinim to the 'Contributing companies and
institutions' section on Koha's about page.

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

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

3 years agoBug 25618: Fix wrong package install path for misc dir
Jonathan Druart [Thu, 28 May 2020 13:30:02 +0000]
Bug 25618: Fix wrong package install path for misc dir

root@koha-debian9:/# koha-z3950-responder --start d9
[....] Starting Z39.50/SRU daemon for d9:Can't open perl script "/usr/share/koha/bin/z3950_responder.pl/z3950_responder.pl": Not a directory
 failed!

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

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

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

3 years agoBug 25617: (QA follow-up) Add responses to tests
Nick Clemens [Thu, 28 May 2020 17:37:20 +0000]
Bug 25617: (QA follow-up) Add responses to tests

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

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

3 years agoBug 25617: (bug 25133 follow-up) 12 PM is not 24 but 0
Jonathan Druart [Thu, 28 May 2020 14:12:57 +0000]
Bug 25617: (bug 25133 follow-up) 12 PM is not 24 but 0

There was an error in the precedent code, in 12hr format, 12PM is
actually 00:00

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

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

3 years agoBug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON
Jonathan Druart [Fri, 22 May 2020 12:29:20 +0000]
Bug 25513: Remove unneeded integer casting in Koha::Object->TO_JSON

This patch removes a problematic integer casting happening in TO_JSON.
The original need for this cast (a DBD::mysql bug) is now fixed. We
remove the cast as it is causing random failures.

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

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

3 years agoBug 25513: Regression tests
Tomas Cohen Arazi [Wed, 27 May 2020 12:55:16 +0000]
Bug 25513: Regression tests

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

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

3 years agoBug 25601: (bug 18928 follow-up) Fix "Unset" for "return policy for $branch"
Jonathan Druart [Tue, 26 May 2020 08:10:52 +0000]
Bug 25601: (bug 18928 follow-up) Fix "Unset" for "return policy for $branch"

returnbranch has to pass an itemtype key when setting the rule (here
setting it to unlimited for any item types)

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

Display should be consistent with what you selected

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

3 years agoBug 25608: (bug 23463 follow-up) Fix inventory regression
Didier Gautheron [Wed, 27 May 2020 02:18:58 +0000]
Bug 25608: (bug 23463 follow-up) Fix inventory regression

Follow-up work
  commit bbb504c86f5ca0a474365d4839177412f415c4ee
  Bug 23463: Replace ModItem with Koha::Item->store

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

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

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

3 years agoBug 25444: More minor improvements to simplified loop
Kyle M Hall [Wed, 27 May 2020 10:28:40 +0000]
Bug 25444: More minor improvements to simplified loop

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

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

3 years agoBug 25444: Simplify the code using a loop
Jonathan Druart [Wed, 27 May 2020 08:25:15 +0000]
Bug 25444: Simplify the code using a loop

In order to prevent typos or further regressions it is better (I think)
to have this code into a loop

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

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

3 years agoBug 25444: Backup/restore course items fields correctly
Kyle M Hall [Tue, 26 May 2020 13:08:15 +0000]
Bug 25444: Backup/restore course items fields correctly

This patch makes the code set the *_storage fields when adding new
fields to an existing course item. And reverts those fields correctly
when removing the item from the course.

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

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

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

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

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

3 years agoBug 25444: Add unit tests
Kyle M Hall [Tue, 26 May 2020 17:04:11 +0000]
Bug 25444: Add unit tests

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

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

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

3 years agoBug 20116: Fix package install path for clear_cache.pl
Jonathan Druart [Tue, 26 May 2020 12:41:04 +0000]
Bug 20116: Fix package install path for clear_cache.pl

root@koha-debian10:~# koha-translate --install es-ES
/bin/bash: /usr/share/koha/misc/bin/clear_cache.pl: No such file or directory

The script is in /usr/share/koha/bin/clear_cache.pl

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

3 years agoBug 25556: fix for unnecessary empty name/value pairs creation
Petro Vashchuk [Mon, 25 May 2020 14:39:58 +0000]
Bug 25556: fix for unnecessary empty name/value pairs creation

During the web-install onboarding process, when the default circulation rule gets created, "circulation_rules" table gets populated with empty rule_name/rule_value items. This behavior differs from how the "unset" button on the smart-rules.pl page in "Default checkout, hold and return policy" group acts and leads to unpredictable bug when empty "holdallowed" rule_name prevents holds from any user.
This fix removes creation of these empty name/value pairs.

To reproduce:
    1) Start with an empty installation (or delete all circulation rules and press "unset" in hold and return policy section on /cgi-bin/koha/admin/smart-rules.pl page). This is to have the circulation_rules table empty so onboarding.pl will work.
    2) Go through the onboarding.pl process and create a default circulation rule.
    3) Make sure that circulation_rules table contains will contain empty "patron_maxonsiteissueqty", "max_holds", "patron_maxissueqty", "returnbranch", "holdallowed" and "hold_fulfillment_policy" fields.
    4) Apply the patch.
    5) Repeat steps 1 and 2.
    6) Observe that there are none of six mentioned above name/value pairs appeared.

To reproduce the bug with empty "holdallowed" rule_name:
    1) Repeat steps 1, 2 and 3 that are listed in the previous instruction of reproduction, in order to get empty "holdallowed" field.
    2) Find existing or create a new book with available status and place a holding on it.
    3) Observe the yellow notification window with "Cannot place hold. No items are available to be placed on hold." warning.
    4) Apply the patch.
    5) Repeat steps 1 and 2.
    6) Observe that hold was successfully placed and yellow notification does not appear anymore.

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

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

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

3 years agoBug 22630: Display correct "in storage" value
Jonathan Druart [Mon, 25 May 2020 08:25:52 +0000]
Bug 22630: Display correct "in storage" value

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

3 years agoBug 24413: (follow-up) Add tests
Jonathan Druart [Mon, 25 May 2020 08:14:19 +0000]
Bug 24413: (follow-up) Add tests

Add missing transaction.

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

3 years agoBug 25540: Default for branches.pickup_location must be 0
Jonathan Druart [Fri, 22 May 2020 13:33:36 +0000]
Bug 25540: Default for branches.pickup_location must be 0

This is a try to fix failures in both
t/db_dependent/Template/Plugin/Branches.t
t/db_dependent/Koha/Biblio.t

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

3 years agoBug 25540: Use build_sample_item
Jonathan Druart [Tue, 19 May 2020 13:31:43 +0000]
Bug 25540: Use build_sample_item

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

3 years agoBug 25517: Look in all possible places for MO files
Julian Maurice [Fri, 22 May 2020 14:45:02 +0000]
Bug 25517: Look in all possible places for MO files

On a 'dev' install, MO files will be installed in
<intranetdir>/misc/translator/po
On 'standard' and 'single' installs, they will be installed in
<intranetdir>/../../misc/translator/po

This patch makes Koha::I18N try to use the "dev" directory first, and
fallback to the "standard" directory.
If none of these directories exist, it dies.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25591: Update debian/control for debian 10
Mason James [Fri, 22 May 2020 20:56:00 +0000]
Bug 25591: Update debian/control for debian 10

This patch updates the debian/control for koha 20.05 on debian 10

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

3 years agoBug 24380: (RM follow-up) Fix update statement to prevent regression
Martin Renvoize [Fri, 22 May 2020 13:49:06 +0000]
Bug 24380: (RM follow-up) Fix update statement to prevent regression

The update statement did not respect the original value of
CalcalateFinesOnReturn and so would result in an unexpected functional
change during upgrades.

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

3 years agoBug 24347: Add sponsorship details
Martin Renvoize [Fri, 22 May 2020 12:15:55 +0000]
Bug 24347: Add sponsorship details

Sponsored-by: Athens County Public Libraries
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24612: Fix existing ReserveSlip tests
Jonathan Druart [Fri, 22 May 2020 09:20:00 +0000]
Bug 24612: Fix existing ReserveSlip tests

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

3 years agoBug 23975: (RM follow-up) Comment example configuration
Martin Renvoize [Fri, 22 May 2020 11:09:29 +0000]
Bug 23975: (RM follow-up) Comment example configuration

As promised, I am commenting out the configuration for git repositories
to use for searches by default prior to release. To enable the feature,
simply uncomment the relevant github repositories or add your own.

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

3 years agoIncrement version for 20.05.00 alpha release
Martin Renvoize [Fri, 22 May 2020 10:20:28 +0000]
Increment version for 20.05.00 alpha release

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

3 years agoTeams fixes
Martin Renvoize [Fri, 22 May 2020 10:39:37 +0000]
Teams fixes

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

3 years agoTranslation Fixes
Martin Renvoize [Fri, 22 May 2020 10:12:22 +0000]
Translation Fixes

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

3 years agoClean up 'John Doe'
Martin Renvoize [Fri, 22 May 2020 09:40:26 +0000]
Clean up 'John Doe'

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

3 years agoTranslation updates for Koha 20.05.00
Koha translators [Fri, 22 May 2020 09:18:12 +0000]
Translation updates for Koha 20.05.00

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

3 years agoAdd 20.11 release team
Martin Renvoize [Mon, 18 May 2020 18:08:20 +0000]
Add 20.11 release team

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

3 years agoUpdate Contributors for 20.05
Martin Renvoize [Mon, 18 May 2020 15:42:54 +0000]
Update Contributors for 20.05

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

3 years agoBug 24229: Avoid fetching ALL items in test
Tomas Cohen Arazi [Wed, 20 May 2020 22:04:24 +0000]
Bug 24229: Avoid fetching ALL items in test

I'm not sure what we need to test here, besides we get results. I'm
pretty sure we shouldn't allow a plain GET return all objects because it
could cause a DOS very easily. But it certainly belongs to a separate
bug/discussion.

In this case, I put a constraint on the items domain (by using
_per_page=10 in the query params) so it won't happen that under certain
conditions the user agent used by Test::Mojo time outs.

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: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25473: Move JavaScript out of the footer of addorderiso2709.tt
Owen Leonard [Thu, 14 May 2020 11:47:51 +0000]
Bug 25473: Move JavaScript out of the footer of addorderiso2709.tt

This patch undoes the move of the JavaScript block to the footer made in
Bug 22734. The item information tab can include embedded JavaScript for
cataloging plugins, and these don't currently work with JS in the
footer.

To test, apply the patch and test the JavaScript driven features of the
"Add to basket from a staged file" page:

- Acquisitions -> Vendor -> Basket -> Add to basket from a staged file
  - MARC and Card previews, select all/clear all
  - Item information tab: Cataloging plugins for fields like
    date acquired, barcode
  - Default accounting details tab: Show inactive control

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25567: Fix typo categorycode vs category_code
Jonathan Druart [Thu, 21 May 2020 13:35:33 +0000]
Bug 25567: Fix typo categorycode vs category_code

Well, this is actually the real root of the error!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25567: Prevent patron category type's categorycode to be created with ""
Jonathan Druart [Thu, 21 May 2020 13:30:35 +0000]
Bug 25567: Prevent patron category type's categorycode to be created with ""

It must be NULL/undef, the default from the DB.

The method Koha::Patron::Attribute::Type->categorycode is not covered by tests!

To recreate:
Create a new patron attribute type, don't select a patron's category (and not repeatable or unique)
Go to the batch patron modification tool, enter a cardnumber, next.
=> boom!
Apply the patch, edit the patron attribute, save
Go to the batch patron modification tool, enter a cardnumber, next.
=> success!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24413: Add tests
Jonathan Druart [Wed, 13 May 2020 13:18:29 +0000]
Bug 24413: Add tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24413: Do not remove the restrictions from AddReturn
Jonathan Druart [Fri, 21 Feb 2020 11:37:44 +0000]
Bug 24413: Do not remove the restrictions from AddReturn

As we are now removing them from MarkIssueReturned they should not be
removed from AddReturn as well.
Also I think this will fix a regression, if $doreturn is not set (in
case the item is withdrawn and BlockReturnOfWithdrawnItems or the item
is lost and BlockReturnOfLostItems, and other specific cases).

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24413: Apply AutoRemoveOverduesRestrictions for lost items
Jonathan Druart [Mon, 17 Feb 2020 15:27:57 +0000]
Bug 24413: Apply AutoRemoveOverduesRestrictions for lost items

It's quite hard to know where this need to be fixed.
it can be either MarkIssueReturned or LostItem, depending on the
different cases we want to handle.

This patch picked MarkIssueReturned, but maybe the similar code in
AddReturn needs to be removed then.

== Test plan ==
1. Set MarkLostItemsAsReturned to 'from items tab of the catalog module'
2. Set AutoRemoveOverduesRestrictions to 'Do'
3. Set up an overdues restriction in the notice triggers
4. Check out an item and let the overdues process restrict the account
5. Navigate to the moredetail.pl page (items tab) for the overdue item
6. Mark the item lost
7. Return to the account in question - notice the item has been returned, but the restriction remains
8. Clean state: remove restriction + remove item lost status
9. Apply patch
10. Redo the test but this time in addition to the item being returned,
    the restriction will be lifted.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24612: Use the reserve_id to identify a reserve when building a notice
Jonathan Druart [Mon, 13 Apr 2020 11:42:02 +0000]
Bug 24612: Use the reserve_id to identify a reserve when building a notice

Now that we have the reserve_id PK on the reserves table we should use
it (instead of the couple borrowernumber, biblionumber)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24612: Add tests
Jonathan Druart [Mon, 13 Apr 2020 11:10:55 +0000]
Bug 24612: Add tests

ReserveSlip call need to be adjusted in test.
We also add a new reserve (same biblio, same patron) to highlight the problem.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24612: Make hold-transfer-slip take reserve_id
Jonathan Druart [Wed, 12 Feb 2020 09:02:56 +0000]
Bug 24612: Make hold-transfer-slip take reserve_id

To make sure we are going to display the correct hold's info we need to
pass the reserve_id.

== Test plan ==
1. Add some content to HOLD_SLIP notice, e.g.

  <h2>[% branch.branchname %]</h2>
  <div>[% biblio.author %]<br>[% biblio.title %]<br>[% item.barcode %]
  <ul><li> Reserve ID:  [% hold.reserve_id %]</li>
  <li>Expiration date: [% hold.expirationdate %]</li></ul>

2. Add 2 holds for 1 patron to a single record
3. Check the reserve IDs in the reserves table - on a clean sandbox, they will be 1 and 2
4. Check in one of the items from the record and print the slip
5. Note that the reserve ID on the slip is 2 and the expiration date is blank
6. Repeated check ins do not change this
7. Check in a second item from the record
8. Note that the reserve ID for this hold is also 2, but this time the expiration date is filled in
9. Check in the first item again - the reserve ID stays as 2, but this time the expiration date is filled in
10. Apply patch
11. cancel the holds to come back to a clean state
    (and maybe ensure items aren't in transit)
12. redo the test and see the following differences
13. 1st checkin:
    1. expiration date ok
    2. the reserve ID is the one of the first hold
14. 2nd checkin:
    1. expiration date ok
    2. the reserve ID is the one of the second hold

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25428: Correctly encode link if authority subfield is a URL
Owen Leonard [Fri, 8 May 2020 16:13:40 +0000]
Bug 25428: Correctly encode link if authority subfield is a URL

This patch modifies the script and template for showing the details of
an authority record so that if the authority subfield is configured to
be a link the link is correctly output in the template.

To test you must have an authority type configured with at least one
subfield designated as a URL:

 - Go to Administration -> Authority types
 - Select "MARC structure" from the actions menu for the authority type
   you want to modify.
 - Select "Subfields" from the actions menu for the tag containing
   the subfield you want to modify (for instance 856).
 - Edit the subfield you want to display as a link (e.g. subfield u).
 - In the subfield configuration form under "Advanced constraints" check
   the "Is a URL" checkbox and save your changes.

 - Apply the patch and go to Authorities in the staff interface.
 - Search for or create an authority record which contains URL
   information in the right subfield (for instance 856$u).
 - View the details for the record. Using the 856 example, the "8" tab
   should contain an active link pointing to the correct URL.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25452: Restore alternate address email display
Jonathan Druart [Mon, 11 May 2020 08:58:15 +0000]
Bug 25452: Restore alternate address email display

Broken since
  commit 0ab22e1c7c6b6e8d14a4fb7478ab2a3d42da347d
  Bug 18789: Send Koha::Patron object to the templates

Test plan:
Create or modify a patron, fill the "email" field of the "alternate
address" block (B_email)
Go to the detail view of the patron
=> Without this patch the email is not display
=> With this patch applied you see it!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25506: Fix for "Use of uninitialized value" in about.pl
Slava Shishkin [Thu, 14 May 2020 14:53:47 +0000]
Bug 25506: Fix for "Use of uninitialized value" in about.pl

Perl warning on the "About Koha" page:

Use of uninitialized value in string eq
at /home/vagrant/kohaclone/about.pl line 220.

Fixed by adding additional precheck for
C4::Context->config('zebra_auth_index_mode') being Perl's "true".

To test:
    1) Ensure you don't have "<zebra_auth_index_mode>...
       </zebra_auth_index_mode>" in your koha-conf.xml so you will have
       "C4::Context->config" returning "undef"
    2) Go to the "About Koha" page.
    3) Observe the warning in the log file.
    4) Apply patch.
    5) Repeat step 2.
    6) Check that previous warning was suppressed.

Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25563: (bug 24386 follow-up) Don't disable submit button if form has not been...
Jonathan Druart [Thu, 21 May 2020 10:00:34 +0000]
Bug 25563: (bug 24386 follow-up) Don't disable submit button if form has not been submitted yet

On bug 24386 we prevent double form submission using the our own preventDoubleFormSubmit JS function.

The problem is that we are checking some conditions, and prevent the
form submission if something is not filled (for instance no checkbox
checked, or no fund selected).

Technically it means that:
- click the submit button
- it submits the form
- we disable the submit button
- we prevent the form to be submitted before something is wrong
At this stage the button is disabled and the form cannot be longer be
submitted.

This patch replaces the "on submit" event of the form with the "on click" event of the submit button.
Which means we are going to:
- click the submit button
- we prevent the form to be submitted before something is wrong
=> The button will only be disabled if the form is really submitted

Test plan:
- stage a marc record
- acquisitions: have a basket
- click on "Add to basket"
- "From a staged file"
- Don't tick the record
- Save
- You should see an expected error message
- Tick the record
- Save
- You should see an expected error message
- Choose a fund
- Click the "Save" button as many times as you can, to try double submit
it.
=> The order is saved

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25411: Group conditions in if elsif
Jonathan Druart [Wed, 20 May 2020 15:12:56 +0000]
Bug 25411: Group conditions in if elsif

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25411: Add special handling for public plugin routes
Tomas Cohen Arazi [Thu, 14 May 2020 22:09:04 +0000]
Bug 25411: Add special handling for public plugin routes

This patch implements the required logic in the API code so plugins are
not affected by the new RESTPublicAnonymousRequests system preference.
It is up to the plugin develpers to handle this

To test:
1. Apply the tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> FAIL: Notice the tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Yay! Not bad for a friday evening!
5. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25411: Regression tests
Tomas Cohen Arazi [Thu, 14 May 2020 18:15:52 +0000]
Bug 25411: Regression tests

This patch adds tests the new RESTPublicAnonymousRequests syspref
doesn't apply to routes added by plugins.

It is up to the plugin developer to handle those conditions.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> FAIL: Notice the tests fail

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25284: chown /var/log/koha log files on koha-create
Jonathan Druart [Tue, 19 May 2020 12:26:56 +0000]
Bug 25284: chown /var/log/koha log files on koha-create

To prevent Apache to create intranet-error.log and opac-error.log with
root permission we chown them after it has been restarted (and so
created them) when a new Koha instance is created

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

3 years agoBug 25485: Remove tiny_mce symlink during pre install of deb package
David Cook [Mon, 18 May 2020 05:41:34 +0000]
Bug 25485: Remove tiny_mce symlink during pre install of deb package

This patch removes the tiny_mce symlink before Koha package installation
using the same method that we used when we removed the YUI symlink
in 2015.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25485: Remove all mention of tiny_mce in debian/rules
David Cook [Mon, 18 May 2020 03:28:56 +0000]
Bug 25485: Remove all mention of tiny_mce in debian/rules

This patch removes the removal of the following during the
build process:
/usr/share/koha/intranet/htdocs/intranet-tmpl/lib/tiny_mce

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25485: TinyMCE broken in Debian package installs
Kyle M Hall [Tue, 12 May 2020 18:19:53 +0000]
Bug 25485: TinyMCE broken in Debian package installs

When installing the Debian package of Koha, we install the Debian tinymce package and symlink over our own tinymce libs that are in the Koha codebase. This version of tinymce does not have the same files and because of this, tinymce does not get loaded.

We should remove the use of the tinymce Debian package, and just use our own version of TinyMCE.

Test Plan:
1) Install Koha 19.11 from package
2) Browse to the news editor
4) Note the WYSIWYG editor is missing
5) Build a new Koha package with this patch applied, install it
6) Reload the news editor
7) Note the WYSIWYG editor is back!

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

3 years agoBug 25524: Remove --line-regexp option in log4perl_component()
David Cook [Mon, 18 May 2020 07:08:18 +0000]
Bug 25524: Remove --line-regexp option in log4perl_component()

The current grep expression uses -x|--line-regexp, but that causes
the regexp to fail to match since we're not specifying a regexp
that can match a whole line. We can either provide a better regexp,
or remove that --line-regexp option.

This patch removes the --line-regexp (ie -x) option from the grep
in log4perl_component, so that it detects logger components correctly.

To Test:
0) Apply patch
1) Build Koha package
2) Look at /etc/koha/sites/kohadev/log4perl.conf in an existing
Koha instance (e.g. on koha-testing-docker), and note it has
components for z3950, api, and sip
3) Install package
4) Note that /etc/koha/sites/kohadev/log4perl.conf is the same as before
5) Remove the "log4perl.logger.sip and log4perl.appender.SIP lines from
/etc/koha/sites/kohadev/log4perl.conf
6) Reinstall package
7) Note that the missing lines have been appended to the file at
/etc/koha/sites/kohadev/log4perl.conf

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25531: Debar patron if needed when checkin is backdated
Jonathan Druart [Mon, 18 May 2020 15:50:11 +0000]
Bug 25531: Debar patron if needed when checkin is backdated

If think this case does not apply to real-life, but the logic needs to
be fixed.
If an item is due now, and AddReturn is called now with a return date in
the future, the issue is overdue and the patron must be debarred.
However it is not as we compare with now and not the return date

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25531: Add tests
Jonathan Druart [Mon, 18 May 2020 15:49:37 +0000]
Bug 25531: Add tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25502: Adapt Advanced macros routes to current guidelines
Tomas Cohen Arazi [Thu, 14 May 2020 12:06:51 +0000]
Bug 25502: Adapt Advanced macros routes to current guidelines

The original development started before the changes we introduced in the guidelines in late 2019, and the major code changes that took place in January 2020.

- Attribute mapping logic is now on the Koha::Object-level (the patches implement that, but are not using it)
- Related to the above, some helper methods like to_api and to_model are kept, the same for the mappings in the controller, they should all go away
- Related to the above, set_from_api and new_from_api should be used instead of using helper to_api and to_model methods in the controller
- $c->objects->search doesn't use the to_model and to_api params
- Response status codes need to be changed, at least for DELETE operations

Those are fixed by this patch.

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

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25493: Make ->unhandled_exception use Koha::Logger
Tomas Cohen Arazi [Wed, 13 May 2020 20:17:21 +0000]
Bug 25493: Make ->unhandled_exception use Koha::Logger

To test:
1. Edit the Koha/REST/V1/Cities.pm 'list' method adding
   die("Nada"); before the render step.
2. Restart plack and try the endpoint
=> SUCCESS: The message is generic, but you see something is
logged in /var/log/koha/kohadev/api-error.log
3. Change die("Nada"); for a real exception like:

    use Koha::Exceptions;
    Koha::Exceptions::DuplicateObject->throw("Nada");
4. Repeat 2.
=> SUCCESS: The message is generic, but a meaningful text is added to
the logs.
5. Point your browser to the /api/v1/hola route from your dev
   environment
=> FAIL: Wow, such a weird error
6. Apply this patch
7. Restart plack and repeat 2, 3 and 4
=> SUCCESS: No behaviour change
8. Repeat 5
=> SUCCESS: The regular Mojolicious 404 weird page
9. Sign off :-D

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

3 years agoBug 25501: Supress warnings on installing translation
Julian Maurice [Tue, 19 May 2020 13:05:41 +0000]
Bug 25501: Supress warnings on installing translation

To test:
1) Verify the error installing translations for any language
2) Apply the patch
3) Repeat 1), check warning is gone

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>

3 years agoBug 25481: Pass --user to start-stop-daemon when a pidfile is used
Jonathan Druart [Thu, 14 May 2020 14:04:20 +0000]
Bug 25481: Pass --user to start-stop-daemon when a pidfile is used

Since D10, the behaviour of start-stop-daemon changed, see from its
manual:
"""
Warning:  using this match option with a world-writable pidfile or using it alone with a daemon that writes the pidfile as an unprivileged (non-root) user will be refused with an error (since
version 1.19.3) as this is a security risk, because either any user can write to it, or if the daemon gets compromised, the contents of the pidfile cannot be trusted, and  then  a  privileged
runner (such as an init script executed as root) would end up acting on any system process.  Using /dev/null is exempt from these checks.
"""

Test plan:
koha-plack --restart kohadev
should success with this patch.
Without this patch you get:
start-stop-daemon: matching only on non-root pidfile /var/run/koha/kohadev/plack.pid is insecure

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25535: Hold API mapping maps cancellationdate to cancelation_date, but it should...
Kyle M Hall [Mon, 18 May 2020 18:14:42 +0000]
Bug 25535: Hold API mapping maps cancellationdate to cancelation_date, but it should be cancellation_date

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25516: Fix for "Can't call method unblessed on unblessed reference"
Petro Vashchuk [Mon, 18 May 2020 11:45:56 +0000]
Bug 25516: Fix for "Can't call method unblessed on unblessed reference"

Software error:
    Can't call method "unblessed" on unblessed reference at ../reserve/request.pl line 581.
was caused by recent commit with `wantarray` removal in sub pickup_locations in ‘Item.pm’
and visible on fresher Perls (where experimental feature "autoderef" removed https://www.effectiveperlprogramming.com/2010/11/use-array-references-with-the-array-operators/ )

To test:
    1) Get a clean dev environment after "reset_all"
    2) Add an empty record for “Default checkout, hold and return policy” on /cgi-bin/koha/admin/smart-rules.pl.
    3) Open item record, like /cgi-bin/koha/reserve/request.pl?biblionumber=1&borrowernumber=1
    4) Observe the error (Can't call method "unblessed" on unblessed reference at ../reserve/request.pl line 581.)
    5) Apply patch.
    6) Repeat steps 2 and 3.
    7) Observe that the error is gone.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25510: Put space between negation operator and function name
David Cook [Mon, 18 May 2020 06:23:07 +0000]
Bug 25510: Put space between negation operator and function name

This patch puts a space between the negation operator ! and
the function name (ie log4perl_component).

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

3 years agoBug 25510: Fix syntax error in koha-common.postinst
Jonathan Druart [Fri, 15 May 2020 08:12:46 +0000]
Bug 25510: Fix syntax error in koha-common.postinst

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

3 years agoBug 25068: Fix koha-common.install directives
David Cook [Mon, 18 May 2020 03:02:05 +0000]
Bug 25068: Fix koha-common.install directives

Bug 24735 removed etc/searchengine/queryparser.yml, which removed
the need for koha-common.install to install the following file:
debian/tmp/etc/koha/searchengine

This patch removes that line and causes the Koha packages to build
correctly again.

To test:
0) Apply patch
1) Build a Koha package using one of the following methods:
- https://wiki.koha-community.org/wiki/Building_Debian_Packages_-_The_Easy_Way
- https://hub.docker.com/r/koha/koha-dpkg
- https://gitlab.com/minusdavid/koha-deb-builder-docker

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

3 years agoBug 13881: Add Sponsorship details
Martin Renvoize [Tue, 19 May 2020 07:24:46 +0000]
Bug 13881: Add Sponsorship details

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 13881: (RM follow-up) Fix terminology
Martin Renvoize [Tue, 19 May 2020 07:17:56 +0000]
Bug 13881: (RM follow-up) Fix terminology

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

3 years agoBug 13881: DBRev 19.12.00.091
Martin Renvoize [Tue, 19 May 2020 07:17:17 +0000]
Bug 13881: DBRev 19.12.00.091

Correction to preference terminology

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

3 years agoBug 25188: Sponsorship details
Martin Renvoize [Mon, 18 May 2020 15:56:22 +0000]
Bug 25188: Sponsorship details

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

3 years agoBug 20847: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 15:55:03 +0000]
Bug 20847: Add sponsorship details

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

3 years agoBug 25130: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 15:53:11 +0000]
Bug 25130: Add sponsorship details

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

3 years agoBug 20370: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 15:51:55 +0000]
Bug 20370: Add sponsorship details

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

3 years agoBug 23119: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 15:51:03 +0000]
Bug 23119: Add sponsorship details

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

3 years agoBug 24976: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 15:49:59 +0000]
Bug 24976: Add sponsorship details

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

3 years agoBug 24484: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 15:49:21 +0000]
Bug 24484: Add sponsorship details

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

3 years agoBug 25278: add clear_search_fields_cache method
Nick Clemens [Fri, 15 May 2020 11:46:07 +0000]
Bug 25278: add clear_search_fields_cache method

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25278: (follow-up) Fix other occurrences
Nick Clemens [Mon, 27 Apr 2020 14:05:46 +0000]
Bug 25278: (follow-up) Fix other occurrences

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25278: Retrieve correct search fields for authorities
Nick Clemens [Fri, 24 Apr 2020 15:52:50 +0000]
Bug 25278: Retrieve correct search fields for authorities

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25278: Unit tests
Nick Clemens [Fri, 24 Apr 2020 16:32:06 +0000]
Bug 25278: Unit tests

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25277: Unit test
Nick Clemens [Fri, 24 Apr 2020 16:08:44 +0000]
Bug 25277: Unit test

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25277: Don't specify a field in query if none passed
Nick Clemens [Fri, 24 Apr 2020 13:34:31 +0000]
Bug 25277: Don't specify a field in query if none passed

== test plan ==
To test:
0 - Have Koha running with ES 6 enabled
1 - Launch the z3950 responder:
    perl misc/z3950_responder.pl --config-dir /kohadevbox/koha/etc/z3950 --debug
2 - Connect using yaz-client:
    yaz-client localhost:2100
2.1 Alternative, if you add the responder as a Z39.50 server in Koha and
  do a catalogue Z39.50 search. Don't forget to search in the keywords
  field. Not the title field.
3 - base biblios
4 - find bruce
5 - No results
6 - Stop the responder
7 - Apply patch
8 - Repeat
9 - This time you get results

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25308: Escape querystring for Z39.50 popup from cataloging
Phil Ringnalda [Wed, 29 Apr 2020 00:16:51 +0000]
Bug 25308: Escape querystring for Z39.50 popup from cataloging

Test plan:

1. For bonus fun, Administration -> MARC Frameworks -> New framework,
with the code A&B and description Ants & Bees
2. In the A&B Actions menu, choose MARC structure since Import won't
work
3. Accept the offer to copy in structure from default
4. Cataloging -> New record -> Ants & Bees
5. Type This & That in the 245$a (and for extra credit, in 020$a, and
create an author authority with an & in it so you can put it in the
100/110)
6. Click Z39.50/SRU search, make sure everything you typed is prefilled
including the parts after &
7. Search for anything that will retrieve a record (the ISBN This &
That probably won't), choose Import
8. Check that the record came back, and verify in the Settings menu that
it's still in the Ants & Bees framework.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 11446: Use encodeURIComponent on search terms in authority lookup plugin
Phil Ringnalda [Fri, 24 Apr 2020 18:34:29 +0000]
Bug 11446: Use encodeURIComponent on search terms in authority lookup plugin

While adding the data from the existing field to the auth_finder URI,
we're using encodeURI(), which is meant for an entire URI and thus
doesn't escape &. Things that are going into a querystring need
encodeURIComponent() instead.

Test plan:

1. Enable the system preference EnableAdvancedCatalogingEditor
2. Clear your browser cache, even a shift+reload won't get you a fresh
marc-editor.js for the advanced editor
3. Create a Topical Term authority with 150 $aThis & That$xStuff & Junk
4. In the Basic editor, use the authority plugin on the 650 field to
select that authority.
5. Click the authority plugin again, verify that the popup contains This
& That and Stuff & Junk rather than just This and Stuff
6. From the Cataloging home page choose Advanced editor
7. In a new line paste 650 _ _ ‡aThis & That‡xStuff & Junk
8. Type ctrl+shift+L and verify the popup shows both words in both
fields
9. When you remember the plugin exists there too, edit your
Stuff & Junk authority, and in a 550 tag type One & Two in
$a and Three & Four in $x and click the plugin link, verify that
the search window has your search terms not cut off.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25527: Add logger to Koha::ExternalContent
Tomas Cohen Arazi [Mon, 18 May 2020 12:26:09 +0000]
Bug 25527: Add logger to Koha::ExternalContent

This patch makes Koha::Logger initialization happen in the ->new method
for the Koha::ExternalContent-derived classes. In the case of RecordedBooks,
it doesn't look like it is used at all.

In the case of OverDrive, it will now use the Koha::ExternalContent
exported logger accessor.

I added tests for this addition to Koha::ExternalContent to the
OverDrive tests.

I also removed references to Test::DBIx::Class as it is not used at all.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha_ExternalContent_OverDrive.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 25527: Initialize the logger when required
Tomas Cohen Arazi [Mon, 18 May 2020 12:23:42 +0000]
Bug 25527: Initialize the logger when required

In an OO package, the logger initialization should happen in the
constructor. This is not an OO package and the initialization is
happening on loading it. This is a wrong behaviour and certainly breaks
in environments where initialization cannot happen (package building,
for example). There could be several options to solve this, as it is
used in a single sub on this package, I opted for initializing on that
sub.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 22970: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 14:21:09 +0000]
Bug 22970: Add sponsorship details

Sponsored-by: Université de Lyon 3
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24255: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 13:28:26 +0000]
Bug 24255: Add sponsorship details

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24252: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 13:27:40 +0000]
Bug 24252: Add sponsorship details

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 23593: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 12:51:47 +0000]
Bug 23593: Add sponsorship details

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 23592: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 12:49:32 +0000]
Bug 23592: Add sponsorship details

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 24080: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 11:50:44 +0000]
Bug 24080: Add sponsorship details

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 23442: Add sponsorship details
Martin Renvoize [Mon, 18 May 2020 11:49:22 +0000]
Bug 23442: Add sponsorship details

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

3 years agoBug 13881: DBRev 19.12.00.090
Martin Renvoize [Mon, 18 May 2020 10:43:55 +0000]
Bug 13881: DBRev 19.12.00.090

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

3 years agoBug 13881: (RM follow-up) Make 'Desks' feature optional
Martin Renvoize [Mon, 18 May 2020 10:40:14 +0000]
Bug 13881: (RM follow-up) Make 'Desks' feature optional

This patch adds a new 'UseIssueDesks' preference which defaults to
"Don't use" to enabled/disable the 'Desks' functionality added with this
bug.

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

3 years agoBug 25482: Explicitly set macros as not shard during tests
Nick Clemens [Thu, 14 May 2020 10:42:06 +0000]
Bug 25482: Explicitly set macros as not shard during tests

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

3 years agoBug 25482: Fix tests
Tomas Cohen Arazi [Wed, 13 May 2020 22:34:30 +0000]
Bug 25482: 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>