]> git.koha-community.org Git - koha.git/log
koha.git
7 years agoBug 19116: Unit tests
Jonathan Druart [Mon, 4 Sep 2017 17:14:31 +0000 (14:14 -0300)]
Bug 19116: Unit tests

Signed-off-by: Kyle M Hall <kyle@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 021d1d3714602be64609b9db82fd92e8bb1b42c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18897: Add skipping to t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t
Mark Tompsett [Tue, 3 Oct 2017 02:00:57 +0000 (22:00 -0400)]
Bug 18897: Add skipping to t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t

Test Plan:
$ git fetch
$ git checkout -b bug_18897 origin/master
$ sudo apt-get remove libcatmandu-store-elasticsearch-perl
$ prove t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t
-- nasty failure.
$ git bz apply 18897
-- apply all the patches
$ prove t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t
-- nicer skip message
run the koha qa test tools

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18897: Skipping t/db_dependend/00-strict elastic search stuffs as needed
Mark Tompsett [Tue, 3 Oct 2017 01:50:01 +0000 (21:50 -0400)]
Bug 18897: Skipping t/db_dependend/00-strict elastic search stuffs as needed

Test Plan:
$ git fetch
$ git checkout -b bug_18897 origin/master
$ sudo apt-get remove libcatmandu-store-elasticsearch-perl
$ prove t/db_dependent/00-strict.t
-- nasty failure.
$ git bz apply 18897
-- interactive apply just the four patchs
$ prove t/db_dependent/00-strict.t
-- nicer skip message
run the koha qa test tools

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 years agoBug 18897: Use Module::Load::Conditional::can_load
Mark Tompsett [Fri, 1 Sep 2017 18:15:44 +0000 (14:15 -0400)]
Bug 18897: Use Module::Load::Conditional::can_load

Rather than rely on eval(), Jonathan Druart recommended in
comment #6 to use Use Module::Load::Conditional::can_load.
This addresses that concern.

TEST PLAN
---------
$ git fetch
$ git checkout -b bug_18897 origin/master
$ git bz apply 18897
$ sudo apt-get remove libcatmandu-store-elasticsearch-perl
...
$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t
-- Note that the message says the correct library is missing.
$ sudo apt-get install libcatmandu-store-elasticsearch-perl
-- Note it runs as expected.
run the koha qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 years agoBug 18897: Improve error message
Mark Tompsett [Fri, 25 Aug 2017 11:38:06 +0000 (07:38 -0400)]
Bug 18897: Improve error message

Test Plan:
$ git fetch
$ git checkout -b bug_18897 origin/master
$ git bz apply 18897
-- interactive apply just the first patch
$ sudo apt-get remove libcatmandu-store-elasticsearch-perl
...
$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t
-- Note that the message says the wrong library is missing.
$ git bz apply 18897
-- interactive apply this patch
$ prove t/db_dependent/Koha_Elasticsearch_Indexer.t
-- Note that the message says the correct library is missing.
run the koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 years agoBug 18897: Koha_Elasticsearch_Indexer.t doesn't skip when ES module(s) not installed
Lee Jamison [Fri, 25 Aug 2017 11:18:15 +0000 (07:18 -0400)]
Bug 18897: Koha_Elasticsearch_Indexer.t doesn't skip when ES module(s) not installed

If Catmandu::Importer::MARC is not installed,
Koha_Elasticsearch_Indexer.t fails instead of skipping.
It should skip as ES is not currently mandatory.

Test Plan:
1. Run "prove t/db_dependent/Koha_Elasticsearch_Indexer.t"
   as koha-shell
2. Note failure on test 1/5 indicating module not installed.
3. Apply patch.
4. Re-run "prove t/db_dependent/Koha_Elasticsearch_Indexer.t"
5. Note test now skips.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 years agoBug 19385: Fix random t/Calendar.t failure - clear the cache before
Jonathan Druart [Thu, 28 Sep 2017 17:49:11 +0000 (14:49 -0300)]
Bug 19385: Fix random t/Calendar.t failure - clear the cache before

The cache 'exception_holidays' may be populated when we run these tests,
we need to clear it before the tests are run.

Test plan:
  prove t/db_dependent/Circulation/CalcDateDue.t  t/Calendar.t

Without this patch, t/Calendar will fail with:
  #   Failed test 'Exception holiday is not a closed day test'
  #   at t/Calendar.t line 159.
  #          got: '1'
  #     expected: '0'
  # Looks like you failed 1 test of 38.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ae86b7ca9ea60bba47d3a999ff13d6140cdc5e1c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19004: [QA Follow-up] No need to check item-level_itypes again
Marcel de Rooy [Mon, 28 Aug 2017 06:51:24 +0000 (08:51 +0200)]
Bug 19004: [QA Follow-up] No need to check item-level_itypes again

As Jonathan pointed out, GetItem already called effective_itemtype.
So we can just use $item->{itype} here.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0e744d49b557e3401ae7b700b1410b022a4e851c)

7 years agoBug 19004: Adjust AddReturn for retrieving item type
Marcel de Rooy [Wed, 9 Aug 2017 14:30:03 +0000 (16:30 +0200)]
Bug 19004: Adjust AddReturn for retrieving item type

In the regular situation, you can get itemtype via biblio and then
biblioitem as well as via biblioitem (at least when item-level_itypes
is set to biblio).

But since Koha unfortunately defined two relations in item, one for
biblioitemnumber (the good one) and one for biblionumber (redundant),
TestBuilder (correctly) builds one biblioitem and two biblios.

If you item-level_itypes to biblio record, this will result in failing tests
when calling AddReturn (in this case Koha/Patrons.t).
It will crash on:
    Can't call method "itemtype" on an undefined value at C4/Circulation.pm line 1826.
Cause: AddReturn goes via the biblionumber to biblio and than to
biblioitems, and it does not find a biblioitem. (Not a fault from TestBuilder
but a database design problem.)

This patch makes a small change in AddReturn to retrieve the itemtype via
biblioitem. It actually is a shorter road than items->biblio->biblioitems.

Note: I do not test the Biblioitems->find call, since we already checked
the GetItem call before and we have a foreign key constraint.
I did not call $item->effective_itemtype since we still use GetItem; this
could be done later.

Adjusted Circulation/Returns.t too: If we add an item with TestBuilder and
we called AddBiblio before, we should link biblioitemnumber as well.

Test plan:
[1] Do not apply this patch yet.
[2] Set item-level_itypes to biblio record.
[3] Run t/db_dependent/Koha/Patrons.t. (It should fail.)
[4] Apply this patch.
[5] Run t/db_dependent/Koha/Patrons.t again.
[6] Run t/db_dependent/Circulation/Returns.t
[7] Git grep on AddReturn and run a few other tests calling it.
    Note: Bugs 19070/19071 address three tests that call AddReturn too.
[8] In the interface, check in a book.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Note: Bugs 19070 and 19071 are already pushed. The command in comment #4
      has all the tests successful.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0fc3f19605d3979333dc333237205b9bef6ab60b)

7 years agoBug 19004: Patrons.t should create its own data for enrollment fees.
Marcel de Rooy [Sun, 30 Jul 2017 14:53:00 +0000 (16:53 +0200)]
Bug 19004: Patrons.t should create its own data for enrollment fees.

If the patron categories J, K, YA would not exist, Patrons.t would fail.

Test plan:
[1] Remove one of these patron categories.
[2] Run t/db_dependent/Koha/Patrons.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 57427f7a10c887964fa4d4397c6ec238af2bc694)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 14316: Clarify meaning of record number in Batch record modification tool
Katrin Fischer [Sat, 19 Aug 2017 08:22:44 +0000 (10:22 +0200)]
Bug 14316: Clarify meaning of record number in Batch record modification tool

Same change as the first patch, but for the batch record
modification tool.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 327495b5e0ec4de47d20bd27d6a1c5b88e0be191)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 14316: Clarify meaning of record number in Batch record deletion tool
Katrin Fischer [Mon, 8 Jun 2015 00:03:34 +0000 (02:03 +0200)]
Bug 14316: Clarify meaning of record number in Batch record deletion tool

