]> git.koha-community.org Git - koha.git/log
koha.git
6 years agoBug 20122: Explicitly set path to fix emptying cart functionality
Mark Tompsett [Fri, 6 Apr 2018 14:59:28 +0000 (14:59 +0000)]
Bug 20122: Explicitly set path to fix emptying cart functionality

This is caused by bib_list not being deleted.
The path was not explicitly set.
This patch adds path=/ explicitly to ensure it
does get deleted.

TEST PLAN
---------
1) search for 'the' in OPAC
2) add several items to cart.
3) look at your cart.
4) empty and close the cart, select all->remove
   -- either way window closes and it looks empty.
5) refresh the page
   -- cart comes back.
   -- in chromium inspecting the page, specifically
      the "Application" area, bib_list is shown as
      a cookie still.
6) apply patch
7) restart_all and empty cache forcing JS reload
8) repeat steps 1-5
   -- this time cart stays empty.
   -- and the bib_list cookie is gone

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com> using firefox 59.0.2
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 16c6ff1e3cb30f3aa4d2e23301b942eaf5a63d4c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19267: Rancor - Warn before leaving page if record modified
Jesse Weaver [Mon, 18 Jul 2016 22:31:20 +0000 (16:31 -0600)]
Bug 19267: Rancor - Warn before leaving page if record modified

To test:
1 - Open the advanced editor
2 - Make some changes to a record
3 - Click on 'Patrons' or leave the page in some way
4 - Note there is no warning and changes are not saved
5 - Apply patch
6 - Open the advanced editor
7 - Make some changes
8 - Leave the page
9 - Note you get a warning of unsaved changes and can stay on the page

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5a6e7a6ffbab8e42e706486b9e75abe782a696b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19578: Remove MARC punctuation in notices (TT syntax)
Jonathan Druart [Mon, 6 Nov 2017 18:35:50 +0000 (15:35 -0300)]
Bug 19578: Remove MARC punctuation in notices (TT syntax)

Jenkins fails (run 287) on a test in t/db_dependent/Letters/TemplateToolkit.t:

With the historical syntax:
        # Your request for an article from tQYRS (c3Av58O0P5xkkIGu) has been canceled for the following reason:

With the TT syntax:
        # Your request for an article from tQYRS_ (c3Av58O0P5xkkIGu) has been canceled for the following reason:

The last character of the biblio's title has been removed because it's a punctuation character.
It comes from: C4::Letters::_parseletter
 893         $val =~ s/\p{P}$// if $val && $table=~/biblio/;

The same replacement is done for patron's attributes too.

Test plan:
- Confirm that the new tests pass. That should be enough to confirm this change make sense.

Test plan (manual):
- Create a biblio with a title ending with a punctuation (like "with_punctuation_"), or any other fields of biblio/biblioitem
- Generate a notice which will display this field (CHECKIN for instance)

Use the historical syntax and the TT syntax, both should display the title without the punctuation character at the end

CHECKIN historical:
The following items have been checked in:
----
<<biblio.title>>
----

CHECKIN TT syntax:
The following items have been checked in:
----
[% biblio.title %]
----

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f5be2d525f7540a4833c14759bdc0de2ba5657db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20282: Match course reserve on holdingbranch
Nick Clemens [Fri, 23 Feb 2018 10:58:27 +0000 (10:58 +0000)]
Bug 20282: Match course reserve on holdingbranch

To test:
1 - Add a course (Course Reserves)
2 - Add an item to the course
3 - Ensure to change the holding branch for the course reserve
4 - Modify the course item
5 - Note the dropdwn for holding branch is unset
6 - Apply patch
7 - Modify the course item
8 - Dropdown should be correctly populated

Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 03b31bfc625484c9219935a50a5d0d3cf017b5e6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20369: Analytics search is broken with QueryAutoTruncate set to 'only if * is...
Kyle M Hall [Mon, 12 Mar 2018 11:15:12 +0000 (07:15 -0400)]
Bug 20369: Analytics search is broken with QueryAutoTruncate set to 'only if * is added'

Test Plan:
1) Enable EasyAnalytics
2) Disable QueryAutoTruncate
3) Create an analytic record, add some host items to it
4) Browser to the analytics tab for the record
5) Click the link in the 'used in' column of the table
6) No search results
7) Apply this patch
8) Reload the page, now you get the analytic record!

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 14b70dc91006c16beb48d40fe23fad27ed206f02)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20462: Ensure batch item deletion will not delete the same item twice
Jonathan Druart [Mon, 26 Mar 2018 15:22:15 +0000 (12:22 -0300)]
Bug 20462: Ensure batch item deletion will not delete the same item twice

This has been done on bug 9509 when barcodes are scaned, but not when using a text file.

Test plan (stolen from Barton on the bug report):
1) Create a text file containing duplicate barcodes

Here's a quick way to do that, substitute INSTANCE for the instance name of your test server:

sudo koha-mysql INSTANCE <<< "select barcode from items where barcode is not null limit 3" | sed '1d;p' > /tmp/dup_barcodes.txt

2) Go to Home › Tools › Batch item deletion
3) Click 'Choose File', select the file you created in step 1.
4) Click 'Continue'
5) Note that duplicate items appear in the list of items to batch delete
6) Check 'Delete records if no items remain'
7) This will trigger a software error

Note that entering the barcodes via the 'scan items one by one' text box removes duplicates in the list, so this only causes problems when uploading a file.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1f4baf31bb19c615f43771efa3fac7e2333d3622)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20318: Add class 'required' to the label
Jonathan Druart [Mon, 2 Apr 2018 17:30:23 +0000 (14:30 -0300)]
Bug 20318: Add class 'required' to the label

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1982b1ad11703c815ceda2d9de79af62cda5263e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20318: Merge invoices can lead to an merged invoice without Invoice number
Christophe Croullebois [Wed, 14 Mar 2018 14:28:28 +0000 (14:28 +0000)]
Bug 20318: Merge invoices can lead to an merged invoice without Invoice number

When you want to merge invoices you have a page with a non editable
field 'Invoice number:' it shows the content of the first invoice to be
merged.
But if you validate by clicking the 'merge' button you arrive on the
next page which says that 'Invoice has been modified' and if you quit
this page without saving you have now a merged invoice without Invoice
number.
This tiny patch just prevents this issue to occur.

Test plan :

1° go to the acqui/invoices.pl page and search invoices to merge.
You must have at least 2 invoices on the same vendor
2° check boxes to select invoices to merge and click on 'merge selected
invoices' button
3° next page you see the non editable field 'Invoice number:'
4° click on the 'merge' button
5° next page you see 'Invoice has been modified'
6° leave this page i.e click on the left link 'Invoices'
7° search invoices you'll see the merged invoice without invoice number.

Apply the patch, replay the steps 1 to 3
4° on this page you can enter your invoice number and click on the
'merge' button.
If you leave this field empty and click merge, a message informs you
that it is required and you can not merge.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Conflicts:
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt

(cherry picked from commit 3838dd83753a94adb32ab1b6facee7e700e20066)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 18474: (QA follow-up) Remove useless else in template
Kyle M Hall [Fri, 30 Mar 2018 11:08:30 +0000 (07:08 -0400)]
Bug 18474: (QA follow-up) Remove useless else in template

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a444807b57bfc0317b23d1a62e08bcbb15d39bc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 18474: Restore multiple holds when patron is searched for
Jonathan Druart [Thu, 21 Dec 2017 18:59:24 +0000 (15:59 -0300)]
Bug 18474: Restore multiple holds when patron is searched for

We lost the ability to place multiple holds when we are searching for
patrons. The multi_holds parameter is lost and not handled correctly in
the template.

Test plan:
- Make sure you can place multiple holds for a patron you will search for
- Same for simple hold

TODO the multiple holds view should not be displayed if only 1 record
has been selected from the search result.

