]> git.koha-community.org Git - koha.git/log
koha.git
7 years agoBug 17644 - t/db_dependent/Exporter/Record.t fails
Kyle M Hall [Wed, 16 Nov 2016 12:40:31 +0000 (12:40 +0000)]
Bug 17644 - t/db_dependent/Exporter/Record.t fails

Test Plan:
1) prove t/db_dependent/Exporter/Record.t fails
2) Apply this patch
3) prove t/db_dependent/Exporter/Record.t succeeds!

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml
Tomas Cohen Arazi [Wed, 16 Nov 2016 14:40:21 +0000 (11:40 -0300)]
Bug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml

This patch makes the tests clean the 'config' namespace for cache before
it runs any tests.

To test:
- Run:
  $ prove t/db_dependent/Search.t
=> FAIL: Self explanatory
- Apply the patch
- Run:
  $ prove t/db_dependent/Search.t
=> SUCCESS: All green
- Sign off :-D

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All test pass successfuly

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Cannot reproduce, but I trust everyone telling me it's failing ; )
No regressions spotted

7 years agoBug 17640: (Jonathan complain followup) Use Koha::*->search->delete instead
Tomas Cohen Arazi [Wed, 16 Nov 2016 16:15:52 +0000 (13:15 -0300)]
Bug 17640: (Jonathan complain followup) Use Koha::*->search->delete instead

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17633: (QA followup) remove debugging leftover
Tomas Cohen Arazi [Wed, 16 Nov 2016 15:58:23 +0000 (12:58 -0300)]
Bug 17633: (QA followup) remove debugging leftover

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17640 [QA Followup] - Remove any outstanding issues before removing patrons
Kyle M Hall [Wed, 16 Nov 2016 15:52:17 +0000 (15:52 +0000)]
Bug 17640 [QA Followup] - Remove any outstanding issues before removing patrons

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17640: (QA followup) Add more tests
Tomas Cohen Arazi [Wed, 16 Nov 2016 15:48:11 +0000 (12:48 -0300)]
Bug 17640: (QA followup) Add more tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17640: Fix t/db_dependent/Template/Plugin/Categories.t
Jonathan Druart [Wed, 16 Nov 2016 09:41:26 +0000 (09:41 +0000)]
Bug 17640: Fix t/db_dependent/Template/Plugin/Categories.t

These tests fail since commit 6ee8dd3a597d08ccc5122473e55790d3f21d5163
    Bug 15407: Koha::Patron::Categories - replace C4::Category->all

Indeed the patron categories plugin now returns a
Koha::Patron::Categories object and does not set a 'selected' flag.
We do not need this flag (`git grep Categories.all **/*.tt` to trust me)

Note that this patch also add a patron category to make the test passes
even if no category exist.

Test plan:
  prove t/db_dependent/Template/Plugin/Categories.t
should return green

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17633: (QA followup) Remove unneeded warnings
Tomas Cohen Arazi [Tue, 15 Nov 2016 17:08:15 +0000 (14:08 -0300)]
Bug 17633: (QA followup) Remove unneeded warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17633: Do not call set_preference from tests
Jonathan Druart [Tue, 15 Nov 2016 16:07:35 +0000 (16:07 +0000)]
Bug 17633: Do not call set_preference from tests

If memcached is running, the pref's value will be set in cache, what we
do not want.

t/db_dependent/Context.t and t/db_dependent/sysprefs.t are exceptions
for obvious reasons.

Test plan:
Make sure all these tests still pass

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17641: Fix t/Biblio/Isbd.t
Jonathan Druart [Wed, 16 Nov 2016 09:49:20 +0000 (09:49 +0000)]
Bug 17641: Fix t/Biblio/Isbd.t

On commit cadf5aea814636ccccd85fcc38aa30f751d779c0
    Bug 11592: MARCView and ISBD followup
The prototype of C4::Biblio::GetISBDView has been changed to take a
hashref in parameter.
But the tests have not been updated

Test plan:
  prove t/Biblio/Isbd.t
should return green

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
https://bugs.koha-community.org/show_bug.cgi?id=17637
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17637: Fix tests Auth_with_ldap.t
Jonathan Druart [Wed, 16 Nov 2016 07:44:03 +0000 (07:44 +0000)]
Bug 17637: Fix tests Auth_with_ldap.t

Koha::Patron->delete create a transaction and so we need to use
txn_begin to have nested txn

DBD::mysql::db begin_work failed: Already in a transaction

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17634: Fix circ dependency with require instead of use
Jonathan Druart [Wed, 16 Nov 2016 07:29:45 +0000 (07:29 +0000)]
Bug 17634: Fix circ dependency with require instead of use

This is definitely wrong but we won't have time to fix it correctly
before the release.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoRevert "Bug 17634: Unit test t/db_dependent/ArticleRequests.t is failing"
Jonathan Druart [Wed, 16 Nov 2016 07:23:19 +0000 (07:23 +0000)]
Revert "Bug 17634: Unit test t/db_dependent/ArticleRequests.t is failing"

This reverts commit 75f75101585d795ab6b0e4e40f585b21e0f841cb.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17635: Fix templates with missing body id
Tomas Cohen Arazi [Tue, 15 Nov 2016 18:07:14 +0000 (15:07 -0300)]
Bug 17635: Fix templates with missing body id

The following template files are missing body id and class and should be fixed:

- members/housebound.tt
- reports/cash_register_stats.tt

To test:
- Run:
  $ sudo koha-shell kohadev ; cd kohaclone
 k$ prove xt/tt_valid.t
=> FAIL: Tests fail due to the mentioned templates
- Apply this patch
- Run:
  $ sudo koha-shell kohadev ; cd kohaclone
 k$ prove xt/tt_valid.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17634: Unit test t/db_dependent/ArticleRequests.t is failing