Changes the label from 'list of record numbers...' to
'List of biblionumbers or authority ids...' to make it
more clear to the user which kind of input is expected.

To test:
- Go to Tools > Batch record deletion
- Check the new description
- Decide if it's more clear or not

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4934ee4a1601bd268a7153b7189387bb073dd11f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18946 [QA Followup] - code cleanup
Kyle M Hall [Fri, 1 Sep 2017 12:41:51 +0000 (08:41 -0400)]
Bug 18946 [QA Followup] - code cleanup

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f1b0dae9a6055e8ba5e9a9638af32060c1e17e33)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18946 - Change language from external web fails
Karam Qubsi [Tue, 18 Jul 2017 16:06:48 +0000 (00:06 +0800)]
Bug 18946 - Change language from external web fails

How to reproduce:
1. Get a multilingüal Koha like
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=en
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=es-ES

2. Copy that urls to any web page in an other domain -it must be in some
host - and try to link to the spanish or english version,it will keep you in the same position.

3. Apply this patch and try again , everything should work fine .

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 48f54016a7accfc0cc43bf01cbac70a8482bc3f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18692 - intranet part
Lari Taskula [Wed, 31 May 2017 14:03:54 +0000 (17:03 +0300)]
Bug 18692 - intranet part

Fixes misplaced columns introduced by previous patch and adds the "-" for phone
transport type.

To test:
1. Set SMSSendDriver system preference on
2. Go to intranet messaging preferences
3. By default you should see checkboxes for all messages for SMS
4. Ensure columns are not misplaced (pushing one column too much to the right)
5. Delete sms method from one of the messages in message_transports table
6. Observe that "-" is displayed instead of checkbox for that message for SMS
7. Repeat same for TalkingTechItivaPhoneNotification system preference.
   By default it may not have transports in message_transports, so make sure
   to assign some in order to have the checkboxes visible.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bb31d99065c468fbec2443cd15894b03657a24d5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18692 - same with syspref TalkingTechItivaPhone
Fridolin Somers [Thu, 1 Jun 2017 15:22:42 +0000 (17:22 +0200)]
Bug 18692 - same with syspref TalkingTechItivaPhone

Fixes misplaced columns introduced by previous patch and adds the "-" for phone
transport type.

To test:
1. Set SMSSendDriver system preference on
2. Go to intra and OPAC messaging preferences
3. By default you should see checkboxes for all messages for SMS
4. Ensure columns are not misplaced (pushing one column too much to the right)
5. Delete sms method from one of the messages in message_transports table
6. Observe that "-" is displayed instead of checkbox for that message for SMS
7. Repeat same for TalkingTechItivaPhoneNotification system preference.
   By default it may not have transports in message_transports, so make sure
   to assign some in order to have the checkboxes visible.

https://bugs.koha-community.org/show_bug.cgi?id=8692

Signed-off-by: Michael Andrew Cabus <michael@bywatersolutons.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8fd0847c82adbcaf0af3285dd9cfc5e646ba6500)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18692 - When SMS is enabled the OPAC messaging table is misaligned
Fridolin Somers [Mon, 29 May 2017 14:32:18 +0000 (16:32 +0200)]
Bug 18692 - When SMS is enabled the OPAC messaging table is misaligned

Bug 6726 had corrected the fact that when SMS is enabled the messaging table is missing a column.
Bug 6458 has broken this.
The SMS column is missing an else case with cell containing only "-" like other columns.

Test plan :
- set SMSSendDriver preference empty
- go to OPAC patron messaging
- column SMS should not be visible
- set SMSSendDriver preference not empty
- go to OPAC patron messaging
- column SMS appears with checkboxes

Signed-off-by: Michael Andrew Cabus <michael@bywatersolutons.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a932d05ace6500a3b67888aad1306e58cfa8014f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18636: Sysprefs: Add explanation for conflict autonumbernum / BorrowerMandatoryFields
Marc Véron [Wed, 9 Aug 2017 07:46:02 +0000 (09:46 +0200)]
Bug 18636: Sysprefs: Add explanation for conflict autonumbernum / BorrowerMandatoryFields

This patch adds a note to the system preferences autonembernum and
BorrowerMandatoryFields regarding a conflict if automembernum is on
and BorrowerMandatoryFields contains cardnumber.

To reproduce issue: See initial comment.

To test:
- Apply patch
- Verify that in system preferences note appears with both prefs
  automembernum and BorrowerMandatoryFields

Followed test plan, works as described
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 65bce82b1fb32d3d98fe4d4ef1e1738a97749632)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 16485: collection column in Item search is always empty
Marc Véron [Tue, 27 Jun 2017 16:50:44 +0000 (18:50 +0200)]
Bug 16485: collection column in Item search is always empty

This patch fills the column 'Collection' in item search from the item values.

To test:
- Go to item search
- Reproduce issue from initial comment
- Apply patch
- Verify that the column 'Collection' is filled

Still to do, but outside of my datatable skills:
Filter by drop down in the column header does a substring search.
Example: Filter for 'Fiction" returns both 'Fiction' and 'Non-fiction' items.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6c1504cfdb301cb0f9f3a14b5db31a63f5c3b0a5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19024 Do not unset order cancelled status on basket close
Colin Campbell [Wed, 2 Aug 2017 16:12:44 +0000 (17:12 +0100)]
Bug 19024 Do not unset order cancelled status on basket close

On closing a basket, status is updated to ordered for orders not
completed. However the operation  was resetting the status for
cancelled as well as new orders.
While display is correct from the basket view (it checks the
cancellation date). The status in the acquisitions tab from the
catalogue view reverts erroneously to ordered.

This patch adds cancelled to the statuses not updated on basket
close.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
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 2e9165001f69312255ad1b6706f040784460d5d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19024 Fix some infelicities of phrasing in test messages
Colin Campbell [Tue, 15 Aug 2017 10:44:12 +0000 (11:44 +0100)]
Bug 19024 Fix some infelicities of phrasing in test messages

The test messages were awkwardly phrased, re phrase them to
sound more natuaral. Patch is cosmetic (grammar) only

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
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 16c25a36988b47fb9fcbabd91fdace5f98f9caed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19024: Add tests
Jonathan Druart [Wed, 9 Aug 2017 19:09:32 +0000 (16:09 -0300)]
Bug 19024: Add tests

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
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 7db6067dc4cc55bee771fedb31e2454b72123ac0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 9857: Fix failing tests
Jonathan Druart [Fri, 1 Sep 2017 19:20:18 +0000 (16:20 -0300)]
Bug 9857: Fix failing tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 49778103ce528ccfc7fcc8be26bcae3b4ae7815b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 9857 - Follow-up - Fix for searches with su= or su:
Katrin Fischer [Fri, 18 Aug 2017 08:36:59 +0000 (08:36 +0000)]
Bug 9857 - Follow-up - Fix for searches with su= or su:

When the initial search is su=.../su:... the links was
not constructed correctly. With this change, it should
be the case.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 786deba62beb5a52a543af5415610e14f7d0a8c5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 9857: Did you mean? uses wrong punctuation in search links
Katrin Fischer [Fri, 4 Dec 2015 00:17:50 +0000 (01:17 +0100)]
Bug 9857: Did you mean? uses wrong punctuation in search links

The link changes the search links generated by the plugins
from an=authid to an:authid, as suggested by Jared on the
bug report.

- Turn on the AuthorityFile und ExplodedTerms  plugins
  for the OPAC from the "Did you mean" section of the
  administration module
- Search a term in your OPAC where one or several
  authorities exist.
  A last name or a place name might work well.
- Verify that there are suggestions displayed on top of
  your result list.
- Verify that the link created is something like:
  /cgi-bin/koha/opac-search.pl?q=an=14084
- Apply patch.
- Verify the link has changed a little and still works
  correctly:
  /cgi-bin/koha/opac-search.pl?q=an:14084

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d0e3891e251a6a11188d70a5480af0e44b8c1fb0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18621: Added in value attribute to dateexpiry field
Alex Buckley [Tue, 11 Jul 2017 22:09:48 +0000 (10:09 +1200)]
Bug 18621: Added in value attribute to dateexpiry field