Signed-off-by: claude brayer <claude.brayer@cea.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dc008b90cd50b80c78520de6379c61e534efce75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20503: Prevent Borrower_PrevCheckout.t to fail randomly
Jonathan Druart [Fri, 30 Mar 2018 16:14:46 +0000 (13:14 -0300)]
Bug 20503: Prevent Borrower_PrevCheckout.t to fail randomly

category_type must be != "X"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Conflicts:
t/db_dependent/Patron/Borrower_PrevCheckout.t

(cherry picked from commit 082e4e257123d2f192008e531657ebb63adaef21)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20490: Correct bug number typo in comment in Circulation.t
Lari Taskula [Wed, 28 Mar 2018 21:19:52 +0000 (21:19 +0000)]
Bug 20490: Correct bug number typo in comment in Circulation.t

NOTE: Confirmed that the typo of 17641 was part of bug 17941.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6852c592f7f81b3d76b1ccfd38264bcd9cc75a61)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19673: Allow to set patron attributes to 0 with batch patron modification
Jonathan Druart [Thu, 21 Dec 2017 00:35:47 +0000 (21:35 -0300)]
Bug 19673: Allow to set patron attributes to 0 with batch patron modification

This patch will have to be tested deeply to make sure it will not
introduce regression!

The idea is to display an empty option in the patron attributes select
and ignore it. That way we can deal with false values 0 and "" which
were skipped before.

Test plan:
Add several patron attributes
Use the batch patron modification tool to add/update/remove them
Play with empty "" and 0 values, as well as other values
Modify several attributes in a row

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Conflicts:
koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt

(cherry picked from commit 16dfb0309b778725fdb76cadee9943a0344285ed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20455: Fix sort patrons by date expired
Jonathan Druart [Mon, 26 Mar 2018 16:13:58 +0000 (13:13 -0300)]
Bug 20455: Fix sort patrons by date expired

We may need to apply this change for all other occurrences in our
codebase.

Test plan:
- Make sure sample patron data is loaded and you have a patron without a
date expired defined
- Make an empty search for all patrons or another search that gives you
a good amount of results
- Try to sort on the date expired column

=> Without this patch you get
Odd number of elements in anonymous hash
at /home/vagrant/kohaclone/C4/Utils/DataTables/Members.pm line 189.
output_pref is called with 'dateonly' (ref SCALAR), not a DateTime
object

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 09eaaaebcd8e02dbb3d026304d6227bbdc146cca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoRevert "Bug 20234: Make maintenance scripts use koha-zebra instead of koha-*-zebra"
Fridolin Somers [Wed, 16 May 2018 06:22:53 +0000 (08:22 +0200)]
Revert "Bug 20234: Make maintenance scripts use koha-zebra instead of koha-*-zebra"

This reverts commit 443fb91be5805863633439afb4b2eefb7a164112.

6 years agoRevert "Bug 20234: Update service description in koha-common.init"
Fridolin Somers [Wed, 16 May 2018 06:22:45 +0000 (08:22 +0200)]
Revert "Bug 20234: Update service description in koha-common.init"

This reverts commit 48141d57f1d5e124e60b85221926d55fae470a94.

6 years agoBug 20227: Check for categorycode in default_borrower_circ_rules
Marcel de Rooy [Fri, 16 Feb 2018 11:01:36 +0000 (12:01 +0100)]
Bug 20227: Check for categorycode in default_borrower_circ_rules

Fixes silent crash when adding the same category twice.
DBD::mysql::st execute failed: Duplicate entry 'ST' for key 'PRIMARY' [for Statement "
                INSERT INTO default_borrower_circ_rules
                    (categorycode, maxissueqty, maxonsiteissueqty, max_holds)
                    VALUES (?, ?, ?, ?)
            " with ParamValues: 0="ST", 1=undef, 2=undef, 3="3"] at /usr/share/koha/devclone/admin/smart-rules.pl line 309.

(Line number affected by bug 15524.)

Very trivial solution.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 490f473a7815854893a0b2a38366c95af345a543)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19671: Map itemtypes to hash for correct display in issues_stats.pl
Jonathan Druart [Wed, 20 Dec 2017 16:17:50 +0000 (13:17 -0300)]
Bug 19671: Map itemtypes to hash for correct display in issues_stats.pl

To test:
1 - Run the circulation wizard with itemtypes as columns, shelving
locations as rows - display on screen
2 - Note all itemtype values are blank
3 - Switch rows/columns - same issue
4 - Apply patch
5 - Re-run reports
6 - Itemtypes should display correctly

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b3bab56c3168217878e0db921cebef0a97c01303)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoUpdate release notes for 17.05.11 release v17.05.11
Fridolin Somers [Wed, 25 Apr 2018 06:31:25 +0000 (08:31 +0200)]
Update release notes for 17.05.11 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoMerge remote-tracking branch 'translate/17.05.11-translate-20180425' into 17.05.x
Fridolin Somers [Wed, 25 Apr 2018 06:25:46 +0000 (08:25 +0200)]
Merge remote-tracking branch 'translate/17.05.11-translate-20180425' into 17.05.x

6 years agoIncrement version for 17.05.11 release
Fridolin Somers [Wed, 25 Apr 2018 06:22:56 +0000 (08:22 +0200)]
Increment version for 17.05.11 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoTranslation updates for Koha 17.05.11
Koha translators [Wed, 25 Apr 2018 06:20:54 +0000 (03:20 -0300)]
Translation updates for Koha 17.05.11

6 years agoBug 19739: Add default ES configuration to koha-conf.xml
Fridolin Somers [Mon, 4 Dec 2017 09:04:48 +0000 (10:04 +0100)]
Bug 19739: Add default ES configuration to koha-conf.xml

Bug 18571 added default ES configuration for packaging config.

This patch adds it to dev install in koha-conf.xml.
Database name is used in index_name to allow multiple installs.

Test plan :
- Run dev install
- Install ElasticSearch server and Koha deps
- Enable ElasticSearch in Koha
- Check indexing and searching works directly

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 219e427f29554c323b2016dd67898c21f10d8fcb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20461: Serials: fix ignored params in subscription creation form
Victor Grousset [Thu, 22 Mar 2018 14:44:00 +0000 (15:44 +0100)]
Bug 20461: Serials: fix ignored params in subscription creation form

In subscription-add.pl, the two params aren't passed to
NewSubscription() but they are to ModSubscription()

== Test plan ==
1. Enable syspref "makePreviousSerialAvailable"
2. Create a minimal subscription with a value in the "Item type" and
     "item type for older issues" fields.
3. Edit the subscription
4. You should see that the two fields are empty. This is the bug.
5. Apply this patch
6. Do step 2 and 3
7. You should see that the two fields have the right value
8. Express the joy of a successful and easy sign off.
   (this is important, otherwise the sign off spell won't work!)

Signed-off-by: delaye <stephane.delaye@biblibre.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b02528d8bb7e8e86d0157166e0d2868e64d19d51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 18593: Move suggestions when bibliographic records are merged
Jonathan Druart [Tue, 2 Jan 2018 18:42:12 +0000 (15:42 -0300)]
Bug 18593: Move suggestions when bibliographic records are merged

When bibliographic records are merged, the suggestions.biblionumber
field should be replaced with the new record.
Ideally we should have kept an history of the merges, to know what was
the original record. Now we cannot fix the broken links.

Test plan:
1) Create a suggestion in OPAC
2) Accept the suggestion in staff
3) Add order from this suggestion
4) Go to cataloguing search and search for the record and another
5) Merge the suggestion record with the catalog record - catalog record wins (should be the more common case when a patron suggests something that already exists)
6) Verify that after merging, the new title displays in the acquisition record
7) Verify that the suggestion info no longer displays in basket