Kyle M Hall [Tue, 15 Nov 2016 17:37:24 +0000 (17:37 +0000)]
Bug 17634: Unit test t/db_dependent/ArticleRequests.t is failing

Test Plan:
1) prove t/db_dependent/ArticleRequests.t
2) Apply this patch
3) prove t/db_dependent/ArticleRequests.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17599: Make the tests pass
Jonathan Druart [Tue, 15 Nov 2016 15:49:00 +0000 (15:49 +0000)]
Bug 17599: Make the tests pass

If you run TooMany or MultiplePerRecord.t after
t/db_dependent/Circulation/Returns.t (for instance) and that you are
running memcached, item-level_itypes will be 0.
These tests assume that the pref is 1

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17522: Fix opac-user.pl if OpacRenewalAllowed is set
Jonathan Druart [Thu, 10 Nov 2016 08:44:54 +0000 (08:44 +0000)]
Bug 17522: Fix opac-user.pl if OpacRenewalAllowed is set

This patch fixes a bug added by commit 81a04af27804621609004dc370284413baa5caa2
    Bug 14610 - Add and update scripts

If OpacRenewalAllowed is enabled, the following error message is
displayed:

Template process failed: undef error - The method is_expired is not
covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121.

The is_expired and BlockExpiredPatronOpacActions methods did not exist
for the Koha::Patron object. These 2 values were returned by
GetMemberDetails.

To fix this, we need bug 17579 which introduces the
Koha::Patron->is_expired method and also bug 17604 for the
Koha::Patron->effective_BlockExpiredPatronOpacActions.

Test Plan:
1) Check out an item for a patron
2) Enable OpacRenewalAllowed
3) Log in as that patron, go to opac-user.pl
4) Note the error
5) Apply this patch
6) Reload opac-user.pl
7) Page should now load!

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17599: (QA followup) Perltidy really long lines
Tomas Cohen Arazi [Tue, 15 Nov 2016 15:32:53 +0000 (12:32 -0300)]
Bug 17599: (QA followup) Perltidy really long lines

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17599: (QA followup) Remove userenv warning
Tomas Cohen Arazi [Tue, 15 Nov 2016 15:27:33 +0000 (12:27 -0300)]
Bug 17599: (QA followup) Remove userenv warning

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_...
Jonathan Druart [Wed, 9 Nov 2016 16:36:39 +0000 (16:36 +0000)]
Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule

This is a POC, I have not tested it yet.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17579 [QA Followup] - Fix the number of tests
Kyle M Hall [Tue, 15 Nov 2016 15:27:13 +0000 (15:27 +0000)]
Bug 17579 [QA Followup] - Fix the number of tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17579: Make sure we are testing the real life
Jonathan Druart [Wed, 9 Nov 2016 13:23:54 +0000 (13:23 +0000)]
Bug 17579: Make sure we are testing the real life

Without this patch, the tests are not testing the same things as what
happens on the interface.
We need to refresh the object to make sure the date set into dateexpiry
is the one in DB.
Without this patch, ->is_expired test a datetime object, with this patch
it compares with a date oject

Without the changes made in Koha::Patron->is_expired, a patron which has
a dateexpiry set to today was marked as expired on the interface. This
is a change in the behavior, what this refactoring does not want to do.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17579: Add the Koha::Patron->is_expired
Jonathan Druart [Mon, 7 Nov 2016 17:12:58 +0000 (17:12 +0000)]
Bug 17579: Add the Koha::Patron->is_expired

This new method will be handy for further uses

Test plan:
  prove t/db_dependent/Koha/Patrons.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17604: GetMemberDetails - Add Koha::Patron::Category->effective_BlockExpiredPatro...
Jonathan Druart [Mon, 7 Nov 2016 15:47:43 +0000 (15:47 +0000)]
Bug 17604: GetMemberDetails - Add Koha::Patron::Category->effective_BlockExpiredPatronOpacActions

This patch simply adds a new method to retrieve the correct value of
BlockExpiredPatronOpacActions.

Test plan:
  prove t/db_dependent/Koha/Patron/Categories.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17594: Make Koha::Object->discard_changes available
Jonathan Druart [Wed, 9 Nov 2016 13:20:16 +0000 (13:20 +0000)]
Bug 17594: Make Koha::Object->discard_changes available

We need this new method to refresh an object after it has been updated.

Test plan:
  prove t/db_dependent/Koha/Object.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17555: Add Koha::Patron->category
Jonathan Druart [Fri, 4 Nov 2016 15:05:08 +0000 (15:05 +0000)]
Bug 17555: Add Koha::Patron->category

We need to use the DBIx::Class relationship to retrieve the patron
category.
It is more convenient to have a Koha::Patron->category method to
retrieve the category of a given patron.

Test plan:
Make sure that the tests in t/db_dependent/Koha/Patron* return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 16520 - (Follow up) Restore retrieval of syspref_cache
Nick Clemens [Wed, 9 Nov 2016 11:11:08 +0000 (11:11 +0000)]
Bug 16520 - (Follow up) Restore retrieval of syspref_cache

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15690: Hardcoded 16 is uncool
Mark Tompsett [Wed, 14 Sep 2016 19:14:02 +0000 (15:14 -0400)]
Bug 15690: Hardcoded 16 is uncool

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Followed test plan in comment #7, works as expectd.
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 15690: CardnumberLength should not be bigger than 16
Jonathan Druart [Tue, 13 Sep 2016 14:43:50 +0000 (15:43 +0100)]
Bug 15690: CardnumberLength should not be bigger than 16

borrowers.cardnumber is a varchar(16), so CardnumberLength should not
have a max > 16

Test plan:
Test different value in CardnumberLength ("20", "20,30", "40,")
Edit a patron a make sure the text display under the cardnumber input is
correct

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17607: Fix patron definition in Swagger
Tomas Cohen Arazi [Thu, 10 Nov 2016 13:21:52 +0000 (10:21 -0300)]
Bug 17607: Fix patron definition in Swagger