Test plan:
1. Create a patron category with the dateexpiry value of 29/9/2017

2. Create a patron user from that patron category (which I'll refer to as patron A) with the date
expiry value of 1/10/2017 and submit the form

3. Notice that the manual dateexpiry you have submitted is correctly
displayed

4. Create a duplicate patron with the same firstname and surname and
patron A, and set the date expiry value of 1/10/2017 and submit the form

5. The form displays a duplicate patron message. Notice that the dateexpiry input box is empty now

6. Select the new member (not a duplicate member) option in the
messagebox

7. The form successfully submits and notice that the date expiry value
displayed is that of the patron category (i.e. it is 29/9/2017) not the
dateexpiry value of 1/10/2017 that you manually set for this patron

8. Apply patch

9. Repeat step 4

10. The form displays a duplicate patron message. Notice the dateexpiry input box still
contains the value you entered which is 1/10/2017. Select the new member
(not a duplicate member) option in the messagebox

11. The form successfully submits and notice that the date expiry value
displayed is 1/10/2017 that you manually set for this 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 515e62992893b72c54a34311088a9442a37d8138)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19129 - Follow-up - Add changes to patron duplicate warning
Katrin Fischer [Thu, 17 Aug 2017 22:14:52 +0000 (00:14 +0200)]
Bug 19129 - Follow-up - Add changes to patron duplicate warning

Adds logic from the previous fix to the brief patron summary
shown when checking a possible patron duplicate.

Bonus: Also fixes missing patron category description there.

To Test:
- Add 2 patrons
- Add a patron with the same surname and firstname as an
  existing patron in order to trigger the duplicate message
- Click "View existing patron"
- Verify display is correct when existing patron is
  - an organisation
  - not an organisation
- Verify that the patron category description shows

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a887aeb2dff4e52f35f1f64bfc267867987cbb53)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19129 - Clean up Details tab for Organisation patrons
Katrin Fischer [Thu, 17 Aug 2017 14:51:08 +0000 (14:51 +0000)]
Bug 19129 - Clean up Details tab for Organisation patrons

Problem: A patron category "I" would cause display problems
on the details in the intranet. This is because the templates
confused patron category "I" with patron type "I" (organisation).

Patch:
- Cleans up variable confusion between categorycode and
  categorytype.
- The template contained code to change the labels below
  the address to 'Organisational phone:" etc., I have removed
  this part as it does not match the edit form anymore.
- Initials, date of birth and gender are still hidden for
  organisation - matching the edit form.

Bonus:
- The patron category description was missing on the
  right and left side of the details tab. Now it displays.
- Fixes some html issues:
  - doubled up class attribute in a tag
  - doubled up </li></li>

To test:
- Create 3 patrons
  - patron category code doesn't matter, but category type organisation
  - patron category code 'I', category type NOT organisation
  - patron category code NOT I, category type NOT organisaton
- Check details tab in patron account in staff for all 3
  - Verify patron category description shows correctly
  - Verify information added to the account displays correctly
    (phone numbers, emails, ...)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 82f183c5ea802e3231cb2442cf32474c92bd6ab4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18812 - SIP Patron status does not respect OverduesBlockCirc
Nick Clemens [Thu, 15 Jun 2017 15:07:03 +0000 (11:07 -0400)]
Bug 18812 - SIP Patron status does not respect OverduesBlockCirc

To test:
1 - Set 'OverduesBlockCirc' to block
2 - Find or create a patron with overdues
3 - Perform a SIP patron lookup on that patron
misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l CPL
--patron {userid or cardnumber} --password {pass} -m patron_information
4 - Note the first character of response is a ' '
5 - Apply patch
6 - Restart memcached, apache, and plack
7 - Perform SIP patron lookup
8 - Note the first character of response is 'Y'
9 - prove t/db_dependent/SIP/Patron.t
10 - Test should return green

Signed-off-by: Chris Kirby <chris.kirby@ilsleypubliclibrary.org>
Works as advertised

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 ff4f0858950c37eeede38b2f067841602b97d7ba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19055: Remove C4::Reserves::GetReservesToBranch
Jonathan Druart [Mon, 7 Aug 2017 20:25:15 +0000 (17:25 -0300)]
Bug 19055: Remove C4::Reserves::GetReservesToBranch

This subroutine is no longer in used and can be removed

Test plan:
  git grep GetReservesToBranch
must not return any results

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9cc7268362219e39b22aebb03a83e013f467d93a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19007 - Allow paypal payments via debit or credit card again
Kyle M Hall [Mon, 31 Jul 2017 13:18:15 +0000 (09:18 -0400)]
Bug 19007 - Allow paypal payments via debit or credit card again

A recent change in Paypal has removed the previous default option of paying via debit or credit card without an account. To bring this option back, we need to send an additional parameter to the PayPal API.

Test Plan:
1) Enable paypal for your Koha instance
2) Ensure you are not logged in to PayPal
3) Attempt to pay a fine via PayPal
4) Not the the "Pay with Debit or Credit Card" option is missing
5) Apply this patch
6) Refresh opac-account.pl
7) Attempt to make a payment via PayPal again
8) Note the option "Pay with Debit or Credit Card" is now available

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: George Williams <gwilliams@nekls.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 10311769d460a775aa8c8ee8a190836a8f2b1f1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 14353 - Show 'damaged' and other status on the 'place holds' page in staff
Marc Véron [Sat, 18 Feb 2017 17:35:39 +0000 (18:35 +0100)]
Bug 14353 - Show 'damaged' and other status on the 'place holds' page in staff

This patch adds status 'Damaged' to 'Information' 'Status' in the items
table on 'Place hold' page.

To test:
- Apply patch
- In staff client, try to place an item level hold for items with 'Damaged'
  status.
- Verify that the status 'Damaged' appears in the column 'Information'.

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 8d08254b2202353517c16f34172cb92dcdd5befa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 15924 - Coce not enabled on lists
Nick Clemens [Fri, 26 Feb 2016 14:46:45 +0000 (14:46 +0000)]
Bug 15924 - Coce not enabled on lists

To test:
Enable Coce and disable other image services
Load a list and not there are no covers
Apply patch
Load a list and note there are covers

https://bugs.koha-community.org/show_bug.cgi?id=15924

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 85b963d11fb5d8674ca6b0ec60821663f9d8cf19)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19335: Fix 00-merge-conflict-markers.t when dockerised
Jonathan Druart [Mon, 18 Sep 2017 17:23:54 +0000 (14:23 -0300)]
Bug 19335: Fix 00-merge-conflict-markers.t when dockerised

This does not make sense, but fix a bug (why?)
Without this patch, the tests failed on po files:

[17:14:26] t/00-merge-conflict-markers.t .. Failed 1/1 subtests
Test Summary Report
-------------------
t/00-merge-conflict-markers.t (Wstat: 9 Tests: 0 Failed: 0)
  Non-zero wait status: 9
  Parse errors: Bad plan.  You planned 1 tests but ran 0.
Result: FAIL

Note that this is not related to bug 19227.

if the ^>>>>>> and ^<<<<<< matches are done on the same line, the test fail
As saw it failed on *-pref.po files
  misc/translator/po/kn-Knda-pref.po
  misc/translator/po/ja-Jpan-JP-pref.po
  misc/translator/po/nl-BE-pref.po
  misc/translator/po/sr-Cyrl-pref.po

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0d03f143e25f498de780d2ddd1972c3be7947519)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19227: Reduce the number of tests run by 00-merge-conflict-markers.t
Jonathan Druart [Thu, 31 Aug 2017 14:47:11 +0000 (11:47 -0300)]
Bug 19227: Reduce the number of tests run by 00-merge-conflict-markers.t

The number of tests on jenkins is sometimes confusing:

https://jenkins.koha-community.org/job/Koha_Master_D8/lastCompletedBuild/testReport/(root)/t_00_merge_conflict_markers_t/