From Katrin's test plan:
8) Verify that the new title doesn't display in suggestions. The old title will still show as suggested (not updated)
=> This is the title from suggestions.title, I think it makes sense to show this one.
Maybe we should open a new bug report to improve the display of the suggestion, and link to the bibliographic record

Signed-off-by: Lucie Gay <lucie.gay@ens-paris-saclay.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3f118604af4ff965a1a320656e40762f9958e791)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 11936: (QA follow-up) Consistent log message for item insert
Julian Maurice [Mon, 12 Mar 2018 10:51:59 +0000 (11:51 +0100)]
Bug 11936: (QA follow-up) Consistent log message for item insert

Fix the same error in another place

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 174dc4cb2e1de70b310aea2b812ce959ad5ab174)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 11936: Consistent log message for item insert
Magnus Enger [Thu, 22 Feb 2018 09:37:08 +0000 (10:37 +0100)]
Bug 11936: Consistent log message for item insert

If you use bulkmarcimport.pl to import records with items it looks
like the successfull insert of the record is reported multiple time,
but the second and subsequent "ok" is really related to importing
the item(s).

This patch changes the log message on successfully inserting an item
to match the log message given when inserting an item fails.

To test, the easy way:
- Look at lines 530 and 536 of bulkmarcimport.pl, and note that the
  "op" in those two lines are different
- Apply the patch
- Look at lines 530 and 536 again, and note that the "op" is now
  identical, and that this makes sense, since they are both related
  to the same operation, specifically inserting an item

To test, the hard way
- Have some records with items
- Import the records with bulkmarcimport.pl, and make sure to specify
  the -l option, to create a log of the actions taken
- Look at the log and verify it looks something like this:
  id;operation;status
  1;insert;ok
  1;insert;ok
  2;insert;ok
  2;insert;ok
- Apply this patch and import some more records with items. The log
  should now be similar to this:
  id;operation;status
  1;insert;ok
  1;insertitem;ok
  2;insert;ok
  2;insertitem;ok

Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit aa7954907b94487f17d13573c19d9fbd7c6677b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20383: Hide link to plugin management if plugins are not enabled
Owen Leonard [Tue, 13 Mar 2018 10:15:31 +0000 (10:15 +0000)]
Bug 20383: Hide link to plugin management if plugins are not enabled

This patch adds a check in admin-home.pl to see whether plugins are
enabled. If plugins are disabled, the link to plugins management is
hidden even if the user has plugin management permission.

To test, view the administration home page with plugins enabled and
disabled via the enable_plugins flag in the Koha configuration file.
Also test using users with different plugins permissions:

- Plugins enabled
  - CAN_user_plugins = 1
    -> Plugins link appears
  - CAN_user_plugins = 0
    -> Plugins link hidden

- Plugins disabled
  - CAN_user_plugins = 1,
  - CAN_user_plugins = 0
    -> Plugins link hidden

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8450d2020bdfd524ebd20f0de8d278497fce0759)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20372: Correct toolbar markup on some pages
Owen Leonard [Mon, 12 Mar 2018 12:56:08 +0000 (12:56 +0000)]
Bug 20372: Correct toolbar markup on some pages

Differences in markup around some toolbars has the potential to create
CSS styling problems. This patch changes the markup to be consistent
with other instances of <div id="toolbar"></div>

To test, apply the patch and view these pages:

- Course reserves (main page)
- Course reserves -> Course detail page
- Reports -> Dictionary

On each of these pages the toolbar should look correct.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c9ee7c8d3b34da110702cfd93e16b11350d19a6d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20376: Make select/unselect all ignore disabled checkboxes on batch record deletion
Maksim Sen [Mon, 12 Mar 2018 20:15:30 +0000 (16:15 -0400)]
Bug 20376: Make select/unselect all ignore disabled checkboxes on batch record deletion

Test Plan:

0.1 - find at least one biblionumber that has at least one item checked out
0.2 - find at least one biblionumber that has zero items checked out.
1 - Go into the module "Tools > Batch record deletion"
2 - in "List of biblionumbers or authority ids (one per line)" put the values you found in step 0.1 and 0.2
3 - click continue
4 - biblionumbers with at least one item checked out should not be clickable.
5 - biblionumbers with zero items checked out should be clickable.
6 - click "Select all" and "Clear all", both buttons should change the "checked" status of the enabled AND disabled biblionumber checkboxes.
7 - apply patch
8 - click "Select all" and "Clear all", both buttons should change the "checked" status of ONLY the enabled biblionumber checkboxes.

Signed-off-by: JM Broust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Conflicts:
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 336e7faaf451ff29d43a4a557861fbc8511c8e5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19547: Deal with --create-db missing debian.cnf issue
Mark Tompsett [Tue, 31 Oct 2017 02:28:58 +0000 (02:28 +0000)]
Bug 19547: Deal with --create-db missing debian.cnf issue

Followed test plan. Patch functions as described and both commands execute.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 931db23ee369580bbaf137547accef5a8f47412e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19547: MariaDB install has no debian.cnf
Mark Tompsett [Mon, 30 Oct 2017 21:59:43 +0000 (17:59 -0400)]
Bug 19547: MariaDB install has no debian.cnf

This attempts to handle issues arising when running
koha-create on a system that never had MySQL installed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a85d33314cb48a493bbc26f5350911dc5c6b2c51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20430: (See also bug 19436) Button display depends on wrong server count
Marcel de Rooy [Fri, 16 Mar 2018 08:02:36 +0000 (09:02 +0100)]
Bug 20430: (See also bug 19436) Button display depends on wrong server count

This is a QA follow-up of bug 19436, submitted separately for ease of
backporting it. (The bug was not raised by 19436.)

Obviously, the number of authority servers not biblio servers should
be the key factor for showing or hiding the button for new authority
records via Z39.50/SRU.

Trivial fix.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7852d967d1982de2c19571b8733ea8273458882b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20341: Show authorized value description for withdrawn like damaged and lost
Fridolin Somers [Tue, 6 Mar 2018 11:26:19 +0000 (12:26 +0100)]
Bug 20341: Show authorized value description for withdrawn like damaged and lost

Actually catalog detail page shows for damaged and lost items the authorized value description if exists.
We must do the same for withdrawn information.

Test plan :
1) Set for items a subfield linked to items.withdrawn and using the authorized value category 'WITHDRAWN'
2) Edit the authorized value category to add value '2' and description 'Eaten by dog'
3) Edit an item to set this withdrawn value
4) Go to staff interface and look at items in record detail page /cgi-bin/koh/catalogue/detail.pl :
=> Without patch you see 'Withdrawn' and with patch you see 'Eaten by dog'
5) Go to OPAc and look at items in record detail page /cgi-bin/koha/opac-detail.pl :
=> Without patch you see 'Withdrawn' and with patch you see 'Eaten by dog'

Signed-off-by: delaye <stephane.delaye@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 830ce35795f7bbd68d6b68c4795cb36f27fe2b6d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 12812: (Follow-up) Fix use of C4::Circulation
Josef Moravec [Fri, 9 Mar 2018 06:58:34 +0000 (06:58 +0000)]
Bug 12812: (Follow-up) Fix use of C4::Circulation

Fixes this error:
Undefined subroutine &main::MarkIssueReturned called at
misc/cronjobs/longoverdue.pl line 316.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4aaf30dfd87289a63e27073be90062db04a32dc1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 12812: Longoverdue.pl --mark-returned doesn't return items
Kyle M Hall [Thu, 8 Feb 2018 11:39:39 +0000 (06:39 -0500)]
Bug 12812: Longoverdue.pl --mark-returned doesn't return items

The longoverdue.pl option --mark-returned doesn't work unless the
--charge option is used as well.

Test Plan:
1) Run long overdue with --mark-returned and not --charge,
   note your items are marked lost but not returned
2) Apply this patch
3) Repeat step 1, the items should now get returned!