This patch makes the patron swagger definition match the DB schema.
To test:
- Run:
  $ prove t/db_dependent/api/v1/swagger/definitions.t
=> FAIL: 'lastseen' field is not declared in the swagger definition
- Apply the patch
- Run:
  $ prove t/db_dependent/api/v1/swagger/definitions.t
=> SUCCESS: Tests pass!
- Sigh off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All tests pass successfuly

Signed-off-by: Lari Taskula <lari.taskula@jns.fi>
Fixed a typo: seed -> seen

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17582: Fix authority framework edition
Jonathan Druart [Tue, 8 Nov 2016 14:43:46 +0000 (14:43 +0000)]
Bug 17582: Fix authority framework edition

Step to recreate:
Admin>Authority types > Actions > Marc structure

Test plan
Confirm that this patch fixes the issue

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fix the issue, no errors.
Can edit auth marc structure

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17567: Make populate_db.pl initialize ES mappings
Tomas Cohen Arazi [Mon, 7 Nov 2016 14:19:03 +0000 (11:19 -0300)]
Bug 17567: Make populate_db.pl initialize ES mappings

To test:
- Have a clean install, no DB
- Run populate_db.pl:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ misc/devel/populate_db.pl
- Go to
http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
=> FAIL: No mappings
- Delete the DB and create an empty one:
  $ mysql -uroot
  > DROP DATABASE koha_kohadev; CREATE DATABASE koha_kohadev;
  > GRANT ALL PRIVILEGES ON koha_kohadev.* TO
  'koha_kohadev'@'localhost';
- Run populate_db.pl:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ misc/devel/populate_db.pl
- Go to
  http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
=> SUCCESS: There are mappings!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17603: Remove itemtype-related Borrower_Discharge.t warnings
Tomas Cohen Arazi [Wed, 9 Nov 2016 19:45:38 +0000 (16:45 -0300)]
Bug 17603: Remove itemtype-related Borrower_Discharge.t warnings

This patch makes t/db_dependent/Patron/Borrower_Discharge.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Patron/Borrower_Discharge.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Patron/Borrower_Discharge.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17592: Remove itemtype-related maxsuspensiondays.t warnings
Tomas Cohen Arazi [Tue, 8 Nov 2016 19:28:07 +0000 (16:28 -0300)]
Bug 17592: Remove itemtype-related maxsuspensiondays.t warnings

This patch makes t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17587: Remove itemtype-related IsItemIssued.t warnings
Tomas Cohen Arazi [Tue, 8 Nov 2016 15:40:45 +0000 (12:40 -0300)]
Bug 17587: Remove itemtype-related IsItemIssued.t warnings

This patch makes t/db_dependent/Circulation/IsItemIssued.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/IsItemIssued.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/IsItemIssued.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17575: (followup) Remove missing fine type warnings
Tomas Cohen Arazi [Mon, 7 Nov 2016 19:08:02 +0000 (16:08 -0300)]
Bug 17575: (followup) Remove missing fine type warnings

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17575: Remove itemtype-related warnings from Circulation.t
Tomas Cohen Arazi [Mon, 7 Nov 2016 19:00:21 +0000 (16:00 -0300)]
Bug 17575: Remove itemtype-related warnings from Circulation.t

To test:
- Run:
  $ prove t/db_dependent/Circulation.t
=> FAIL: Lots of warnings
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation.t
=> SUCCESS: All green and no itemtype warnings
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17574: Remove itemtype-related warnings from LocalHoldsPriority.t
Tomas Cohen Arazi [Mon, 7 Nov 2016 18:31:53 +0000 (15:31 -0300)]
Bug 17574: Remove itemtype-related warnings from LocalHoldsPriority.t

To test:
- Run:
  $ prove t/db_dependent/Holds/LocalHoldsPriority.t
=> FAIL: Tests raise lots of warnings
- Apply the patch
- Run:
  $ prove t/db_dependent/Holds/LocalHoldsPriority.t
=> SUCCESS: Tests pass, and no warnings!
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17573: Remove itemtype-related warnings from DecreaseLoanHighHolds.t
Tomas Cohen Arazi [Mon, 7 Nov 2016 18:24:34 +0000 (15:24 -0300)]
Bug 17573: Remove itemtype-related warnings from DecreaseLoanHighHolds.t

To test:
- Run:
  $ prove t/db_dependent/DecreaseLoanHighHolds.t
=> FAIL: Lots of warnings
- Apply the patch
- Run:
  $ prove t/db_dependent/DecreaseLoanHighHolds.t
=> SUCCESS: All green and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17572: [QA Follow-up] Cosmetic changes
Marcel de Rooy [Fri, 11 Nov 2016 08:27:12 +0000 (09:27 +0100)]
Bug 17572: [QA Follow-up] Cosmetic changes

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17572: (followup) Remove test's hardcoded values
Tomas Cohen Arazi [Mon, 7 Nov 2016 18:09:24 +0000 (15:09 -0300)]
Bug 17572: (followup) Remove test's hardcoded values

This patch makes the tests use t::lib::TestBuilder instead of
hardcoding values.

Test plan:
- Run:
  $ prove t/db_dependent/Circulation/issue.t
=> SUCCESS: All tests return green with and without the patch
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17572: Remove itemtype-related warnings from issue.t
Tomas Cohen Arazi [Mon, 7 Nov 2016 17:55:41 +0000 (14:55 -0300)]
Bug 17572: Remove itemtype-related warnings from issue.t

