Commit graph

27933 commits

Author SHA1 Message Date
f67adfcb11 Bug 17654: Add tests to enforce swagger definition files integrity
The swagger definition error we found on bug 17651 should have been
caught earlier with tests.

Now we are testing for nullable columns.

QA: Have a look at the FIXME

Test plan:
Apply without 17651 (revert if already pushed)
The tests won't pass
On top of 17651 the tests will pass

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>
2016-11-18 14:04:22 +00:00
4366a0b469 Bug 17653: Remove itemtype-related t/db_dependent/Circulation* warnings
This patch makes t/db_dependent/Circulation* create
good sample data for its tests. It does so by creating a random
itemtype.

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

Sponsored-by: ByWater Solutions

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

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>
2016-11-18 14:02:49 +00:00
01097457ee Bug 17647: Remove itemtype-related CancelReceipt.t warnings
This patch makes t/db_dependent/Acquisition/CancelReceipt.t create
good sample data for its tests. It does so by creating a random
itemtype.

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

Sponsored-by: ByWater Solutions

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 14:01:06 +00:00
Katrin Fischer
a8f3d8cfd5 Bug 12359: Add HidePatronName functionality to the holds queue
This changes the Holds Queue page to not show the patron's name
and phone number, but only the cardnumber, when HidePatronName
is set to 'Don't show'

This also changes the link to the patron account to use
the borrowernumber instead of the cardnumber, which seems
more consistent.

Fixes a tiny capitalization error: Only item...

To test:
- Look at the holds queue page with holds displayed
- Toggle HidePatronName system preference and observe the change
- Make sure the link works correctly

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Rebased 2016-10-16

Signed-off-by: Chris Kirby <christopherlawrencekirby@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:59:24 +00:00
665c5c62fa Bug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a record with many items and many holds
If the AllowRenewalIfOtherItemsAvailable sys pref is set to allow, and a
borrower has an item checked out that has many items {30+} AND many
holds {70+) on it, loading the checkouts table for this borrower takes
FOREVER to load. The load time takes forever, because of the
factoring that happens to determine if an item is truly
available for renewal.

This patch swaps the use of GetMemberDetails for GetMember
and reorders the subroutine calls to check each items' renewability
from fastest to slowest.

In a test case, the results of pre patch were:
Start of loop: 2016-08-24T11:05:14
End of loop:   2016-08-24T11:05:29
Resulting in 15 seconds being spent in the loop

Post patch results were:
Start of loop: 2016-08-24T11:08:43
End of loop:   2016-08-24T11:08:48
Resulting in only 5 seconds being spent in the loop!

Test Plan:
1) Apply this patch
2) Note there are no changes in functionality for the renewals column of
   the patron checkouts table.

If you wish to go further and test the performance benefit:
1) Create a record with 50 items and 100 holds ( 50 waiting, 50 unfilled )
2) Check out one of the waiting holds to a patron
3) Time the amount of time it takes for the checkouts table to load
4) Apply this patch
5) Repeat step 3, you should see an improvement in load time

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:57:01 +00:00
Alex Sassmannshausen
722d045986 Bug 17576: Add housebound mandatory auth_values.
* installer/data/mysql/de-DE/mandatory/auth_values.sql: Add values.
* installer/data/mysql/es-ES/mandatory/auth_values.sql: Add values.
* installer/data/mysql/fr-CA/obligatoire/auth_values.sql: Add values.
* installer/data/mysql/fr-FR/1-Obligatoire/authorised_values.sql: Add
  values.
* installer/data/mysql/it-IT/necessari/auth_val.sql: Add values.
* installer/data/mysql/nb-NO/1-Obligatorisk/auth_values.sql: New file.
* installer/data/mysql/pl-PL/mandatory/auth_values.sql: New file.
* installer/data/mysql/ru-RU/mandatory/auth_values.sql: New file.
* installer/data/mysql/uk-UA/mandatory/auth_values.sql: New file.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:55:23 +00:00
ba43bdb4f9 Bug 17659: Fix sample_notices.sql for fr-CA
branchcode and is_html columns are present in this file