shows that 00-merge-conflict-markers.t ran 10,751 tests, 124 less than
the previous run. However 124 files have not been removed from the
codebase!

I suggest to count only 1 test for all files.

Moreover files from blib and cover_db are counted, they should be
excluded.

Test plan:
  prove t/00-merge-conflict-markers.t
must return green

echo ">>>>>>>" >> mainpage.pl
and run the test again
It should now fail

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f8502b0d197bab4b4966e9e02253d30f7fcf29f8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19391: (bug 19128 follow-up) Fix failing tests from auth_values_input_www.t
Jonathan Druart [Fri, 29 Sep 2017 19:16:56 +0000 (16:16 -0300)]
Bug 19391: (bug 19128 follow-up) Fix failing tests from auth_values_input_www.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b6f8cf43698979914704dd08c45f11e6b8e406ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoRevert "Bug 18817 Correct Manual URL"
Fridolin Somers [Mon, 2 Oct 2017 13:04:17 +0000 (15:04 +0200)]
Revert "Bug 18817 Correct Manual URL"

This reverts commit ebd244dcab375fcaebe9ab3d1f7673a6638e2c0b.

7 years agoRevert "Bug 18817: Update links with anchor automatically"
Fridolin Somers [Mon, 2 Oct 2017 13:04:15 +0000 (15:04 +0200)]
Revert "Bug 18817: Update links with anchor automatically"

This reverts commit b1ec1ff0ecf0d54c00182f5fb44e700d664da039.

7 years agoRevert "Bug 18817: Update links manually"
Fridolin Somers [Mon, 2 Oct 2017 13:04:12 +0000 (15:04 +0200)]
Revert "Bug 18817: Update links manually"

This reverts commit b3e2933f5c36101784a1780444dd619655ee7ea2.

7 years agoBug 18871: Make patron list name a link to view contents of list
Aleisha Amohia [Wed, 28 Jun 2017 00:40:00 +0000 (00:40 +0000)]
Bug 18871: Make patron list name a link to view contents of list

The link is the same as the 'Add patrons' button in Actions dropdown,
but requires one less click, and makes finding the contents of the list
more obvious.

To test:
1) Go to Tools -> Patron lists
2) Create a patron list if you haven't already
3) Confirm that clicking the name of the list takes you to the correct
list and shows the expected content.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d51059807690797aa4d16b0c0dd2932235a3b683)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18781: Translatability: Get rid of exposed tt directives in openlibrary-readapi.inc
Marc Véron [Mon, 12 Jun 2017 07:07:28 +0000 (09:07 +0200)]
Bug 18781: Translatability: Get rid of exposed tt directives in openlibrary-readapi.inc

The file koha-tmpl/opac-tmpl/bootstrap/en/includes/openlibrary-readapi.inc
exposes template directives to translation. The only string that should
appear in .po from this file is "Open Library: "

To test:
- Apply patch
- Verify that code changes make sense
- Bonus test: create a new language 'aa-AA', verify in aa-AA-opac-bootstrap.po
  that there is only the following string for openlibrary-readapi.inc:
msgid "Open Library: "
msgstr ""

NOTE: Followed a test plan similar to bug 18776 comment 3

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 23cc8b39682fea7b0a9150933c65c34ef22d23dd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18780: Translatability: Get rid of exposed tt directive in masthead-langmenu.inc
Marc Véron [Mon, 12 Jun 2017 06:41:41 +0000 (08:41 +0200)]
Bug 18780: Translatability: Get rid of exposed tt directive in masthead-langmenu.inc

The file opac-tmpl/bootstrap/en/includes/masthead-langmenu.inc exposes following tt directive to translators:

"[%% IF ( ( opaclanguagesdisplay ) && ( ! one_language_enabled ) && "
"( languages_loop ) && ( OpacLangSelectorMode == 'both' || "
"OpacLangSelectorMode == 'top') ) %%] "

This patch fixes it.

To test:
- Apply patch
- Verify that language selector in OPAC (top of the page) works as expected
- Bonus test: create a new language 'aa-AA', verify that line above does not
show up in aa-AA-opac-bootstrap.po

NOTE: Followed a test plan similar to bug 18776 comment 3

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 255cadeb772d63b06f77146c95b8d6e4b31d5836)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18779: Translatability: Get rid of exposed tt directives in authorities-search...
Marc Véron [Mon, 12 Jun 2017 06:20:56 +0000 (08:20 +0200)]
Bug 18779: Translatability: Get rid of exposed tt directives in authorities-search-results.inc (OPAC)

The file opac-tmpl/bootstrap/en/includes/authorities-search-results.inc
exposes template directives to translation where translators should not
be confronted with.

Example:
"[%% PROCESS showreference heading=seeals.heading linkType='seealso' "
"type=seeals.type authid=seeals.authid %%] "

To test:
- Apply patch
- Verify that Authority search in OPAC works as before
- Bonus test: create a new language 'aa-AA', verify that line above
  does not show up in aa-AA-opac-bootstrap.po

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 331320f93a5ef5293c3bcad80b9554ddea0196b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18777: Translatability: Get rid of exposed tt directives in opac-memberentry.tt
Marc Véron [Sun, 11 Jun 2017 18:16:46 +0000 (20:16 +0200)]
Bug 18777: Translatability: Get rid of exposed tt directives in opac-memberentry.tt

The file opac-memberentry.tt exposes template directives to translation where
translators should not be confronted with.

Example from po file:
"%s [%% UNLESS hidden.defined('B_address') && hidden.defined('B_address2') && "
"hidden.defined('B_city') && hidden.defined('B_state') && hidden."
"defined('B_zipcode') && hidden.defined('B_country') && hidden."
"defined('B_phone') && hidden.defined('B_email') && hidden."
"defined('contactnote') %%] "

To test:
- Apply patch
- Verify that advanced search in OPAC the page 'your personal details'
  behaves as before
- Verify that you can change values and submit an update request
- Create a new translation for a 'language' aa-AA (perl translate create aa-AA)
- Verify that template directives ar no longer exposed in aa-AA-opac-bootstrap.p

NOTE: Followed test plan similar to bug 18776 comment 3.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9ed4bdc87e92506ba4a51f92cc198f3c5ce282eb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18776: Translatability: Get rid of exposed tt directives in opac-advsearch.tt
Marc Véron [Sun, 11 Jun 2017 14:54:28 +0000 (16:54 +0200)]
Bug 18776: Translatability: Get rid of exposed tt directives in opac-advsearch.tt

The file opac-advsearch.tt exposes template directives to translation where translators should not be confronted with.
Example in po file:
"[%% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype')."
"size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and "
"OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) "
"%%] "

To test:
- Apply patch
- Verify that advanced search in OPAC behaves as before
- Create a new translation for a 'language' aa-AA (perl translate create aa-AA)
- Verify that template directives ar no longer exposed in aa-AA-opac-bootstrap.po

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ae684fc9491102ba0b560ca6f414a325e763b31a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18754: [QA Follow-up] Tiny corrections
Marcel de Rooy [Fri, 4 Aug 2017 14:44:51 +0000 (16:44 +0200)]
Bug 18754: [QA Follow-up] Tiny corrections

Converted one INCLUDE directive to PROCESS; we are not changing variables here. (The PROCESS directive is slightly faster than INCLUDE because it avoids the need to localise (i.e. copy) the variable stash before processing the template.)

Removed one vim inserted letter i.

Error in [% IF ( XISBN.publicationyear ) _ ', ' _ XISBN.publicationyear %][% END %] The concatenation became part of the condition.

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 ff591f2c77a2a3c1de4a0e7167ccfeba08c2f128)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18754: Translatability: Get rid of exposed tt directives in opac-detail.tt
Marc Véron [Fri, 9 Jun 2017 13:43:36 +0000 (15:43 +0200)]
Bug 18754: Translatability: Get rid of exposed tt directives in opac-detail.tt

The file opac-detail.tt exposes a lot of template directives to translation where translators should not be confronted with.

Some examples from po file are:

$[% SUBFIELD.code %] [% SUBFIELD.value %]