This patch makes t/db_dependent/Circulation/issue.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/issue.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/issue.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17558: QA followup - use TestBuilder for creating patron
Josef Moravec [Fri, 11 Nov 2016 11:23:40 +0000 (11:23 +0000)]
Bug 17558: QA followup - use TestBuilder for creating patron

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17558: Add more tests
Josef Moravec [Tue, 25 Oct 2016 21:50:43 +0000 (21:50 +0000)]
Bug 17558: Add more tests

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All tests pass successfuly

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17558: Fix adding manager id to patron messages in store method
Josef Moravec [Tue, 25 Oct 2016 21:52:11 +0000 (21:52 +0000)]
Bug 17558: Fix adding manager id to patron messages in store method

Test plan:

prove t/db_dependent/Koha/Patron/Messages.t

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. Pass OK

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17420 - record export fails when itemtype on biblio - followup
Fridolin Somers [Mon, 7 Nov 2016 15:07:01 +0000 (16:07 +0100)]
Bug 17420 - record export fails when itemtype on biblio - followup

Same as previous patch for misc/export_records.pl.

Test plan :
- Use syspref item-level_itypes = biblio record
- Run misc/export_records.pl
=> Without patch you get an error : DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in 'where clause' ...
=> With patch you get a correct export file

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Export Ok, no errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17420 - record export fails when itemtype on biblio
Fridolin Somers [Mon, 10 Oct 2016 14:46:04 +0000 (16:46 +0200)]
Bug 17420 - record export fails when itemtype on biblio

In Tools, Export data, you can export with a filter on item type.
When item type is on biblio record, you get the error :
export.pl: DBIx::Class::ResultSet::next(): Unknown column 'biblioitems.itemtype' in 'where clause' at /home/koha/src/Koha/Objects.pm line 150

Looks like its because this code use to be a SQL Select and is now a DBIx call :
                          C4::Context->preference('item-level_itypes')
                            ? ( 'items.itype' => $itemtype )
                            : ( 'me.itemtype' => $itemtype )

This patch corrects by using "me.itemtype"

Test plan :
- Use syspref item-level_itypes = biblio record
- Go to Tools > Export data : /cgi-bin/koha/tools/export.pl
- Select an item type
- Click on "Export biblio records"
=> Without patch you get an error 500
=> With patch you get a correct export file

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fix the issue, no errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17204: Rancor Z39.50 search fails under plack
Nick Clemens [Fri, 26 Aug 2016 15:04:12 +0000 (15:04 +0000)]
Bug 17204: Rancor Z39.50 search fails under plack

MetaSearcher.pm forks children to handle searching each server. When the
process waits for the children it never continues.

The simplest solution here is to exclude the metasearcher service from
running under plack

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17562: Fix Acquisition.t
Jonathan Druart [Mon, 7 Nov 2016 10:25:57 +0000 (10:25 +0000)]
Bug 17562: Fix Acquisition.t

I find these tests too much complicated and decided to remove them.
They depends on the number of fields in the DB and any time we change
this table we need to update the tests.
As I don't understand the tests, I prefer to simply remove them, they
don't seem very useful.
Feel free to provide a counter patch if you think we should keep them.

Test plan:
  prove t/db_dependent/Acquisition.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This tests should be removed as this patch does.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17563: (followup) Silence undef warnings
Tomas Cohen Arazi [Tue, 8 Nov 2016 19:11:49 +0000 (16:11 -0300)]
Bug 17563: (followup) Silence undef warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17563: Fix Acquisition/CancelReceipt.t
Jonathan Druart [Mon, 7 Nov 2016 10:55:06 +0000 (10:55 +0000)]
Bug 17563: Fix Acquisition/CancelReceipt.t

Test plan:
  prove t/db_dependent/Acquisition/CancelReceipt.t
should return green

Confirm that the changes made by
  commit 20d9ed618fbe3cdcb9c04444a1f8a584b0364069
    Bug 13321: Rename variables
was wrong for the budget_id var and that this patch reverts it

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17564: Fix t/db_dependent/Acquisition/OrderUsers.t
Jonathan Druart [Mon, 7 Nov 2016 11:10:04 +0000 (11:10 +0000)]
Bug 17564: Fix t/db_dependent/Acquisition/OrderUsers.t

ModReceiveOrder takes now a 'order' parameter and is mandatory.
This new test file has been added after the first submission of bug
13321 and has not been updated during the rebases.

Test plan:
  prove t/db_dependent/Acquisition/OrderUsers.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17589 - Improper method type in Koha::ItemType(s)
Kyle M Hall [Tue, 8 Nov 2016 17:12:27 +0000 (17:12 +0000)]
Bug 17589 - Improper method type in Koha::ItemType(s)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17394 - exporting checkouts with items selects without items in combo-box
Fridolin Somers [Tue, 4 Oct 2016 10:36:11 +0000 (12:36 +0200)]
Bug 17394 - exporting checkouts with items selects without items in combo-box

In checkouts table, the is an export form (when some exports syspref are enabled).
When selecting some checkouts and selecting "ISO2709 with items" in export format combo-box, clicking on "Export" will select "ISO2709 without items" in the export format combo-box.
This is quite strange.
Its because the form as 2 inputs with same name and id "output_format" : an hidden input (the wanted arg for tools/export.pl) and a select (the export format combo-box).
So an action meant on the hidden input impacts the select.

This patch corrects by changing id and name of the export format combo-box : issues-table-output-format

TEST plan :
- Enable checkouts exports by setting syspref ExportWithCsvProfile with a profile
- Go to circ page of a patron with checkouts : /cgi-bin/koha/circ/circulation.pl?borrowernumber=xxx
- Show checkouts table
- Select some checkboxes in "Export" column
- Select "ISO2709 with items" in export format combo-box
- Click on "Export"
=> Without patch, the export format combo-box changes to "ISO2709 without items"
=> With patch, the export format combo-box does not changes
- Check the export file contains the items
- Check exports "ISO2709 without items" and "CSV" are OK

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17521: Added missing age limit check
radiuscz [Mon, 31 Oct 2016 22:24:42 +0000 (23:24 +0100)]
Bug 17521: Added missing age limit check