Test plan:
mysql < installer/data/mysql/fr-CA/obligatoire/sample_notices.sql
should not return any errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:54:40 +00:00
cb76c3bd97 Bug 17377: ES - Take control fields into account
There is a bug in Koha::SearchEngine::Elasticsearc::Search->json2marc, it
assumes that the MARC::Field constructor always takes >= 5 parameters.
This assumption is wrong for control fields, to create a control field you
need to call the constructor with:
  MARC::Field->new($tag, $value);

Note that I got "Too much data for control field" in the _warning value of my
MARC::Field because too many parameters were passed, and the value was undef.

That broke the result search links (on the staff interface) for DB with
biblio.biblionumber mapped with 001.

Other bugs will certainly be fixed by this patch.
For instance I got:
  GetMarcBiblio called with undefined biblionumber at /home/koha/src/opac/opac-search.pl line 664.
  GetCOinSBiblio called with undefined record at /home/koha/src/opac/opac-search.pl line 665.
in my logs, with this patch I don't get them anymore.

Test plan:
You can try to recreate the different issues and confirm than this patch
fixes them.
Or just run the tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:53:20 +00:00
847ac4b031 Bug 17377: Add tests for json2marc
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:53:20 +00:00
6d5b056a14 Bug 17323: Column search_history.time cannot be null
When doing a search, with SearchHistory pref switched on:

DBD::mysql::st execute failed: Column 'time' cannot be null [for Statement "
        INSERT INTO search_history(
            userid, sessionid, query_desc, query_cgi, type, total, time
        ) VALUES(
            ?, ?, ?, ?, ?, ?, ?
        )
    " with ParamValues: 0="7874", 1='12338a0bd8da63e32c79ee84f8493a07', 2="kw,wrdl: d", 3='q=d', 4='biblio', 5=6104, 6=undef] at C4/Search/History.pm line 34.

Since MySLQ 5.7, undef does not mean "the default value".
To let the DBMS set the default value (CURRENT_TIMESTAMP), the parameter should not be passed

Test plan:
OPAC+Intranet, swith the 2 SearchHistory syspref on
Do a search
=> Without this patch, you will get an error in the log and the row will not be inserted in the table.
=> With this patch, everything must go fine

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Not verified with MySQL 5.7. But this looks good to me.
Works under Jessie.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:51:37 +00:00
Koha Team Lyon 3
660be0e019 Bug_17484 Search with date range limit (lower and upper) does not work
If the period is entered without spaces wrapping the hyphen
You can't get any result

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
I can't reproduce the error, search still works after applying the patch

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:46:00 +00:00
68173511bf Bug 17651: borrowers.updated_on can be null - swagger def
The swagger file does not consider borrowers.updated_on as a nullable
value, it should

Test plan:
0/ Do not apply this patch
1/ update borrowers set updated_on=null;
2/ prove t/db_dependent/api/v1/patrons.t
=> Fail
3/ Apply this patch
4/ prove t/db_dependent/api/v1/patrons.t
=> green

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:39:06 +00:00
6aecba93a5 Bug 17636: Remove itemtype-related GetIssues.t warnings
This patch makes t/db_dependent/Circulation/GetIssues.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/GetIssues.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/GetIssues.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-17 16:24:04 +00:00
2a73cdac5b Bug 17431: Remove use of C4::Items and C4::Biblio
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-17 16:22:32 +00:00
620a8fb823 Bug 17431: Create the object we need instead of assuming something exists
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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>
2016-11-17 16:22:31 +00:00
Lari Taskula
f9e9f52018 Bug 17431: (follow-up) Fix issuingrules
Issuingrules could had prevented holds.t from passing with error tooManyReserves.
This patch sets issuingrules at the beginning of the test to make sure reserves
are allowed.

To test:
1. Apply patch & Run t/db_dependent/api/v1/holds.t
2. Observe test pass

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

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>
2016-11-17 16:22:31 +00:00
Lari Taskula
9fca67d467 Bug 17431: Fix failing test t/db_dependent/api/v1/holds.t
This patch fixed failing test for t/db_dependent/api/v1/holds.t which was broken
after Bug 14695.

$ perl t/db_dependent/api/v1/holds.t
...
not ok 42 - similar match for JSON Pointer "/error"
    #   Failed test 'similar match for JSON Pointer "/error"'
    #   at t/db_dependent/api/v1/holds.t line 291.
    #                   'Reserve cannot be placed. Reason: itemAlreadyOnHold'
    #     doesn't match '(?^u:tooManyReserves)'
    # Looks like you failed 1 test of 42.
not ok 4 - Test endpoints with permission

To test:
1. Run t/db_dependent/api/v1/holds.t and observe it fail.
2. Apply patch.
3. Run the test again and observe it pass.

Signed-off-by: Marc <veron@veron.ch>

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

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>
2016-11-17 16:22:31 +00:00
20d38884e8 Bug 17646: Remove itemtype-related IssueSlip.t warnings
This patch makes t/db_dependent/Members/IssueSlip.t create
good sample data for its tests. It does so by creating a random
itemtype.

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

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-17 11:06:33 +00:00
521e9a98dd 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>
2016-11-17 11:05:52 +00:00
ccd49a60df 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
2016-11-16 18:55:03 +00:00
1171b28145 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>
2016-11-16 16:18:18 +00:00
8a3ae73079 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>
2016-11-16 15:59:00 +00:00
f384f94702 Bug 17640 [QA Followup] - Remove any outstanding issues before removing patrons
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-16 15:52:17 +00:00
f427166215 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>
2016-11-16 15:50:44 +00:00
e7833cf331 Bug 17640: Fix t/db_dependent/Template/Plugin/Categories.t
These tests fail since commit 6ee8dd3a59
    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>
2016-11-16 15:50:44 +00:00
81cd8b93bb 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>
2016-11-16 15:31:01 +00:00
54bc027289 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>
2016-11-16 15:31:01 +00:00
08f7baf3e3 Bug 17641: Fix t/Biblio/Isbd.t
On commit cadf5aea81
    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>
2016-11-16 14:02:30 +00:00
fbaa28bf2a 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>
2016-11-16 14:01:33 +00:00
0faf643661 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>
2016-11-16 10:57:56 +00:00
64900dc7c6 Revert "Bug 17634: Unit test t/db_dependent/ArticleRequests.t is failing"
This reverts commit 75f7510158.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-16 10:57:56 +00:00
379f392ddc 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>
2016-11-15 18:16:30 +00:00
75f7510158 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>
2016-11-15 17:43:16 +00:00
aa1390a220 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>
2016-11-15 15:54:24 +00:00
bdcbb1c899 Bug 17522: Fix opac-user.pl if OpacRenewalAllowed is set
This patch fixes a bug added by commit 81a04af278
    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>
2016-11-15 15:49:59 +00:00
72fea80a33 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>
2016-11-15 15:41:44 +00:00
7953beeffd 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>
2016-11-15 15:41:43 +00:00
6edbd47a44 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>
2016-11-15 15:41:43 +00:00
36280356c1 Bug 17579 [QA Followup] - Fix the number of tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-15 15:27:13 +00:00
ea3704203e 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>
2016-11-15 15:24:51 +00:00
d892342e6f 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>
2016-11-15 15:24:50 +00:00
81ea88fff6 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>
2016-11-15 15:21:31 +00:00
1da4a7b4a2 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>
2016-11-15 15:15:26 +00:00
4277f43a91 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>
2016-11-15 15:10:00 +00:00
3a6d38cbcb 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>
2016-11-15 14:09:33 +00:00
Mark Tompsett
a618c62ae6 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>
2016-11-14 11:28:43 +00:00
87380d8b46 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>
2016-11-14 11:28:42 +00:00
2975c01020 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>
2016-11-14 11:25:25 +00:00
0a90892387 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>
2016-11-14 11:24:23 +00:00
f4bd05d00d 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>
2016-11-12 02:39:35 +00:00