%s [%% INCLUDE \"openlibrary-readapi.inc\" bib = { normalized_isbn => "
"normalized_isbn, lccn => lccn, normalized_oclc => normalized_oclc } %%]

See: [% IF ( nextTitle ) %][% nextTitle |html %][% ELSE %]next biblio[% END "
"%]

To test:
- Apply patch
- Do a search in OPAC that has more than 1 results
- Go to the detail page of one of the items found
- Verify that the details display as before and that you can
  browse the results with Previous and Next
- In staff client, change OPACXSLTDetailsDisplay from 'default' to
  empty for "no xslt" and repeat steps above
- In staff client, set HTML5MediaEnabled to 'OPAC' or 'OPAC and staff client'
- Verify that media catalogued in field 856 still work
- Create a new translation for a 'language' aa-AA (perl translate create aa-AA)
- Verify that template directives ar no longer exposed in aa-AA-opac-bootstrap.po

Followed test plan which works as intended

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
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 752aef4593f1aa2d64700bf9738e7e03907eb1cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18687: Translatability: abbr tag should not contain lang attribute
Marc Véron [Sun, 28 May 2017 07:34:21 +0000 (09:34 +0200)]
Bug 18687: Translatability: abbr tag should not contain lang attribute

In manage-marc-import.tt, we have an abbreviation:

<abbr title="Differences between the original biblio and the imported" lang="en">Diff</abbr>

In translations (e.g. German), the line appears as follows:
<abbr title="Unterschiede zwischen Originaltitelsatz und importiertem Titelsatz" lang="en">Diff</abbr>

The lang attribute is wrong here, it is still "en".
The text language is the same as defined at the top of the page - or with other
words, the lang tag is superfluous.

This patch removes it.

To test:
Verify that code change makes sense.

Passes QA test and the change is logical
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 03c7f9366c97d6402e1e16182d7a2ddbbe37eccb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19088: plugins-upload causes error log noise
Lee Jamison [Fri, 11 Aug 2017 18:58:53 +0000 (18:58 +0000)]
Bug 19088: plugins-upload causes error log noise

After uploading a plugin the error log indicates
use of uninitialized value in $op. This patch
silences the noise.

To test:
1) Set <enable_plugins> to 1 (one) in koha-conf.xml.
2) Set the UseKohaPlugins system preference to 'Enable'.
3) Navigate to Administration -> Manage plugins.
4) Install the test plugin KPZ file attached to this bug.
5) Notice the uninitialized value noise in the error log.
6) Uninstall the plugin (plack restart may be required if plack is
    enabled).
7) Apply patch.
8) Install the plugin again.
9) Notice no noise in the error log.
10) Run qa tools.
11) Run prove t/db_dependent/Plugins.t

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1076a0edf32b621da54c53ea71595885f7e14c38)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18537 - Update Ukrainian installer sample files for 17.05
Serhij Dubyk {Сергій Дубик} [Wed, 23 Aug 2017 14:15:17 +0000 (17:15 +0300)]
Bug 18537 - Update Ukrainian installer sample files for 17.05

Update and translate sample SQL files of the Ukrainian installer.

To test:
- Start with an empty database
- Install uk-UA
- Run the web installer in uk-UA/Ukrainian
- Verify all files load without any problems.

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 ce2561441c3c6e5bdc5ee7011d250c24a2d49105)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19118 - Due to wrong variable name passed vendor name is not coming in browser...
Amit Gupta [Tue, 15 Aug 2017 16:51:37 +0000 (22:21 +0530)]
Bug 19118 - Due to wrong variable name passed vendor name is not coming in browser title bar

Test

1. Hit the page /cgi-bin/koha/acqui/supplier.pl?booksellerid=xx
   xx is a booksellerid
2. Apply the patch and reload the page.
3. You can see vendor name in browser title bar.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ea886885d0efa0200cfa166453a4495692afc4d4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19126: Fix Members.t with IndependentBranches set
Marcel de Rooy [Wed, 16 Aug 2017 11:15:19 +0000 (13:15 +0200)]
Bug 19126: Fix Members.t with IndependentBranches set

If you enabled that pref, Members.t fails with:
t/db_dependent/Members.t .. 63/63 # Looks like you failed 15 tests of 63.

The first one is:
t/db_dependent/Members.t .. 32/63
   Failed test 'Staff patron not deleted from list'
   at t/db_dependent/Members.t line 304.

Bottle neck is GetBorrowersToExpunge. The results of that sub depend on the
state of this preference.
Trivially fixing it here by disabling the pref before the first call.

Test plan:
[1] Do not apply this patch yet. Enable IndependentBranches.
[2] Run Members.t and observe that it fails.
[3] Apply this patch. And run Members.t again. It should pass now.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 44a8fc5b9363eb27223f32e1150fb8fff6f55d08)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19130: (followup) Controller scripts should preserve behaviour
Tomas Cohen Arazi [Tue, 22 Aug 2017 16:11:56 +0000 (13:11 -0300)]
Bug 19130: (followup) Controller scripts should preserve behaviour

This patch is a followup to making
Koha::Acquisition::Booksellers->search work as any other Koha::Objects
(DBIC) query instead of having a different behaviour hardcoded.

To achieve it, this patch makes the controller scripts add
wildcard/truncation chars as prefix and sufix for searches, and make the
default sorting for results be by 'name', ascending.

To test:
- Just verify the behaviour remains unchanged by this patchset on the
controller scripts (re. searching).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b5d6a1885ed4dcb650e7f9f23733b4ff9ad2b37b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19130: (followup) Add POD
Tomas Cohen Arazi [Tue, 22 Aug 2017 15:13:19 +0000 (12:13 -0300)]
Bug 19130: (followup) Add POD

This patch adds POD to the following files:

- Koha/Acquisition/Bookseller.pm
- Koha/Acquisition/Booksellers.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bf630b19745df8caea47669a9a76de26eddbfeee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19130: (followup) Add t/db_dependent/Koha/Acquisition/Booksellers.t
Tomas Cohen Arazi [Tue, 22 Aug 2017 15:03:37 +0000 (12:03 -0300)]
Bug 19130: (followup) Add t/db_dependent/Koha/Acquisition/Booksellers.t

This followup patch adds a proper file in which add tests for
Koha::Acquisition::Bookseller(s) methods.

All current methods are covered.

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/Koha/Acquisition/Booksellers.t
 => SUCCESS: Test pass!
 - Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3481b7b9dac8935befe631131570591ec2c84cce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19130: Remove ->search() overloading and adjust tests
Tomas Cohen Arazi [Tue, 22 Aug 2017 15:01:24 +0000 (12:01 -0300)]
Bug 19130: Remove ->search() overloading and adjust tests

This patch removes the custom ->search() function. Tests are adjusted
so the results from ->search() calls are not expected to return in the
previously hardcoded order.

To test:
- Apply this patch
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/Bookseller.t
=> SUCCESS: Tests pass
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7e4ce56b27025b05ee572100529eaa4f28e0933c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19134: C4::SMS falils on long driver name
Magnus Enger [Thu, 17 Aug 2017 20:48:07 +0000 (22:48 +0200)]
Bug 19134: C4::SMS falils on long driver name

Code in C4::SMS takes the part of the SMS::Send-driver that comes after
SMS::Send and tries to turn it into part of a path to a YAML file
that can contain additional parameters to SMS::Send. The current
code works for e.g. SMS::Send::A::B, but if there is one or more
extra names, it fails to turn :: into /. So we have:
SMS::Send::A::B    -> SMS/Send/A/B
SMS::Send::A::B::C -> SMS/Send/A/B::C
This patch makes sure all occurrences of :: are turned into /, by
adding a "g" modifier at the end of the regex.

Testing:
Testing this preperly would take a whole lot of setup for a very
small change. I would suggest that the following two oneliners
are enough to demonstrate that the change makes sense:
$ perl -e '$x = "a::b::c"; $x =~ s|::|/|; print $x, "\n";'
$ perl -e '$x = "a::b::c"; $x =~ s|::|/|g; print $x, "\n";'