Following patron modification partial editor had no age constraint
checking:
/cgi-bin/koha/members/memberentry.pl?op=modify&borrowernumber=3&step=3

Test plan:
1) Apply the patch
2) Open profile of a patron
3) Click Edit under "Library use": http://prntscr.com/d1ghim
4) Change category to an invalid one (eg. Adult instead of Kid)
5) Error saying "Patron's age is incorrect for their category." should
be displayed.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Lucio Moraes <lmoraes@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17552: Continue revert and add tests to highlight the problem
Jonathan Druart [Fri, 4 Nov 2016 13:49:57 +0000 (13:49 +0000)]
Bug 17552: Continue revert and add tests to highlight the problem

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17552: Revert "Bug 17091: Remove explicit declaration of Koha::Objects->reset"
Jonathan Druart [Fri, 4 Nov 2016 13:47:21 +0000 (13:47 +0000)]
Bug 17552: Revert "Bug 17091: Remove explicit declaration of Koha::Objects->reset"

This reverts commit c253af2e519570c4024891dc4d1e81743a2c5fc2.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17535: Fix search for reports by keywords
Jonathan Druart [Wed, 2 Nov 2016 09:36:53 +0000 (09:36 +0000)]
Bug 17535: Fix search for reports by keywords

The commit cf9031711282f4be23e4a639797d0fd178940e1f
    Bug 14435: Add the ability to store result's report
introduced a regression when searching for reports by keywords.
It also breaks tests in t/db_dependent/Reports/Guided.t

It's caused by the missing join on saved_reports.
The error says DBD::mysql::db selectall_arrayref failed: Unknown column
'report' in 'where clause'

Test plan:
Confirm that the tests are fixed and that you are able to search for
reports using the "keyword" input

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17476: Add a way to bypass dt_from_string processing time for slow servers
Jonathan Druart [Fri, 21 Oct 2016 07:01:30 +0000 (07:01 +0000)]
Bug 17476: Add a way to bypass dt_from_string processing time for slow servers

We already change this value from 1 to 2 but apparently it's not enough
So let's switch it back to on and add a flag (env var SLOW_SERVER) and skip these tests
if set

Test plan:
  prove t/DateUtils.t
and
  SLOW_SERVER=1 prove t/DateUtils.t

should return green

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication)
Matthias Meusburger [Fri, 21 Oct 2016 15:04:58 +0000 (17:04 +0200)]
Bug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 17548: Fix step 1 of memberentry
Jonathan Druart [Fri, 4 Nov 2016 09:19:01 +0000 (09:19 +0000)]
Bug 17548: Fix step 1 of memberentry

This bug has been highlighted by bug 15407.

The date limit check on the category code did not work on step 1. But
after bug 15407 the script crashes with
  Can't call method "dateofbirthrequired" on an undefined value at
  /home/vagrant/kohaclone/members/memberentry.pl line 311.

Test plan:
- Edit "step 1" information of a patron (first 'Edit' on a patron detail
page).
- Save
=> Without this patch it BOOMs
=> With this patch, the info should be correctly saved

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 16908: Remove non-desired export line
Jonathan Druart [Mon, 7 Nov 2016 15:05:15 +0000 (15:05 +0000)]
Bug 16908: Remove non-desired export line

GetTitles has been removed by bug 16847 and reintroduced it by bug
16908, caused by a bad merge conflict.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
7 years agoBug 12633: Remove export line
Jonathan Druart [Mon, 7 Nov 2016 15:16:45 +0000 (15:16 +0000)]
Bug 12633: Remove export line

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17494: (QA followup) Fix exception name
Tomas Cohen Arazi [Fri, 4 Nov 2016 15:18:57 +0000 (12:18 -0300)]
Bug 17494: (QA followup) Fix exception name

This patch changes the exception name to match the package name. And
also adds a test for the thrown exception message.

Also creates a general Koha::Exception::Patron::Modification exception
to make the new one inherit from it, following the common use in the codebase.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17494: Prevent duplicate tokens from getting stored
Kyle M Hall [Mon, 31 Oct 2016 11:15:02 +0000 (11:15 +0000)]
Bug 17494: Prevent duplicate tokens from getting stored

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17494: Make sure the same verification token won't be generated twice
Jonathan Druart [Thu, 27 Oct 2016 08:04:30 +0000 (10:04 +0200)]
Bug 17494: Make sure the same verification token won't be generated twice

Well, this patch does not enforce the unique constraint but mimic what
is already done in C4::ImportExportFramework and Koha::Upload where
md5_hex is used.

Test plan:
Have a look at the code and confirm that it adds more randomness to the
hashed string

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16493: [QA Followup] Restore title and author match as an option, make it the...
Kyle M Hall [Wed, 8 Jun 2016 10:53:25 +0000 (10:53 +0000)]
Bug 16493: [QA Followup] Restore title and author match as an option, make it the default

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16493: acq matching on title and author
Kyle M Hall [Wed, 11 May 2016 14:19:41 +0000 (14:19 +0000)]
Bug 16493: acq matching on title and author

When you order from a staged file you're getting duplicate warnings that
are inaccurate.  For example, when you order a file of 50 DVDs for
example and they don't have ISBNs they're matching on the books. And
then you have to order them one by one.

This patch replaces the use of FindDuplicates with Koha's match point
system. This means you can select from the same match points defined
and used in the batch record importer, or you can opt to skip matching
altogether!

Test Plan:
1) Import a record with a title, isbn and author.
2) Delete the from the record and stage it again
3) Attempt to add it to a basket via the staged record
4) You should note the gives you the "No records imported" message
5) Apply this patch
6) Create a matcher for ISBN
7) Create a matcher for Author/Title
8) Attempt to add the record to your basket using the ISBN matcher
8) Koha should find no match and import the record to the basket
9) Stage the record again
10) Attempt to add the record to your basket using the Title/Author matcher
11) You should recieve the "No records imported" message.