Tested with (for example):
misc/cronjobs/longoverdue.pl --lost 10=1 --mark-returned --verbose
--confirm

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 93c5c8e4c85ed3330184de2c6ea06ab73803656b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 17717: (QA follow-up) Fix typo chdir
Marcel de Rooy [Mon, 5 Mar 2018 10:30:15 +0000 (11:30 +0100)]
Bug 17717: (QA follow-up) Fix typo chdir

This test does obviously not achieve the desired result:
    [ "chdir" != "no" ]
Trivial fix.
Adding the same quotes around starting_dir (just as for Bug 19546).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7c55ea5917998bc210d3ee632f0a8ea6beefff5f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 17717: Make cronjobs using koha-foreach use --chdir
Tomas Cohen Arazi [Fri, 2 Mar 2018 14:51:20 +0000 (11:51 -0300)]
Bug 17717: Make cronjobs using koha-foreach use --chdir

In order to patch production sites we need to adjust the shipped
cronjobs so they are called with the --chdir option switch.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 37750b2f20f63bec2de330533bb4d9a82171e9c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 17717: Add a --chdir option switch for koha-foreach
Tomas Cohen Arazi [Fri, 2 Mar 2018 14:17:40 +0000 (11:17 -0300)]
Bug 17717: Add a --chdir option switch for koha-foreach

Until Perl 5.26, the current directory is added to @INC when running a
Perl script [1]. Having the current directory in @INC means it can be
tried to be traversed when performing a lib lookup. Since version 5.18,
Perl dies when it finds an unreadable directory (permissions) in @INC
that needs to be traversed. This behaviour won't change because Perl
devs consider it an enhancement to security. [2]

Because of this, we need to make sure our scripts are ran **from** a
directory in which they have read permissions.

Ths patch adds a --chdir option switch to the **koha-foreach** wrapper
script, that makes the inner shells/scripts to be ran within the Koha
instance's user home directory.

The change is trivial and should be QAed easily. I tested this on a prod
server:

- Create a /tmp/test.pl file containing:

use Modern::Perl;

use Cwd;
my $dir = getcwd;

warn $dir;

1;