So:
- Check that the output of these oneliners make sense
- Check that the patch changes the code in a similar way to the
  change from the first oneliner to the second.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
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 a4237785d9a2bf2bbf4cf988bc98ac4935842e91)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18817: Update links manually
Jonathan Druart [Mon, 14 Aug 2017 19:19:15 +0000 (16:19 -0300)]
Bug 18817: Update links manually

Without the anchor it is not possible to retrieve the html page, so
these occurrences have been updated manually (and yes it was painful)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 b08913370f77fcc1c574d9c0264f0523b6e2a53b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18817: Update links with anchor automatically
Jonathan Druart [Mon, 14 Aug 2017 18:38:05 +0000 (15:38 -0300)]
Bug 18817: Update links with anchor automatically

I generate a mapping files (old anchor > new anchor) from the doc files.
Here are the links that have been updated automatically

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 674c32a094f0545f54d1d0240a642cc1d5587bc6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18817 Correct Manual URL
Joy Nelson [Mon, 19 Jun 2017 14:45:16 +0000 (07:45 -0700)]
Bug 18817 Correct Manual URL

Corrected the manual url in the help screen for 17.05 onward.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 0250fb7b7681aa72ed3d5607c0c896cd5fd6659e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 9409: (QA followup) Add --dbhost help to koha-create man page
Tomas Cohen Arazi [Fri, 11 Aug 2017 18:09:00 +0000 (15:09 -0300)]
Bug 9409: (QA followup) Add --dbhost help to koha-create man page

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7efb871fa31869044045ccef0b37be438ba704ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 9409: Add --dbhost parameter and dbhost field
Mark Tompsett [Fri, 23 Jun 2017 01:46:50 +0000 (01:46 +0000)]
Bug 9409: Add --dbhost parameter and dbhost field

This allows setting the remote db host correctly for
request-db either with a command-line or passwd file.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e4573d709936bbd7f454a26f073e2131aa9c8df3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18469: QA Follow-up
Nick Clemens [Fri, 7 Jul 2017 11:25:24 +0000 (11:25 +0000)]
Bug 18469: QA Follow-up

Restore datepicker class
Use Koha.Preference
Copy changes to moremember

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 a66c0b1dd76a2fe08ed7ac189ad8a564372ab3a9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18469: Suspend all holds when specifying a date to resume hold does not keep...
Nick Clemens [Fri, 21 Apr 2017 14:08:27 +0000 (10:08 -0400)]
Bug 18469: Suspend all holds when specifying a date to resume hold does not keep date

Name of field had 'datepicker' embedded, this caused variable issue

To test:
 1 - Place several holds for a patron
 2 - Go to holds tab in circulation
 3 - Select a date for suspend all holds until
 4 - Suspend all holds
 5 - Note date is not used, suspended indefinitely
 6 - Apply patch
 7 - Resume all suspended holds
 8 - Select a date for suspend all holds until
 9 - Suspend all holds
10 - Note date is used

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 a58745d9dbbf98c79f4c1a3e7cd40fb45425fc91)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18292: Tests do not need to return 1 - xt
Jonathan Druart [Wed, 9 Aug 2017 16:01:37 +0000 (13:01 -0300)]
Bug 18292: Tests do not need to return 1 - xt

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>
(cherry picked from commit e03f590fa1080b1c3fbe25c91af08094620609d6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18292: Remove return 1 statements in tests
Jonathan Druart [Fri, 9 Jun 2017 11:59:41 +0000 (08:59 -0300)]
Bug 18292: Remove return 1 statements in tests

The test files do not need to return 1

Patch generated with:
perl -p -i -e "s/^1;\n//xsm" t/**/*.t

Test plan:
  git grep '^1;$' t/**/*.t
should not return any results

NOTE: does not fix C4/SIP/t, nor xt tests.

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>
(cherry picked from commit b1ba7fac2c246c2dd52aa4d35884a03d542a26f4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18292 - t/db_dependent/Circulation.t doesn't need to return 1;
Olli-Antti Kivilahti [Fri, 17 Mar 2017 07:05:47 +0000 (09:05 +0200)]
Bug 18292 - t/db_dependent/Circulation.t doesn't need to return 1;

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
(cherry picked from commit b57d682edd5040eb342047aefa95b84402f4c3ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19027 - Circulation rules: Better wording for standard rules for all libraries
Marc Véron [Wed, 2 Aug 2017 16:01:06 +0000 (18:01 +0200)]
Bug 19027 - Circulation rules: Better wording for standard rules for all libraries

In Home > Administration > Circulation and fine rules, the standard value for
"Select a library: All libraries" is confusing and leads to support cases.

Change wording to "Standard rules for all libraries".

To test:
- Apply patch
- Go to Home > Administration > Circulation and fine rules
- Verfiy that text in drop down 'Select a library' makes sense.

Followed test plan which works as intended. I agree with the wording it
is significantly clearer than previously
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c140b9129124262db27c9ba17f47134ec3232ada)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18985 - SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not...
Owen Leonard [Tue, 1 Aug 2017 17:07:33 +0000 (17:07 +0000)]
Bug 18985 - SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not chronologically

This patch alters the DataTables configuration of the SQL reports list
so that date columns are identified via class rather than position.

To test, apply the patch and go to Reports -> Use saved.

Test the re-ordering of the creation date, last edit, and last run
columns. Each should sort correctly based on the date.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3304c7c4ca49db1b95aa564b3550bacf260b9b4f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18941 - C4::Budgets GetBudgetByCode should return active budgets over inactive...
Nick Clemens [Fri, 14 Jul 2017 11:25:42 +0000 (11:25 +0000)]
Bug 18941 - C4::Budgets GetBudgetByCode should return active budgets over inactive budgets

To test:
1 - Create an active budget
2 - Create an inactive budget
3 - Ensure they each have a fund with the same code
4 - Set MarcFieldsToOrder to get the budget_code from a marc field
5 - Stage a file using the duplicated code
6 - Add to a basket from the staged file
7 - Add the items
8 - Note funds are encumbered from the inactive budget
9 - Apply patch
10 - Repeat 5-8 with a new basket
11 - Note the active budget is now used

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0e2c823e8806c35673505d0e2a03081cac00190a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18941 - Unit tests
Nick Clemens [Fri, 14 Jul 2017 11:06:16 +0000 (11:06 +0000)]
Bug 18941 - Unit tests

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 22944fb61241239124b4db218d098b8510327276)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 13012: Add more tests
Jonathan Druart [Thu, 10 Aug 2017 18:52:35 +0000 (15:52 -0300)]
Bug 13012: Add more tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 28a979487f3d8c4a5887c484ae71c7c63e7ee03d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 13012 - suggestion.suggesteddate should be set to NOW if not defined
Kyle M Hall [Wed, 19 Jul 2017 18:57:26 +0000 (14:57 -0400)]
Bug 13012 - suggestion.suggesteddate should be set to NOW if not defined

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Suggestions.t

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b2a8e726fe32d4aae3f279f4142af240c60d7fe5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19071: Fix Members/IssueSlip.t
Marcel de Rooy [Thu, 10 Aug 2017 07:24:08 +0000 (09:24 +0200)]
Bug 19071: Fix Members/IssueSlip.t

Resolve:
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_master`.`clubs`, CONSTRAINT `clubs_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)) [for Statement "DELETE FROM branches"] at t/db_dependent/Members/IssueSlip.t line 44.

We do not need to delete all branches here.

Note: The test still needs attention for noisy userenv warns, but it should
pass now.

Test plan:
Run t/db_dependent/Members/IssueSlip.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8651016ce8e959b5b6ca19ccddbb3f5342b5d456)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19071: Fix Circulation/issue.t
Marcel de Rooy [Thu, 10 Aug 2017 07:13:44 +0000 (09:13 +0200)]
Bug 19071: Fix Circulation/issue.t

Resolve:
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_master`.`clubs`, CONSTRAINT `clubs_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)) [for Statement "DELETE FROM branches"] at t/db_dependent/Circulation/issue.t line 65.

Cause:
See also bug 19070.
We do not need to delete all branches here.