Signed-off-by: Barbara Fondren <bfondren@roundrocktexas.gov>
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17539: [QA Follow-up] Move handle after schema
Marcel de Rooy [Fri, 4 Nov 2016 07:58:20 +0000 (08:58 +0100)]
Bug 17539: [QA Follow-up] Move handle after schema

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17539: (QA followup) Silence warnings
Tomas Cohen Arazi [Thu, 3 Nov 2016 15:04:31 +0000 (12:04 -0300)]
Bug 17539: (QA followup) Silence warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17539: Fix failing Reserves.t tests if category enrolmentfee > 0
Lari Taskula [Wed, 2 Nov 2016 13:28:30 +0000 (15:28 +0200)]
Bug 17539: Fix failing Reserves.t tests if category enrolmentfee > 0

To test:
1. Set patron category "S" with enrolmentfee 1
2. perl t/db_dependent/Reserves.t
3. Observe following errors:

not ok 59 - Bug 14464 - No fines at beginning
ok 60 - Bug 14464 - 1st reserve correctly created
ok 61 - Bug 14968 - Keep found column from reserve
not ok 62 - Bug 14464 - No fines after cancelling reserve with no charge configured
ok 63 - Bug 14464 - 2nd reserve correctly created
not ok 64 - Bug 14464 - No fines after cancelling reserve with no charge desired
ok 65 - Bug 14464 - 1st reserve correctly created
not ok 66 - Bug 14464 - Fine applied after cancelling reserve with charge desired and configured

4. Apply patch
5. perl t/db_dependent/Reserves.t
6. Observe test pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17539: Fix Already in a transaction error
Lari Taskula [Wed, 2 Nov 2016 13:05:28 +0000 (15:05 +0200)]
Bug 17539: Fix Already in a transaction error

perl t/db_dependent/Reserves.t

1..72
ok 1 - use C4::Reserves;
ok 2 - CheckReserves Test 1
...
ok 52 - Reserve in waiting status cant be canceled
ok 53 - Reserving an ageRestricted Biblio without a borrower dateofbirth succeeds
DBD::mysql::db begin_work failed: Already in a transaction at
/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489.
DBD::mysql::db begin_work failed: Already in a transaction at
/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489.
at /usr/share/perl5/DBIx/Class/Schema.pm line 1080.
...
Koha::Object::store('Koha::Patron=HASH(0x9e43b20)') called at
/home/ubuntu/kohaclone/C4/Members.pm line 542
C4::Members::ModMember('borrowernumber', 658535, 'dateofbirth', '2001-11-02')
called at t/db_dependent/Reserves.t line 516

This patch fixes this issue by replacing dbh autocommit=0 with
txn_begin.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17539: Fix Undefined subroutine &C4::Circulation::GetItem error
Lari Taskula [Wed, 2 Nov 2016 12:51:23 +0000 (14:51 +0200)]
Bug 17539: Fix Undefined subroutine &C4::Circulation::GetItem error

perl t/db_dependent/Reserves.t

1..72
ok 1 - use C4::Reserves;
ok 2 - CheckReserves Test 1
ok 3 - CheckReserves() include reserve_id in its response
ok 4 - CheckReserves Test 2
ok 5 - CheckReserves Test 3
ok 6 - GetReservesControlBranch returns item home branch when set to ItemHomeLibrary
ok 7 - GetReservesControlBranch returns patron home branch when set to PatronLibrary
ok 8 - Item is correctly waiting
ok 9 - Item is correctly priority 1
ok 10 - Item is correctly priority 2
ok 11 - GetWaiting got only the waiting reserve
ok 12 - GetWaiting got the reserve for the correct borrower
Undefined subroutine &C4::Circulation::GetItem called at /home/ubuntu/kohaclone/C4/Circulation.pm line 1853.

This patch fixes this error. The solution was to use C4::Reserves before C4::Items.
Also due to this edit, change use_ok to require_ok

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16792: Add Font Awesome Icon and mini button to Keyword to MARC mapping section
Hector Castro [Tue, 21 Jun 2016 19:24:20 +0000 (13:24 -0600)]
Bug 16792: Add Font Awesome Icon and mini button to Keyword to MARC mapping section

Improve Admin > Keyword to MARC mapping to fit with others interfaces in Koha.
This bug change "Delete" link with a mini-button and introduce the trash icon.

To test:
-Apply patch
-Goto Admin > Keyword to MARC mapping
-Select one framework
-Add some mappings
-Notice about the new button with trash icon

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17544 - : Remove t::lib::Mocks dependency from populate_db.pl
Tomas Cohen Arazi [Thu, 3 Nov 2016 13:17:32 +0000 (10:17 -0300)]
Bug 17544 - : Remove t::lib::Mocks dependency from populate_db.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17540: (Bug 7216 followup) Fix tests for auth_values_input_www.t
Jonathan Druart [Wed, 2 Nov 2016 11:54:12 +0000 (11:54 +0000)]
Bug 17540: (Bug 7216 followup) Fix tests for auth_values_input_www.t

This is caused by bug 17216 which modified the structure of the AV admin
page

Test plan:
  prove t/db_dependent/www/auth_values_input_www.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17538: (Bug 17216 follow-up) Fix t/db_dependent/Upload.t
Jonathan Druart [Wed, 2 Nov 2016 11:01:54 +0000 (11:01 +0000)]
Bug 17538: (Bug 17216 follow-up) Fix t/db_dependent/Upload.t

The insert into authorised_values failed because of the missing FK

Test plan:
  prove t/db_dependent/Upload.t
should return green

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17537: Fix valid-templates.t for some include files
Jonathan Druart [Wed, 2 Nov 2016 10:50:54 +0000 (10:50 +0000)]
Bug 17537: Fix valid-templates.t for some include files

