Jonathan Druart [Thu, 29 Sep 2016 15:08:36 +0000 (16:08 +0100)]
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>
Jonathan Druart [Thu, 29 Sep 2016 15:41:53 +0000 (16:41 +0100)]
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>
Jonathan Druart [Tue, 20 Sep 2016 10:40:13 +0000 (11:40 +0100)]
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>
Jonathan Druart [Thu, 17 Nov 2016 15:12:01 +0000 (15:12 +0000)]
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>
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>
Jonathan Druart [Wed, 19 Oct 2016 13:14:41 +0000 (14:14 +0100)]
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>
Lari Taskula [Wed, 19 Oct 2016 12:18:02 +0000 (15:18 +0300)]
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>
Lari Taskula [Wed, 12 Oct 2016 11:29:26 +0000 (14:29 +0300)]
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>