Test plan:
Run t/db_dependent/Circulation/issue.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b80704aa1b763c7a29c3b95c162dfb12ded8faa2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19070: Fix Circulation/Branch.t
Marcel de Rooy [Thu, 10 Aug 2017 07:04:16 +0000 (09:04 +0200)]
Bug 19070: Fix Circulation/Branch.t

Resolve:
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails (`koha_master`.`clubs`, CONSTRAINT `clubs_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)) [for Statement "DELETE FROM branches"] at t/db_dependent/Circulation/Branch.t line 49.

Resolve:
not ok 14 - AddReturn respects branch item return policy - noreturn
   Failed test 'AddReturn respects branch item return policy - noreturn'
   at t/db_dependent/Circulation/Branch.t line 279.
          got: 'yqiKrIkX'
     expected: undef

Cause:
There is a record in clubs. The constraint in clubs on branchcode does not
include a cascaded delete. The test deletes all branches.
Test 14 depends on item-level_itypes==1. When you set it to Biblio, it fails.

Test plan:
Run t/db_dependent/Circulation/Branch.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d2cceb95b47983b28242819c95e57439958b0da5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19047: Fix AddBiblio call in ShelfBrowser.t
Jonathan Druart [Thu, 10 Aug 2017 18:06:39 +0000 (15:06 -0300)]
Bug 19047: Fix AddBiblio call in ShelfBrowser.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b4ce1feb1bc6b4f20cf71bd545e018917cf518db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19047: Fix AddBiblio call in Reserves.t
Marcel de Rooy [Mon, 7 Aug 2017 06:44:43 +0000 (08:44 +0200)]
Bug 19047: Fix AddBiblio call in Reserves.t

AddBiblio does not return a title; the biblioitemnumber is stored in the
title variable.
The variables for biblioitemnumber are not used and can be removed.

Test plan:
Run t/db_dependent/Reserves.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c6f8cf69d3943599fa6a0c250ae0e8221ead44ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19042: Add mock IndependentBranches=0 for the other test
Jonathan Druart [Thu, 10 Aug 2017 18:02:23 +0000 (15:02 -0300)]
Bug 19042: Add mock IndependentBranches=0 for the other test

These tests do not cover correctly getletter, but it is not the goal of
this patch. Superlibrarian behaviour must be tested as well.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e3dafbfccd06af8fca45fada449e93e3d0616cd6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19042: Silence warnings t/db_dependent/Letters.t
Mark Tompsett [Fri, 4 Aug 2017 18:24:38 +0000 (14:24 -0400)]
Bug 19042: Silence warnings t/db_dependent/Letters.t

TEST PLAN
---------
prove t/db_dependent/Letters.t
-- there will be a message: "C4::Context->userenv not defined!"
apply this patch
prove t/db_dependent/Letters.t
-- there will no longer be that message.
run qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d01ce104a7711814152e4f8228064f79c8a7f68c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 5471: Use uri_escape_utf8 to handle utf8 chars correctly
Jonathan Druart [Thu, 10 Aug 2017 16:15:27 +0000 (13:15 -0300)]
Bug 5471: Use uri_escape_utf8 to handle utf8 chars correctly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 04966a6203646cae79a48a00ef0873c1f6c64b06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 5471 - Quotes in tags fail
Owen Leonard [Fri, 9 Jun 2017 12:29:58 +0000 (12:29 +0000)]
Bug 5471 - Quotes in tags fail

This patch makes changes to the tag moderation template and JavaScript
to fix handling of tags with double or single quotes. This patch also
moves the tags moderation JavaScript out of the template and into a
separate JS file.

To test you should have multiple tags awaiting moderation, including
tags which contain double and single quotes.

- Go to Tools -> Tags.
- In the list of tags pending approval, test approving and rejecting
  tags, including those containing single or double quotes.
  - The state of the "Approve" or "Reject" buttons should correctly
    change according to the action you chose.
  - The label in the status column should update correctly.
- In the "Check lists" form, submitting approved, rejected, and
  unclassified terms should result in the correct message.

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works correctly based on test plan. Tested using single- and
double-quoted tags. Passes QA Tools.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ee6f8e186bc93df9d7943ea38f05615b2e8a813f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19003: Add a TestBuilder default for borrowers.login_attempts
Marcel de Rooy [Sat, 29 Jul 2017 15:06:52 +0000 (17:06 +0200)]
Bug 19003: Add a TestBuilder default for borrowers.login_attempts

Bug 18314 causes t/db/SIP/Message.t to fail (quite often) since
TestBuilder fills login_attempts with a random number. (Note: Only
when FailedLoginAttempts is non-zero.)
Trivial fix: TestBuilder should have a zero default for login_attempts.

Test plan:
Do not yet apply this patch.
Set pref FailedLoginAttempts to say 3.
Run t/db_dependent/SIP/Message.t. Might fail on the password test (CQ).
Apply this patch.
Run t/db_dependent/SIP/Message.t again. Does not fail anymore.

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>
(cherry picked from commit 5bb56bf336187cde38e1a3b89c792ee6dc231acf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 17699: Reset time simulation
Jonathan Druart [Tue, 1 Aug 2017 14:44:29 +0000 (11:44 -0300)]
Bug 17699: Reset time simulation

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 0853c4e2b4366a235077a24a873fc81a754afecb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 17699: Add test descriptions
Jonathan Druart [Mon, 31 Jul 2017 14:30:00 +0000 (11:30 -0300)]
Bug 17699: Add test descriptions

Test plan:
  prove -v t/db_dependent/Koha/Patrons.t

 Subtest: renew_account
    1..30
    ok 1 - 2016-02-29T00:00:00 + 12 months must be 2017-02-28T00:00:00
    ok 2 - 2016-02-29T00:00:00 + 12 months must be 2017-02-28T00:00:00
    ok 3 - With BorrowerLogs, Koha::Patron->renew_account should have logged
    ok 4 - today + 12 months must be 2017-03-31T00:00:00
    ok 5 - today + 12 months must be 2017-03-31T00:00:00
    ok 6 - Without BorrowerLogs, Koha::Patron->renew_account should not have logged
    ok 7 - today + 12 months must be 2017-03-31T00:00:00
    ok 8 - today + 12 months must be 2017-03-31T00:00:00
    ok 9 - 2016-04-30T00:00:00 + 12 months must be 2017-04-30T00:00:00
    ok 10 - 2016-04-30T00:00:00 + 12 months must be 2017-04-30T00:00:00
    ok 11 - 2016-10-30T00:00:00 + 12 months must be 2017-10-30T00:00:00
    ok 12 - 2016-10-30T00:00:00 + 12 months must be 2017-10-30T00:00:00
    ok 13 - With BorrowerLogs, Koha::Patron->renew_account should have logged
    ok 14 - today + 12 months must be 2017-11-30T00:00:00
    ok 15 - today + 12 months must be 2017-11-30T00:00:00
    ok 16 - Without BorrowerLogs, Koha::Patron->renew_account should not have logged
    ok 17 - today + 12 months must be 2017-11-30T00:00:00
    ok 18 - today + 12 months must be 2017-11-30T00:00:00
    ok 19 - 2016-12-30T00:00:00 + 12 months must be 2017-12-30T00:00:00
    ok 20 - 2016-12-30T00:00:00 + 12 months must be 2017-12-30T00:00:00
    ok 21 - 2017-06-30T00:00:00 + 12 months must be 2018-06-30T00:00:00
    ok 22 - 2017-06-30T00:00:00 + 12 months must be 2018-06-30T00:00:00
    ok 23 - With BorrowerLogs, Koha::Patron->renew_account should have logged
    ok 24 - today + 12 months must be 2018-07-31T00:00:00
    ok 25 - today + 12 months must be 2018-07-31T00:00:00
    ok 26 - Without BorrowerLogs, Koha::Patron->renew_account should not have logged
    ok 27 - today + 12 months must be 2018-07-31T00:00:00
    ok 28 - today + 12 months must be 2018-07-31T00:00:00
    ok 29 - 2017-08-31T00:00:00 + 12 months must be 2018-08-31T00:00:00
    ok 30 - 2017-08-31T00:00:00 + 12 months must be 2018-08-31T00:00:00

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 ec9b691de934f82c50057c15fb7d3a1b32717b72)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 17699: Use limit as end_of_month
Jonathan Druart [Mon, 31 Jul 2017 14:03:37 +0000 (11:03 -0300)]
Bug 17699: Use limit as end_of_month

From DateTime::Duration pod:
""
For positive durations, the "end_of_month" parameter defaults to wrap.
For negative durations, the default is "limit". This should match how
most people "intuitively" expect datetime math to work.
""""

We need end_of_month => limit for  positive durations as well.

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 24b4006ecbc0a258b09500bdd8f639c7018067c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 17699: Add more tests to highlight the problem
Jonathan Druart [Mon, 31 Jul 2017 14:02:42 +0000 (11:02 -0300)]
Bug 17699: Add more tests to highlight the problem

Add problematic cases to highlight the problem.

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 9512b015662f8ec56d8b8884b4e4bb14d5e563f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19009: Fix random failures from Circulation.t
Jonathan Druart [Mon, 31 Jul 2017 14:18:23 +0000 (11:18 -0300)]
Bug 19009: Fix random failures from Circulation.t

From jenkins output:
 Subtest: CanBookBeIssued + Koha::Patron->is_debarred<7c>has_overdues
1..8
not ok 1
[SKIP]

I executed it several times and display the different $error, $alerts and question keys.
GNA and RESTRICTED were sometimes set, which block the issue.
Reading the code it seems that some patron's attributes must be removed to avoid the checkin rejection.

Test plan:
Execute the tests several times and notice that it fails randomly
With this patch they should always pass.

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 4bbec5c382590f881e6d2af62b2608fe9cf9e051)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 18802: Fix Circulation.t if finesMode ne 'production'
Jonathan Druart [Wed, 14 Jun 2017 14:32:30 +0000 (11:32 -0300)]
Bug 18802: Fix Circulation.t if finesMode ne 'production'

If finesMode is not set to production, only 1 fine will be created (the renewal
one will not). This is what assumes the tests.
If set to 'production', the tests will fail because the fines will not
be deleted (because of the DBIx::Class) warning.
Now we mock the value before charging.

prove t/db_dependent/Circulation.t
t/db_dependent/Circulation.t .. 16/95 DBIx::Class::Storage::DBI::select_single(): Query returned more than one row.  SQL that returns multiple rows is DEPRECATED for ->find and ->single at t/db_dependent/Circulation.t line 491
t/db_dependent/Circulation.t .. 56/95
    #   Failed test 'Can auto renew, OPACFineNoRenewals=10, patron has 10'
    #   at t/db_dependent/Circulation.t line 670.
    #          got: 'auto_too_much_oweing'
    #     expected: 'auto_renew'
    # Looks like you failed 1 test of 6.

Test plan:
  prove t/db_dependent/Circulation.t
should return green whatever the value of finesMode

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 ae5f5c479929cbfad3193c6ce9471a406a2a41f3)

7 years agoBug 19013: (QA followup) Set guarantorid to NULL patron sample data
Tomas Cohen Arazi [Mon, 7 Aug 2017 14:04:51 +0000 (11:04 -0300)]
Bug 19013: (QA followup) Set guarantorid to NULL patron sample data

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0bcf6a79427297c332588317dde749e923c7bbdc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19013: Fix borrowers.guarantorid in sammple_patrons.sql
Jonathan Druart [Mon, 31 Jul 2017 19:12:16 +0000 (16:12 -0300)]
Bug 19013: Fix borrowers.guarantorid in sammple_patrons.sql

That breaks randomly tests on Jenkins (Koha/Patrons.t)

It certainly affects data in other languages but I did not find a quick
and easy way to modify this file (replace all guarantorid values with
NULL)

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b7d291a1ee692d6de71503683a3e61c9311c33d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoIncrement version for 17.05.04 release v17.05.04
Fridolin Somers [Wed, 20 Sep 2017 13:58:03 +0000 (15:58 +0200)]
Increment version for 17.05.04 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoMerge remote-tracking branch 'translate/17.05.04-translate-20170920' into rm_170504
Fridolin Somers [Wed, 20 Sep 2017 14:04:42 +0000 (16:04 +0200)]
Merge remote-tracking branch 'translate/17.05.04-translate-20170920' into rm_170504

7 years agoTranslation updates for Koha 17.05.04
root [Wed, 20 Sep 2017 14:00:06 +0000 (11:00 -0300)]
Translation updates for Koha 17.05.04

7 years agoUpdate release notes for 17.05.04 release
Koha User [Wed, 20 Sep 2017 13:55:56 +0000 (15:55 +0200)]
Update release notes for 17.05.04 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19235: Password entry visible in OPAC Self-registration
Mark Tompsett [Fri, 1 Sep 2017 17:16:43 +0000 (13:16 -0400)]
Bug 19235: Password entry visible in OPAC Self-registration

The HTML code was "text" instead of "password".

TEST PLAN
----------
1) 'Allow' PatronSelfRegistration system preference
2) Define the PatronSelfRegistrationDefaultCategory system preference (e.g. PT)
3) Open OPAC
4) Click 'Register here' on the right.  (/cgi-bin/koha/opac-memberentry.pl)
5) Scroll to bottom
6) enter some passwords
   -- visible
7) apply this patch
8) refresh page
9) repeat 5-6 as needed
   -- passwords should not be visible while entering
10) run koha qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 99e691feee5ef29bbc9d24a916fc4aa2fab6bba6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 15438: [QA Follow-up] Moving POD statement for CanBookBeIssued
Marcel de Rooy [Fri, 8 Sep 2017 08:14:10 +0000 (10:14 +0200)]
Bug 15438: [QA Follow-up] Moving POD statement for CanBookBeIssued

The statement for head3 NB ('nota bene'?) looks like a hash key
in the list of possible return values for $needsconfirmation.
Moved it up and prefixed it with IMPORTANT.

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 133e25c56ac79e0b88b89e3b749df338e63a93d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 15438 - Checking out an on-hold item sends holder's borrowernumber in AF (screen...
Colin Campbell [Wed, 24 Aug 2016 12:52:52 +0000 (13:52 +0100)]
Bug 15438 - Checking out an on-hold item sends holder's borrowernumber in AF (screen message) field.

The returns from C4::Circulation::CanBookBeIssued used
to be structured as a hashref of entries like
   REASON => {
       data => 'foo',
       moredata => 'bar',
   };
Some entries still are. But many are now
   REASON => 1,
   data   => 'foo',
   moredata => 'bar',

The sip Checkout routine still assumed the former, as it
reports any causes it was not aware of (to maintain support for
a changing api) The data fields could leak into the screen message
field of the response. e.g. the borrowernumber or surname of the
borrower who has a hold on an issued title. Some real messages were
getting obscured by this

This patch sanatizes the return from from CanBookBeIssued
by removing keys which are not all uppercase
It also fixes a case where the key's data element was used
for the screen message when we should use the key itself

Updated the documentation of CanBookBeIssued to flag up
the assumption re case and the fact that 3 elements rather
than two may be returned

The loop through the returned keys was a bit bogus
so we now explicitly jump out if noerror is unset

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested quite extensively. Test results put on Bugzilla.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4d223bdc6156fab0667867f3990854fddfab5684)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19332 - Basket grouping PDF and CSV exports empty
Dobrica Pavlinusic [Mon, 18 Sep 2017 15:37:21 +0000 (17:37 +0200)]
Bug 19332 - Basket grouping PDF and CSV exports empty

This bug was introduced in commit 2bf3ce268de6bc8b2386cfb5d768f60b05d75f44
Bug 17196: [QA Follow-up] Additional fix on acqui/basketgroup

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
7 years agoBug 19127: (follow-up) Stored XSS in csv-profiles.pl
Jonathan Druart [Tue, 12 Sep 2017 14:21:27 +0000 (11:21 -0300)]
Bug 19127: (follow-up) Stored XSS in csv-profiles.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 52b41dfdf0ec03c24dd970b80e4f153f64702e30)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>