3 include files do not pass the template validation tests:
 - koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc
 - koha-tmpl/intranet-tmpl/prog/en/includes/subscriptions-search.inc
 - koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc

This is because they process a block which has not been declared before.
As they are include files, they cannot stand on their own.
We could have added them to the exclude file list of xt/author/valid-templates.t
but I think it's better to keep them into the validation loop.

Test plan:
  prove xt/author/valid-templates.t
should return green
And the library dropdown list should be correctly populated on the pages these files are included
(opac-topissues for instance)

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17518 - DBRev 16.06.00.047
Kyle M Hall [Wed, 2 Nov 2016 11:02:09 +0000 (11:02 +0000)]
Bug 17518 - DBRev 16.06.00.047

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17518: Displayed language name for Czech is wrong
Josef Moravec [Wed, 26 Oct 2016 22:53:04 +0000 (22:53 +0000)]
Bug 17518: Displayed language name for Czech is wrong

It's "Ceština" and should be "Čeština"

Test plan:
1) apply the patch
1.1) update database
2) install Czech translation for Koha
3) note the language name in language switcher (in staff client and
    opac) is right: "Čeština"

Signed-off-by: radiuscz <radek.siman@centrum.cz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17084 - Automatic debian/control updates (unstable)
Nightly Build Bot [Fri, 28 Oct 2016 22:59:58 +0000 (00:59 +0200)]
Bug 17084 - Automatic debian/control updates (unstable)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17504: Make the installer show the right dmbs help if wrong permissions
Tomas Cohen Arazi [Wed, 26 Oct 2016 14:34:08 +0000 (11:34 -0300)]
Bug 17504: Make the installer show the right dmbs help if wrong permissions

This patch changes the installer template for step 2 (DB rights check)
so it correctly displays MySQL-related message.
The previous code was doing the wrong comparisson, thus yielding
PostgreSQL documentation.

To test:
- Run:
  $ sudo koha-mysql kohadev
  > DROP DATABASE koha_kohadev ; CREATE DATABASE koha_kohadev;
  > REVOKE INSERT ON koha_kohadev.* FROM 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Run the webinstaller through step 2
=> FAIL: You get the message in the attached screenshot
- Apply the patch, reload
=> SUCCESS: You are displayed a different warning message, with a link
to up-to-date MySQL docs on GRANT
- Fix permissions for the user:
  $ sudo koha-mysql kohadev
  > GRANT ALL PRIVILEGES on koha_kohadev.* TO 'koha_kohadev'@'localhost';
  > FLUSH PRIVILEGES; \q
- Reload
=> SUCCESS: All checks are correct and you can move on
- Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16991: Add subtitle to holds to pull report
Owen Leonard [Tue, 9 Aug 2016 14:14:02 +0000 (10:14 -0400)]
Bug 16991: Add subtitle to holds to pull report

This patch adds output of subtitle to the holds to pull report using
keyword to MARC mapping information.

To test, apply the patch and go to Circulation -> Holds to pull. The
list of holds to pull should display subtitles.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Subtitle added using keyword to MARC mapping with default framework.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17524: Fix datepicker check for iso dates
Jonathan Druart [Mon, 31 Oct 2016 14:40:51 +0000 (14:40 +0000)]
Bug 17524: Fix datepicker check for iso dates

Iso dates are yyyy-mm-dd, the is_valid JS function
expects \d{2}-\d{2}-\d{4} when it should be \d{4}-\d{2}-\d{2}

Test plan:
Switch DateFormat to iso
Set a due date using the datepicker
=> Should work as expected

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16852: Remove GetBorrowerCategorycode
Jonathan Druart [Mon, 4 Jul 2016 12:38:45 +0000 (13:38 +0100)]
Bug 16852: Remove GetBorrowerCategorycode

And use Koha::Patron->categorycode instead

Test plan:
- Restrict a patron attribute to a patron category
- Use the batch patron modification tool to update a patron of this
  category
You should not see the the patron attribute

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17274: Display the place where the memcached is picked
Jonathan Druart [Thu, 8 Sep 2016 09:26:34 +0000 (10:26 +0100)]
Bug 17274: Display the place where the memcached is picked

The memcached config can be read from ENV or koha-conf.xml
In order to remove any ambiguity, let's inform the user which config is
used.

Test plan:
1/ Define the memcached config in ENV and $KOHA_CONF
=> Go on about page, you should get a warning
2/ Define the memcached config in ENV and not in $KOHA_CONF
=> Go on about page, you should get a warning
3/ Do not defined the memcached config in ENV or $KOHA_CONF
=> Go on about page, you should get a warning
4/ Define the memcached config in $KOHA_CONF and not in ENV
=> Go on about page, you should not get a warning, this is the expected
config

Followed test plan, works as expected.
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17261: (followup) Mention the need to start memcached before plack
Tomas Cohen Arazi [Tue, 13 Sep 2016 14:33:43 +0000 (11:33 -0300)]
Bug 17261: (followup) Mention the need to start memcached before plack

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17261: Memcached may not longer be running
Jonathan Druart [Thu, 8 Sep 2016 09:04:13 +0000 (10:04 +0100)]
Bug 17261: Memcached may not longer be running

If plack is started with memcached, memcached will be considered as
running, even if it has been stopped (or crashed).
This case should be highlighted on the about page.
Note that I am not sure about the consequences of this specific case!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17261: The default memcached namespace is "koha"
Jonathan Druart [Thu, 8 Sep 2016 08:24:00 +0000 (09:24 +0100)]
Bug 17261: The default memcached namespace is "koha"

If no namespace is defined in ENV or the config, "koha" is used as the
default memcached namespace (See Koha::Cache->new)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17261: (followup) Rebase against 17189 and 11921
Tomas Cohen Arazi [Wed, 7 Sep 2016 15:45:23 +0000 (12:45 -0300)]
Bug 17261: (followup) Rebase against 17189 and 11921