A) then create a cronjob entry to run it using koha-foreach:
(in /etc/cron.d/test):
1/* * * * * root koha-foreach perl /tmp/test.pl
- Once I noticed the cronjob ran, I used mutt to read the emails in the
root user.
=> FAIL:
...
Subject: Cron <root@koha> koha-foreach --enabled perl /tmp/test.pl

"/root"
"/root"
"/root"
"/root"
"/root"
...

B) I then used the patched koha-foreach with different results:
=> SUCCESS:
...
Subject: Cron <root@koha> /root/koha-foreach --chdir --enabled perl /tmp/test.pl

"/var/lib/koha/acaderc"
"/var/lib/koha/agro"
"/var/lib/koha/anc"
"/var/lib/koha/arico"
"/var/lib/koha/artes"
...

So this patch's approach works. But...

C) master's koha-foreach seems to work just the same... I think it is
because of my previous attempt to fix this by using sudo in koha-shell.
So I think environmental conditions affect the behaviour (which shell is
configured for cron, sudo configuration, etc).

====

In conclusion, I think we should go ahead with this patch as it will solve
peoples issues, and it is a right solution (option #5 on the list) to
this Perl behaviour change. It doesn't cover other commands, but
followup patches could do.

I avoided /tmp as it is writable by any user... so it is an easy path
for both exploiting by replacing some lib, and also because the
existence of an unreadable dir that the interpreter could try to
traverse (unreadable /tmp/Authen or /tmp/Koha will trigger the same
error, and I assume people know what they are putting on the instance's
dir, at least it will be easier to track).

A followup patch takes care of making the cronjobs use --chdir when
calling koha-foreach

[1] https://lists.debian.org/debian-devel-announce/2016/08/msg00013.html
[2] https://rt.perl.org/Public/Bug/Display.html?id=123795

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3db7e1a63a517ad03a5426504ef4010beae0c8bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 18709: Make koha-foreach use koha-shell internally
Tomas Cohen Arazi [Tue, 27 Jun 2017 14:55:45 +0000 (11:55 -0300)]
Bug 18709: Make koha-foreach use koha-shell internally

This patch simplifies the koha-foreach script, making it use koha-shell
to gain instance privileges and have all environment variables set.

To test:
- Apply the patch
- Have one or more instances created (kohadev already exists in kohadevbox, add
  another onewith $ sudo koha-create --create-db test)
- Run:
  $ sudo kohaclone/debian/scripts/koha-foreach echo "This is instance __instancename__"
=> SUCCESS: The script runs gracefuly, and outputs something like:
This is instance kohadev
This is instance test
  Note: this means the command was executed for each instance and the current behaviour
        of replacing the placeholder __instancename__ for the actual instance name still
        works as expected.
- You can try the different filter switches, but the logic has not been touched. only the
  command call.
- Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 75994dc94a2f5d1a500a7789ed113575c49f8b51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20286: Fix filter for BakerTaylor* prefs
Jonathan Druart [Tue, 27 Feb 2018 18:30:18 +0000 (15:30 -0300)]
Bug 20286: Fix filter for BakerTaylor* prefs

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a1940ace4187e5f94bac82830a92481e85e9c6d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20286: Correctly escape URI characters in OPAC RSS template
Jonathan Druart [Mon, 26 Feb 2018 13:48:18 +0000 (10:48 -0300)]
Bug 20286: Correctly escape URI characters in OPAC RSS template

Bug 19568 use the TT filter url whereas it must have escaped the URI
characters with the uri filter.

Test plan:
Subscribe to an OPAC search
=> Without this patch you will get an empty page
=> With this patch applied you will see result list.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5de7dc040dbb1e6ebae49a64aac8f4a7c19d4091)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20311: Prevent get_age tests to fail on Feb 28th
Jonathan Druart [Wed, 28 Feb 2018 16:54:32 +0000 (13:54 -0300)]
Bug 20311: Prevent get_age tests to fail on Feb 28th

Today Feb 28th 2018:
If we subtract 18y to this DateTime object 29/02/2000 and so the patron is not major yet

use Koha::DateUtils qw( dt_from_string );
say dt_from_string('28/02/2018')->add(years => -18);
say dt_from_string('28/02/2018')->add(years => -18, end_of_month => 'limit');

will display:
2000-02-29T00:00:00
2000-02-28T00:00:00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 72de4ddaeed5e12a86414e6b965cb6f5a4a76ce1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20234: Update service description in koha-common.init
Tomas Cohen Arazi [Sat, 17 Feb 2018 14:50:16 +0000 (11:50 -0300)]
Bug 20234: Update service description in koha-common.init

The service description is very old and outdated. This patch fixes this.

Sponsored-by: Orex Digital
Signed-off-by: Hugo Agud hagud@orex.es
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 362c0e0cd1035222ee43febae88cab73c410f41e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20234: Make maintenance scripts use koha-zebra instead of koha-*-zebra
Tomas Cohen Arazi [Sat, 17 Feb 2018 14:34:58 +0000 (11:34 -0300)]
Bug 20234: Make maintenance scripts use koha-zebra instead of koha-*-zebra

This patch makes all maintenance scripts use **koha-zebra** instead of
the old **koha-*-zebra** scripts.

To test:
- Run:
  $ perl misc4dev/cp_debian_files.pl
  $ sudo service koha-common stop
=> SUCCESS: No errors and the Zebra-related sevices are stopped
  $ sudo service koha-common start
=> SUCCESS: No errors and the Zebra-related services are started
  $ sudo service koha-common restart
=> SUCCESS: No erros and Zebra-related services are running
  $ sudo koha-create --create-db test
=> SUCCESS: Instance created and zebra running for it
  $ sudo koha-disable test
=> SUCCESS: No errors and Zebra is stopped for instance test
  $ sudo koha-zebra --start test
  $ sudo koha-remove test
=> SUCCESS: No errors, instance removed, no Zebra running for test
- Sign off :-D

Sponsored-by: Orex Digital
Signed-off-by: Hugo Agud hagud@orex.es
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 900f3437622c3d3df4fc8cf782161c9b9eea844f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20229: Explicitly list the SQL modes we support
Jonathan Druart [Fri, 16 Feb 2018 15:23:26 +0000 (12:23 -0300)]
Bug 20229: Explicitly list the SQL modes we support

In our installation procedure we ask the administrator to edit the
MySQL|MariaDB configuration file to specify the SQL modes we support
(see bug 17258 comment 6 and 7 for more information).

We are on the way to catch and fix all these issues and support these
stricter modes (as they highlight problem in our codebase/DB structure)
but in the meanwhile it may be good to remove this step and revert the
changes when we are ready.

TODO:
- Remove that for dev installations (to let developers catch these bugs)
- Edit the wiki page to remove this step

Test plan:
0. Do not apply this patch
1. Edit your MySQL|MariaDB config and add:
sql-mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
to the [mysqld] section (or edit it)
2. Restart your DBMS
3. Try to make the app explode (watch the logs)
(tips: you should get "'koha_kohadev.me.id' isn't in GROUP BY" when
editing an order)
4. Apply the patch, restart_all, restart your DBMS
5. Try to recreate the failure
=> You should no longer see the error in the logs

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4dfdf061badfa40954022653326c3166448ae5bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoMerge remote-tracking branch 'translate/17.05.10-translate-20180327' into 17.05.x v17.05.10
Fridolin Somers [Tue, 27 Mar 2018 12:10:41 +0000 (14:10 +0200)]
Merge remote-tracking branch 'translate/17.05.10-translate-20180327' into 17.05.x

6 years agoUpdate release notes for 17.05.10 release
Fridolin Somers [Tue, 27 Mar 2018 12:09:56 +0000 (14:09 +0200)]
Update release notes for 17.05.10 release

6 years agoIncrement version for 17.05.10 release
Fridolin Somers [Tue, 27 Mar 2018 12:04:10 +0000 (14:04 +0200)]
Increment version for 17.05.10 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoTranslation updates for Koha 17.05.10
Koha translators [Tue, 27 Mar 2018 12:07:33 +0000 (09:07 -0300)]
Translation updates for Koha 17.05.10

6 years agoBug 20083: Follow up - use same logic in opac-showmarc
Mark Tompsett [Tue, 30 Jan 2018 22:35:39 +0000 (22:35 +0000)]
Bug 20083: Follow up - use same logic in opac-showmarc

It was correctly pointed out that opac-showmarc would leak
the same way as catalogue/showmarc.pl, and so this patch
moves the authentication step up to the top where it
should be so as to prevent inappropriate data leaks.

TEST PLAN
---------
1) Set your OpacPublic system preference to Disabled
2) Open your OPAC and login
3) Find a biblio with items
4) Go to the opac details, particularly MARC view.
5) Copy the "view plain" shortcut link.
6) log out.
7) Paste the link into the address bar.
   -- the information will leak!
8) apply the patch
9) restart_all
10) Refresh the OPAC link
    -- log in screen will appear.
11) run koha qa test tools

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e40d0b81bfc059ece2b99475c7bf45fecea0eeb4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20083 - Information disclosure when (mis)using the MARC Preview feature
Andreas Roussos [Fri, 26 Jan 2018 01:12:47 +0000 (14:12 +1300)]
Bug 20083 - Information disclosure when (mis)using the MARC Preview feature

The MARC Preview feature in the Staff client (catalogue/showmarc.pl) does not
check whether a user is logged in or not. As a consequence, it can be used to
obtain information that would normally be available to logged-in users only.
For example, you can view any bibliographic record by passing a value to the
'id' argument, but you can also view records as they were imported (normally
done via the 'Staged MARC management' tool).

All three 17.11 installations currently listed at
https://wiki.koha-community.org/wiki/Koha_Demo_Installations
are affected by this issue, as demonstrated by the URLs below:

http://koha.adminkuhn.ch:8080/cgi-bin/koha/catalogue/showmarc.pl?importid=1&viewas=html
http://pro.demo1711-koha.test.biblibre.eu/cgi-bin/koha/catalogue/showmarc.pl?id=1000&viewas=html
https://staff-kohademo.equinoxinitiative.org/cgi-bin/koha/catalogue/showmarc.pl?id=1&viewas=html

It should be noted that this only applies to XSLT-enabled installations.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 095a92a94e87cac0c8bdf79f2413fb72efb13f9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20466: Fix fixture syntax in t/Prices.t
Jonathan Druart [Fri, 23 Mar 2018 16:13:16 +0000 (13:13 -0300)]
Bug 20466: Fix fixture syntax in t/Prices.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 00c9f9b0ea0179d8623bf350a7961a8cd75c5348)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20367: Avoid resetting userid when BorrowerUnwantedField contains userid
Lari Taskula [Fri, 9 Mar 2018 13:49:27 +0000 (15:49 +0200)]
Bug 20367: Avoid resetting userid when BorrowerUnwantedField contains userid

To test:
1. In staff client, set your username to firstname
2. Add userid to BorrowerUnwantedField system preference
3. Go to your patron modification screen (memberentry.pl) and click Save
4. Observe you get kicked out into login screen, saying:
Error: You do not have permission to access this page.
Log in as a different user

5. Apply patch and restart plack

6. Set your username back to firstname
7. Repeat step 3
8. Observe you were not kicked out and your userid stays the same

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7e44bb803fa085abdbded2311325f0c442b17708)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20167: Make changing a hold pass the itemnumber to ModReserve
Tomas Cohen Arazi [Mon, 5 Mar 2018 16:36:50 +0000 (13:36 -0300)]
Bug 20167: Make changing a hold pass the itemnumber to ModReserve

If you have an item-level hold, changing an attribute (like priority,
pickup location or suspended until date) makes the hold a biblio-level
hold, because ModReserve is not passed the current itemnumber.

This patch uses the hold's itemnumber and passes it to the ModReserve
call.

To test:
- Run the regression tests from the previous patch:
  $ kshell
 k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail
- Apply this patch
- Run the tests:
  $ kshell
 k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e854b570021784d8e6ce8bb9d90e0b02d6f8c9a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20167: Regression test
Tomas Cohen Arazi [Mon, 5 Mar 2018 16:35:33 +0000 (13:35 -0300)]
Bug 20167: Regression test

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Conflicts:
t/db_dependent/api/v1/holds.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 705deb2aa4bdadbd583bcf322cf0611303725b05)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20218: Fix matching of uri in tracklinks
Nick Clemens [Fri, 16 Feb 2018 12:31:39 +0000 (12:31 +0000)]
Bug 20218: Fix matching of uri in tracklinks

The current code matches using a regex, this breaks when the url
contains special characters. We swtich it to equality check

To test:
1 - Enable TrackClicks (either track or anonymous)
2 - Find the URL of a biblio in the OPAC
3 - Paste this into the 856$u of another record
    (or use any url containing a '?' or other characters)
4 - View the record in the opac
5 - Click the URL
6 - 404 Error!
7 - Apply patch
8 - Try again
9 - Success!

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 306b461a6a8e57814367de524dfa3bd22c2f3eca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19979: ->count can be called directly on Koha::Objects
Jonathan Druart [Tue, 27 Feb 2018 14:40:13 +0000 (11:40 -0300)]
Bug 19979: ->count can be called directly on Koha::Objects

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f20b91d61b0cfbce6d036b94c08f169bde21bdb2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19979: Fix get_facets_info test in Search.t
Marcel de Rooy [Tue, 16 Jan 2018 13:28:36 +0000 (14:28 +0100)]
Bug 19979: Fix get_facets_info test in Search.t

The test should remove the holdingbranch key in the expected results when
there is only one branch.
See the logic in C4::Koha.

Test plan:
[1] Run Search.t on a database with multiple branches.
[2] Run Search.t on a database with one branch. Without this patch the test
    would fail: Failed test '_get_facets_info returns the correct data'.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 254684c3ed70f1f07023a9a1ebd8d078dcb633dc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20250: (bug 19529 follow-up) Prevent NoIssuesChargeGuarantees.t to fail randomly
Jonathan Druart [Mon, 19 Feb 2018 20:40:06 +0000 (17:40 -0300)]
Bug 20250: (bug 19529 follow-up) Prevent NoIssuesChargeGuarantees.t to fail randomly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Conflicts:
t/db_dependent/Circulation/NoIssuesChargeGuarantees.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b671510474fc00e82d5dbec0ff59c92bea7bcb31)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19529: Prevent NoIssuesChargeGuarantees.t to fail randomly
Jonathan Druart [Wed, 25 Oct 2017 16:16:53 +0000 (13:16 -0300)]
Bug 19529: Prevent NoIssuesChargeGuarantees.t to fail randomly

Use a categorycode != "X"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 667c07e0480825da10fa9dba4ae9e9625be51d99)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20148: Prevent adding same user multiple times to an order
Jonathan Druart [Sun, 18 Feb 2018 18:10:30 +0000 (15:10 -0300)]
Bug 20148: Prevent adding same user multiple times to an order

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 802c81ce1afadefd01f9959c3823b2cd7dc3ba3e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20148: Prevent adding same user multiple times to acq basket
Pasi Kallinen [Wed, 7 Feb 2018 07:45:20 +0000 (09:45 +0200)]
Bug 20148: Prevent adding same user multiple times to acq basket

When adding a user to manage acquisitions basket, it is possible
to add the same user multiple times. Prevent that.

Test plan:

1) Go to Home -> Acquisitions -> [bookseller] -> [basket]
2) On the "Add user" in the Managed by-part, and try adding
   the same user multiple times.
3) Apply patch
4) Repeat 1 and 2. You should now get an error message saying
   the user is already in the list.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Conflicts:
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 757c9b4231399ca6082a00b66beca8e59c0b462b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19452: [17.05.x] Remove the truncate option
Marcel de Rooy [Thu, 12 Oct 2017 11:13:41 +0000 (13:13 +0200)]
Bug 19452: [17.05.x] Remove the truncate option

The truncate option is not really useful. Its result is probably not what
most users of this script expect or need.
It truncates both tables borrower_message_preferences and
borrower_message_transport_preferences. This (unfortunately) includes
deleting messaging preferences for patron categories. After that, adding
preferences again will not add categories again, but only borrower
preferences which are all disabled.

Furthermore, we do not need to disable the foreign key check. Neither
do we actually need to truncate, deleting records seems sufficient.
Also deleting transport preferences is not needed, since it will be
done by a cascade from messaging preferences. Note that the subsequent
call of SetMessagingPreferencesFromDefaults will already delete the
records.

This makes it possible to remove the truncate option altogether.

Test plan:
[1] Select a patron category (say ST) and change days_in_advance to x.
[2] Select a ST patron and set days_advance to y in his msg prefs.
[3] Run borrowers-force-messaging-defaults.pl -doit
[4] Verify that the patron has been reset to the default prefs (incl.
    value x in days_in_advance).
[5] Verify that the patron category prefs are still intact.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20145: Do not insert 0000-00-00 in patron tests (and more)
Jonathan Druart [Wed, 14 Feb 2018 18:15:39 +0000 (15:15 -0300)]
Bug 20145: Do not insert 0000-00-00 in patron tests (and more)

We should call Koha::Patron->is_expired in CanBookBeIssued instead of
doing the same calculation.

Tests have been adapted to pass with new SQL modes.

We should not need to update the values in DB, we already have
  Bug 14717: Prevent 0000-00-00 dates in patron data (3.21.00.023)

Test plan:
  prove t/db_dependent/Circulation/dateexpiry.t
  prove t/db_dependent/Koha/Patrons.t
must return green

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Conflicts:
C4/Circulation.pm
t/db_dependent/Koha/Patrons.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9f075a4fdb2649493820ffed20a352add02c05ea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20098: Inventory tool: CVS export: fix itemlost column
Victor Grousset [Mon, 29 Jan 2018 15:09:24 +0000 (16:09 +0100)]
Bug 20098: Inventory tool: CVS export: fix itemlost column

It was mapped with "lost" instead of "itemlost".

== Test plan ==
1. Have a lost item
2. Go to staff:/cgi-bin/koha/tools/inventory.pl
3. Tick "Optional filters" → "items.itemlost" →
      "name of Authorized values for the lost state"
4. Tick "Export to CSV file"
5. Submit
6. Open the CSV
7. Check that the lost item is in the list
8. You should observe that the "Lost status" column is empty for all items
     This is the problem
9. Apply this patch
10. Click submit to re-export the CSV
11. Open the CSV
12. Check that the lost item is in the list
13. You should observe that the "Lost status" column now filled with the
      expected values.
14. Smile because it works! :D

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Maksim Sen <maksim@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 756c95477d2a16843abbd3858d776e37e28b4e90)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19530: Don't update the date arrived for closed transfers
Kyle M Hall [Tue, 30 Jan 2018 16:22:52 +0000 (11:22 -0500)]
Bug 19530: Don't update the date arrived for closed transfers

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9a6c8f6c1ebca35161c58b2a57015d1baa60d730)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19530: Added commentary for last test when prove -v
Mark Tompsett [Thu, 26 Oct 2017 01:28:10 +0000 (21:28 -0400)]
Bug 19530: Added commentary for last test when prove -v

Before patch, prove -v had no comment for the last test.
After patch, it says something in line with second last test.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3fefcead1596467155ec28a77105e4416f454d8b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19530: Prevent multiple transfers from existing for one item
Kyle M Hall [Wed, 25 Oct 2017 18:24:18 +0000 (14:24 -0400)]
Bug 19530: Prevent multiple transfers from existing for one item

We have found multiple open branch transfers for a given item. While I'm not sure how it is happening at this point, it seems that it would make sense to cancel any existing branch transfers when initiating a new one.

Test Plan:
1) prove t/db_dependent/Circulation/transfers.t

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 00fbf1878eb2a767769b1405aec4fff1b13711d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19806: Add classes to itemnotes in issues table
Nick Clemens [Thu, 14 Dec 2017 12:54:14 +0000 (12:54 +0000)]
Bug 19806: Add classes to itemnotes in issues table

To test:
1 - Checkout an item with both public and non-public notes
2 - Note the notes display and both have circ-hlt class
3 - Apply patch
4 - Ensure display has not changed
5 - Note notes now have classes 'item-note-public' and
'item-note-nonpublic'
6 - Sign off

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 03864feb387ebc75b23ec0d15472e8435b4277f3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20276: Fix GetCourseItem call to get itemnumber
Fridolin Somers [Fri, 23 Feb 2018 10:41:10 +0000 (11:41 +0100)]
Bug 20276: Fix GetCourseItem call to get itemnumber

In 17.05.x :
In course_reserves/add_items.pl we now get the item via Objects.
This line:
 66     my $course_item = GetCourseItem( itemnumber => $item->{'itemnumber'} );
Should be:
 66     my $course_item = GetCourseItem( itemnumber => $item->itemnumber );

This is corrected since 17.11 by :
Bug 18276: Remove GetBiblioFromItemNumber - Course reserves

Test plan :
1) Create a course reserve and add items.
2) Correct information must be displayed on the detail page of the course
reserve, on staff and OPAC interface.
3) Try to add a non existing barcode, you get the page with a message

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoUpdate release notes for 17.05.09 release v17.05.09
Fridolin Somers [Fri, 23 Feb 2018 09:29:03 +0000 (10:29 +0100)]
Update release notes for 17.05.09 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoIncrement version for 17.05.09 release
Fridolin Somers [Fri, 23 Feb 2018 09:12:19 +0000 (10:12 +0100)]
Increment version for 17.05.09 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoTranslation updates for Koha 17.05.09
Koha translators [Fri, 23 Feb 2018 09:13:30 +0000 (06:13 -0300)]
Translation updates for Koha 17.05.09

6 years agoBug 19847: (17.05.x follow-up) rebase error on C4::Biblio::GetMarcBiblio
Fridolin Somers [Mon, 19 Feb 2018 13:08:26 +0000 (14:08 +0100)]
Bug 19847: (17.05.x follow-up) rebase error on C4::Biblio::GetMarcBiblio

6 years agoBug 19730: (follow-up bug 17196) Use biblio_metadata.timestamp in export_records.pl
Julian Maurice [Fri, 1 Dec 2017 15:51:16 +0000 (15:51 +0000)]
Bug 19730: (follow-up bug 17196) Use biblio_metadata.timestamp in export_records.pl

Since bug 17196, biblioitems.timestamp is not always updated after a
change in the MARC record.
Filtering should be based on biblio_metadata.timestamp instead.

REVISED TEST PLAN
-----------------
0. Do not apply patch

1. Find a biblio record, remember the biblionumber for step 3

2. Edit the record, modify a field (e.g. 003, 015$q) that is
   not mapped to a DB column, so biblio_metadata.timestamp will
   be modified but not biblioitems.timestamp

3. In MySQL with the koha database selected:
   > select timestamp from biblio where biblionumber=###;
   > select timestamp from biblio_metadata where biblionumber=###;
   -- you'll need to change the ###'s based on the biblionumber
      you remembered in step 1.
   -- the two timestamps will differ.
   -- Remember the timestamp of biblio_metadata for step 4.

4. Run this command:
   $ sudo koha-shell -c bash kohadev
   $ export DATE="YYYY-MM-DD HH:mm:SS"
   -- use the timestamp remembered in step 3.

5. Run this command:
   $ ./misc/export_records.pl --date="$DATE"
   $ ls -la koha.mrc
   -- the file should be 0 bytes.

6. Run this command:
   $ exit
   $ git bz apply 19730
   $ restart_all
   $ sudo koha-shell -c bash kohadev
   $ export DATE="YYYY-MM-DD HH:mm:SS"
   -- use the timestamp remembered in step 3.

7. Run this command:
   $ ./misc/export_records.pl --date="$DATE"
   $ ls -la koha.mrc
   -- the file should be a lot more than 0 bytes.

8. Run this command:
   $ /home/vagrant/qa-test-tools/koha-qa.pl -v 2 -c 1
   -- this should pass.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f9fa8227367d65600eca4d2dbf5e2d8c09370b81)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20126: Add simple test for ModBiblioMarc
Marcel de Rooy [Fri, 2 Feb 2018 11:06:00 +0000 (12:06 +0100)]
Bug 20126: Add simple test for ModBiblioMarc

Just to confirm that we see record length and base address in a record
that has been passed through ModBiblioMarc.

Test plan:
Run the test.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1aebb1d476a1ae252758c2e89c9dbb668a60f092)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20126: (follow-up bug 10455) Restore MARC field length calculation in ModBiblioMarc
Marcel de Rooy [Fri, 2 Feb 2018 10:32:49 +0000 (11:32 +0100)]
Bug 20126: (follow-up bug 10455) Restore MARC field length calculation in ModBiblioMarc

Trivial fix. Problem raised by bug 10455.

Test plan:
[1] Create or edit biblio record.
[2] Save and check leader field lengths in MARC view.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ef7f119b1e0c0f5403239213e9ff0f450c923acf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19443: Remove duplicate message when editing existing patron
Alex Arnaud [Thu, 12 Oct 2017 07:24:33 +0000 (07:24 +0000)]
Bug 19443: Remove duplicate message when editing existing patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a522df7dd97f5d7e646966d9b7f4f18fe8df7e2d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19443: Wrong HTML in patron creation page (members/memberentry.pl)
Alex Arnaud [Tue, 10 Oct 2017 15:21:35 +0000 (15:21 +0000)]
Bug 19443: Wrong HTML in patron creation page (members/memberentry.pl)

The form provided on top of the page if Koha find a duplicate
patron is not closed. This cause some trouble.

Test plan:

 - Edit the syspref IntranetUserJS and type the following code:
   "$(document).ready(function() {
    $("#memberentry_library_management").insertBefore("#memberentry_identity");
    });"
 - create a patron so that Koha will warn you about a duplicate one,
 - click on "Not a duplicate. Save as new record",
 - you should get error(s) about empty field(s).
   Note that now, the library management part's fields are empty or
   reset to default

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 27fca7aceb91124c037bb3545c351d3cf185e7bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19975: Fix search by tags at the OPAC
Jonathan Druart [Mon, 22 Jan 2018 20:04:28 +0000 (17:04 -0300)]
Bug 19975: Fix search by tags at the OPAC

This bug has certainly be caused by
  commit 091d6c513bcbee224ff06477e79be48cea7fe825
    Bug 17843: Replace C4::Koha::getitemtypeinfo with Koha::ItemTypes

The reason is quite simple, in Koha::ItemType->translated_description
(called in opac-search.pl l.229) there is an eval to know if we have
access to the translated description of the item type, to avoid
retrieving it again.

The evaluation of $@ later in opac-search.pl is supposed to test the 2
eval made few lines before (a "normal" search, without tags), but
$@ contains the error message from the *last* eval command.
So we are raising an error that have been correctly handled in
Koha::ItemType.

Test plan:
At the OPAC, click Tag cloud, then click any of the tags

=> Without the patch you get
Koha::ItemType::get_column generated this error: DBIx::Class::Row::get_column(): No such column 'translated_description' on Koha::Schema::Result::Itemtype at /usr/share/koha/lib/Koha/Object.pm line 307

=> With the patch applied the page is correctly displayed

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fc172d3252b8587006f7d6b4d747ce2b339ea803)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19985: Make TestBuilder.t pass even if default_circ_rules is not empty
Jonathan Druart [Mon, 22 Jan 2018 20:18:59 +0000 (17:18 -0300)]
Bug 19985: Make TestBuilder.t pass even if default_circ_rules is not empty

This table cannot contain more than 1 row, so we need to remove its data
before trying to generate a new entry.

Test plan:
Set a default circ rule
 prove t/db_dependent/TestBuilder.t
should return green

Without this patch you get:
    #   Failed test 'TestBuilder should be able to create an object for every source'
    #   at t/db_dependent/TestBuilder.t line 78.
    #          got: '1'
    #     expected: '0'
    # The following sources have not been generated correctly: DefaultCircRule
    # Looks like you failed 1 test of 1.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 55d8ea59e7964d05ffb68e7bfcf14d6556ed8739)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 18477: Populate article_requests table values for AR_PENDING notices
Kyle M Hall [Mon, 8 May 2017 16:47:06 +0000 (16:47 +0000)]
Bug 18477: Populate article_requests table values for AR_PENDING notices

The default AR_PENDING letter does not print populate <<article_requests.*>> fields.

Test Plan:
1) Enable article requests ( syspref: ArticleRequests => Enable, Circ and fine rules ALL/ALL (or a given category/itemtype): Article requests => Yes )
2) Search for a title, click in to catalog detail, click 'Request Article' button.
3) Select Patron
4) Fill out request information
5) Click 'Place request'
6) Go to notices in patron record, inspect 'Article Request Received' notice. You should see the request information from step 4, but it doesn't display.
7) Apply this patch
8) Repeat steps 2-6, not the fields now display!

Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e1a61134eb921760ebe3ac992a151591bb3977bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 18477: Add tests
Jonathan Druart [Tue, 2 Jan 2018 17:36:43 +0000 (14:36 -0300)]
Bug 18477: Add tests

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2a0423778e73467beeb57379db49b49b811894aa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19596: Don't try to get hold or items count for non-existent biblios
Nick Clemens [Wed, 8 Nov 2017 17:55:00 +0000 (17:55 +0000)]
Bug 19596: Don't try to get hold or items count for non-existent biblios

Patch applies and works as expected.

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c42053021bf6f0d5550df5786c8017b90f634ebd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19705: Try to fix random failures from DecreaseLoanHighHolds.t
Jonathan Druart [Tue, 23 Jan 2018 20:00:16 +0000 (17:00 -0300)]
Bug 19705: Try to fix random failures from DecreaseLoanHighHolds.t

No idea if it will do the trick, wait and see...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a6d6b0fdf68e56fd41eb3a8e38362a0e8005de9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoRevert "Bug 19669: (QA follow-up) Remove itemstypes.plugin"
Fridolin Somers [Mon, 5 Feb 2018 10:25:11 +0000 (11:25 +0100)]
Revert "Bug 19669: (QA follow-up) Remove itemstypes.plugin"

This reverts commit 6338895489156832782ce31c0f1e37dce070d4f9.

6 years agoBug 19455: Prevent SwitchOnSiteCheckouts.t to fail randomly
Jonathan Druart [Thu, 12 Oct 2017 14:19:40 +0000 (11:19 -0300)]
Bug 19455: Prevent SwitchOnSiteCheckouts.t to fail randomly

If categorycode is 'X', the test will fail

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 307e55a7debdf5e1c960cbfea443b6b160c0ce9a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 15770: Do not format numbers if too big
Jonathan Druart [Wed, 20 Dec 2017 23:29:29 +0000 (20:29 -0300)]
Bug 15770: Do not format numbers if too big

At several places we got the following error if we use numbers too big
for Number::Format
Template process failed: undef error - round() overflow. Try smaller
precision or use Math::BigFloat at /home/koha/src/Koha/Number/Price.pm line 44

It make the app explodes.
The goal here is to handle these errors gracefully and easily.

Test plan:
- Add a manual fine to a patron of 100000000000000
- Create a patron category with an enrolment fee of 123456789012345

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 937237a1f29192c8be73fbcc3cd7e29c40468831)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19971: Typo in the comments of parseQuery routine
Olivier Crouzet [Mon, 15 Jan 2018 16:22:22 +0000 (17:22 +0100)]
Bug 19971: Typo in the comments of parseQuery routine

TEST PLAN
---------
1) Run these commands:
    git checkout master
    git pull
    perldoc C4::Search
2) look for parseQuery
    -- NOTE: The sample code provided below this heading has
             the wrong function name!
3) Run these commands:
    git checkout -b bug_19971 origin/master
    perldoc C4::Search
4) look for parseQuery
    -- NOTE: The wrong function name is corrected.
5) Run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 431d315534c9f41d4418b528bf9b78970f235a46)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19221: Onboarding tool says user needs to be made superlibrarian
Te Rauhina Jackson [Tue, 16 Jan 2018 21:21:21 +0000 (21:21 +0000)]
Bug 19221: Onboarding tool says user needs to be made superlibrarian

I changed the "To give new patron superlibrarian permissions go to:"
message to "To edit patron permissions, go to:". Please clarify if this
is clearer or not.

Test plan:
1) Apply patch
2) Go through the web installer
3) At the create koha administrator patron step, notice that at the
   bottom, there is a message saying "To edit patron permissions, go
   to:"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 42ff4bfca63da3e4e8df39b4f6bce703f7cc9213)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19825: Make links to biblios on pending offline circulation page working again
Josef Moravec [Sun, 17 Dec 2017 08:45:41 +0000 (08:45 +0000)]
Bug 19825: Make links to biblios on pending offline circulation page working again

0) Do not apply the patch
1) Have pending offline circulation operations - you can use standalone
application, Firefox add-on or built-in offline circulatin client - it
does not matter in this case
2) Go to Circulation -> pending offline circulation actions
3) You see all barcode in red and without links - even if the item and
biblio existed
4) Apply the patch
5) Repeat 1-3, now you should see the links to biblio on existing items

Note: Don't add non-existent barcodes actions and payment actions unti
bug 19771 is not fixed

Signed-off-by: Charlotte Cordwell <charlotte.cordwell123@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 14a3e2fddf031aca6b76d69122464412c461c5f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 19839: Removed Warning (invoice.pl - uncertainprices)
Grace Smyth [Tue, 16 Jan 2018 03:41:15 +0000 (03:41 +0000)]
Bug 19839: Removed Warning (invoice.pl - uncertainprices)

Test Plan
[1.] Check the patch to see that I have removed:
$template->param( uncertainprices => 1 ); from line 204 as Mr Druart has instructed to do
(to get to the patch see the comment above by Mr Druart)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit db7e3a41b15829a11d9f4465c95e36c7fd3eb735)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 17682: DBRev 17.05.08.002
Fridolin Somers [Fri, 2 Feb 2018 08:18:16 +0000 (09:18 +0100)]
Bug 17682: DBRev 17.05.08.002

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 17682: Replace 2 occurrences in de-DE and nb-NO
Jonathan Druart [Fri, 19 Jan 2018 18:26:32 +0000 (15:26 -0300)]
Bug 17682: Replace 2 occurrences in de-DE and nb-NO

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7b4b8699a69df4d4c6e0bedd421e385bfdc5dcee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 17682: (follow-up) Change URL for Google Scholar in OPACSearchForTitleIn
Charlotte Cordwell [Tue, 16 Jan 2018 20:14:20 +0000 (20:14 +0000)]
Bug 17682: (follow-up) Change URL for Google Scholar in OPACSearchForTitleIn

Amended the sql statement so it only affects the http://www.scholar.google.com url

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5bf7600456aa66c1984ba7e8f2d781f468f23b6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 17682: Change URL for Google Scholar in OPACSearchForTitleIn
Charlotte Cordwell [Tue, 16 Jan 2018 03:55:49 +0000 (03:55 +0000)]
Bug 17682: Change URL for Google Scholar in OPACSearchForTitleIn

1)apply patch
2) go into administration --> search for OPACSearchForTitleIn
3) *click to edit*
4) look at the link and read the google scholar one.
5) check that the start link is https://scholar.google.com.
6) http://www.scholar.google is incorrect

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 17a0a796bb3349f175ae82fa8a7ba05eb614391c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 20072 - Fix build-git-snapshot for Debian source format quilt
Mirko Tietgen [Tue, 23 Jan 2018 10:43:10 +0000 (11:43 +0100)]
Bug 20072 - Fix build-git-snapshot for Debian source format quilt

With bug 18696 we need a few tiny changes to build-git-snapshot:
- Debian revision number for debian/changelog
- "orig" in the file name for the tar.gz archive

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 16603: (QA follow-up) Add a FIXME
Nick Clemens [Fri, 19 Jan 2018 14:11:51 +0000 (14:11 +0000)]
Bug 16603: (QA follow-up) Add a FIXME

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 479945b208d15dd9ea4290e512a873c75a994e3c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
6 years agoBug 16603: When processing uploaded offline circulation file, "apply directly" option...
Owen Leonard [Fri, 1 Dec 2017 18:23:01 +0000 (18:23 +0000)]
Bug 16603: When processing uploaded offline circulation file, "apply directly" option fails

This patch is a temporary mitigation of whatever the real problem is.
The patch hides the "Apply directly" button so that the option isn't
available.

To test, apply the patch and generate a .koc file with some
transactions. Upload the file via Circulation -> Offline
circulation file upload. After the file is uploaded, you should see only
a "Add to offline circulation queue" button, which should work
correctly.

Signed-off-by: Grace Smyth <gracesmythh@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 18e5177e1a3a0fc6f0b16b827c2c28474ff54c03)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>