This patch adjusts the original one so it works on top of 17189
and 11921. It adds an 'Effective caching method' text which can
be useful, when memcached is not available.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17261: Add memcached configuration info to about.pl
Tomas Cohen Arazi [Tue, 6 Sep 2016 19:24:40 +0000 (16:24 -0300)]
Bug 17261: Add memcached configuration info to about.pl

This patch adds a row in the About > System information tab, showing
the current configuration for memcached.

To test:
- Apply this patch, have memcached configured for the current instance (this is the
  default in kohadevbox)
- Make sure you have the memcached server running:
  $ sudo service memcached start
- Open the about page in the browser
=> SUCCESS: You get something like:
  Memcached:    Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: running
- Stop the memcached server:
  $ sudo service memcached stop
- Reload the about page
=> SUCCESS: You get something like
  Memcached:    Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: not running
- Set both MEMCACHED_* variables in the apache config for intranet the empty string:
  $ sudo vim /etc/apache2/sites-enabled/kohadev.conf
..
   SetEnv MEMCACHED_SERVERS ""
    #"127.0.0.1:11211"
   SetEnv MEMCACHED_NAMESPACE ""
    #"koha_kohadev"
..
- Restart apache:
  $ sudo service apache2 restart
- Reload the about page
=> SUCCESS: You get something like:
  Memcached:  Servers: undefined| Namespace: undefined | Status: unknown
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15581 - DBRev 16.06.00.046
Kyle M Hall [Wed, 2 Nov 2016 10:53:35 +0000 (10:53 +0000)]
Bug 15581 - DBRev 16.06.00.046

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15581: Follow-up - suggested change to the OPAC message
Katrin Fischer [Tue, 1 Nov 2016 14:53:05 +0000 (15:53 +0100)]
Bug 15581: Follow-up - suggested change to the OPAC message

Instead of showing "Automatic renewal" to the user, this
changes it to show "No longer renewable" when the
automatic renewal won't happen any longer because of the
days the item has already been checked out.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15581: Change wording for auto too late
Jonathan Druart [Fri, 28 Oct 2016 16:08:01 +0000 (16:08 +0000)]
Bug 15581: Change wording for auto too late

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15581: Display the generic "schedule for auto renew" message on the checkouts...
Jonathan Druart [Mon, 18 Apr 2016 15:33:42 +0000 (16:33 +0100)]
Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15581: Display the latest auto renew date possible when renewing manually
Jonathan Druart [Thu, 14 Jan 2016 14:38:23 +0000 (14:38 +0000)]
Bug 15581: Display the latest auto renew date possible when renewing manually

If an issue marked as auto_renew is renewed manually, we want to display
the latest auto renew date possible.

Test plan:
1/ Define circ rules as in the previous patch.
2/ Check a item out, mark it as an auto renewal
3/ Back date the issuedate and make sure it will be too late to renew it
4/ Use the Circulation > renew page (circ/renew.pl) to manually renew
this issue.
You should get a warning "You barcode has been scheduled for automatic renewal
and cannot be renewed anymore since DATE."
If the pref AllowRenewalLimitOverride is set, you will be allowed to
renew it anyway.

Sponsored-by: University of the Arts London
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15581: Add a circ rule to limit the auto renewals given a delay
Jonathan Druart [Wed, 13 Jan 2016 19:17:49 +0000 (19:17 +0000)]
Bug 15581: Add a circ rule to limit the auto renewals given a delay

This patch adds a new circulation rule (no_auto_renewal_after) to block/allow
auto renewals after a given delay.
For instance, if the issue date is 10 days before today, and
no_auto_renewal_after is set to 10, tomorrow the issue won't be auto
renewed.

Test plan:
0/ Execute the update DB entry
Note: You will have to manually change data in your DB, make sure you
have access to the sql cli.
1/ Define a rule with no_auto_renewal_after (10 for instance) and
norenewalbefore (5 for instance).
(This new rule will behave the same as norenewalbefore: the unit depends
on the lengthunit value).
The automatic renewals will be done from 5 to 10 days ahead.
2/ Modify the issues.issuedate, to simulate a checkout in the past:
    UPDATE issues
    SET issuedate = "yyyy-mm-dd hh:mm:ss"
    WHERE itemnumber = YOUR_ITEMNUMBER;
with issuedate = 2 days before for instance
3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has not been renewed (too soon)
4/ Repeat step 2 with a due date set as 11 days before
5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has not been renewed (too late)
6/ Repeat step 2 with a due date set as 7 days before
7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has been renewed (issues.renewals has been
incremented and date_due has been updated according your circ rules).

Sponsored-by: University of the Arts London
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 14874: (followup) Fix typo introduced in sysprefs.sql
Tomas Cohen Arazi [Mon, 31 Oct 2016 19:18:37 +0000 (16:18 -0300)]
Bug 14874: (followup) Fix typo introduced in sysprefs.sql

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17397 - Update Schema Files
Kyle M Hall [Mon, 31 Oct 2016 10:41:40 +0000 (10:41 +0000)]
Bug 17397 - Update Schema Files

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17402 Enhance the actions button on serials-search.pl
Josef Moravec [Wed, 5 Oct 2016 10:42:41 +0000 (12:42 +0200)]
Bug 17402 Enhance the actions button on serials-search.pl

Test plan:
1) Apply the patch
2) Go to serials home page
3) Search for a subscription
4) Ensure you have permission to receive serials
5) In the most right column of table you should see "Receive serial" button with
   caret button, that should work as trigger form dropdown menu with other options
6) Ensure that all actions work as expected
7) Login with user without permission to receive serials
8) repeat 2-3
9) In the most right column of table you should see normal dropdown mane with label "Actions" and all applicable options
10) Ensure that all actions work as expected

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>