Commit Graph

3505 Commits

Author SHA1 Message Date
Jonathan Druart db9102617e Bug 24813: Prevent api/v1/holds.t to fail randomly
Hold cannot be suspended if found=W:
Koha::Hold->suspend_hold
 90     if ( $self->is_found ) {    # We can't suspend found holds

So when TestBuilder generate a hold with found=W the test fail.

A question however:
Why did not we have the correct exception displayed somewhere? That
would be much more helpful to find the problem!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c405b03dd3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1993e98edf)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-04-15 10:12:35 +12:00
Hayley Mapley d0facd2b73 Bug 24673 (18.11.x U18 follow-up): Fixing t/db_dependent/Koha/XSLT/Security.t
The test t/db_dependent/Koha/XSLT/Security.t failed on Jenkins for U18
when this bug's patches were backported, due to it returning a different
IO error message for XSLT.

This patch adds a condition to the regex which matches both messages:
'Failed to load external entity' and 'Failed to load HTTP resource'

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-04-14 16:00:40 +12:00
Marcel de Rooy 610a6cf78b Bug 23290: [RMaint version] Mitigate XML/XSLT vulnerabilities
This is a squashed version for backporting to stable branches.
IMPORTANT: It does not move XSLT_Handler to XSLT/Base as in master.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d8bf40281b)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-24 09:10:06 +13:00
Jonathan Druart 70d1f0a1ba Bug 14759: Add test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit ad92c14058)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7ad9807353)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-21 10:07:08 +13:00
Lari Taskula c3ad074be4 Bug 24016: Add a failing test for overwrite-able manager_id in Koha::Patron::Message
To test:
1. prove t/db_dependent/Koha/Patron/Messages.t
2. Observe failure

t/db_dependent/Koha/Patron/Messages.t .. 2/12
   Failed test 'Manager id should be overwrite-able even if defined in userenv'
   at t/db_dependent/Koha/Patron/Messages.t line 90.
          got: '1100'
     expected: '1101'
 Looks like you failed 1 test of 12.
t/db_dependent/Koha/Patron/Messages.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/12 subtests

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit c74820c227)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3d73723a9f)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-20 15:03:07 +13:00
Nick Clemens ab03647466 Bug 22302: Unit tests
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 91294e2623)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd5d08d66b)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-20 14:41:27 +13:00
Jonathan Druart e11243cf04 Bug 24213: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit d3462a97cc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f45c4b8f3a)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-18 15:29:51 +13:00
Jonathan Druart 050bdad331 Bug 24277: Fix date received editing when receiving an order
Bug 8417 added the ability to edit the date received, but a merge
conflict was wrongly resolved during a rebase of
  commit 20d9ed618f
  Bug 13321: Rename variables

Test plan:
Create an order
Receive it
Set a date (different from today)
=> The date you picked should have been set in DB for the order

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 028a77abce)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a273c604db)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-10 12:20:32 +13:00
Tomas Cohen Arazi 34dee35999 Bug 24277: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 76f7c46613)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b57a0462ec)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-02-10 11:22:37 +13:00
Katrin Fischer 06fe72daea Bug 23181: [18.11] Extend unit tests
Run t/db_dependent/Accounts.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-01-13 10:57:41 +13:00
Tomas Cohen Arazi 014d0abd3a Bug 24191: Add to_model param to _build_order_atom and dbic_merge_sorting
This patch adds a to_model parameter to dbic_merge_sorting so it is
passed when used (for example from objects.search). The to_model param
is passed along to the _build_order_atom method where it is finally
used.

In the process I wrote tests that reflected some problems in the current
code:
- Mojolicious automatically returns a scalar if a query parameter only
happens once on a request. The code expected an arrayref in every case.
- There's a design issue that forced me to use some hacky code in
_build_order_atom.

The first issue is dealth with, by using Scalar::Util::reftype as the
Perl docs recommend.

The second issue, I don't plan to clean it here, as there's ongoing work
on a Koha::Objects->search_from_api method that will obsolete this code
most probably (see bug 23893 for a better picture of where the mappings
will be living soon).

To test:
1. Apply this patch
2. Run:
  $ kshell
 k$ prove t/Koha/REST/Plugin/Query.t
=> SUCCESS: Tests pass!!
3. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 46895911d4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d9ec59f191)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-01-10 10:22:12 +13:00
Tomas Cohen Arazi d63d023a2a Bug 24191: Regression tests
This patch adds missing tests for calling objects.search with
non-existent column names for sorting, that should be mapped using
to_model for that matter.

Tests should fail as there's no current use of to_model for building the
order_by portion of the query.

Sponsored-by: ByWater Solutions
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit f38519b063)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 99ad6cac30)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2020-01-10 10:15:09 +13:00
Nick Clemens 8d536d2cda Bug 23089: [18.11.x] fix tests
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2019-12-19 10:08:21 +13:00
Ere Maijala b94ca526b8 Bug 23089: Fix QueryBuilder tests.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cce9d03bf9)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2019-12-18 14:05:11 +13:00
Nick Clemens 3e714ce305 Bug 23389: Add 'All' option to report dropdowns
This patch optionally adds an 'all' option to report dropdowns

Note you will need to use 'LIKE' instead of '=' to allow 'All' to work

To test:
 1 - Write a report:
     SELECT branchname FROM branches WHERE branchcode LIKE <<Branch|branches>>
 2 - Run it
 3 - Select a branch
 4 - You get one branch info
 5 - Note you cannot select all
 6 - Apply patch
 7 - Run report
 8 - No change
 9 - Update report like:
     SELECT branchname FROM branches WHERE branchcode LIKE <<Branch|branches:all>>
10 - Run report
11 - Select 'All'
12 - You get all branches
13 - Select one branch
14 - You get one branch
15 - Test with other authorised categories (itemtypes, YES_NO, etc.)
16 - Confirm it works as expected
17 - Prove -v t/db_dependent/Reports/Guided.t

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7c97f5263d)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2019-12-18 10:18:07 +13:00
Nick b3e737f96a Bug 23089: Unit tests
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 180fb25b63)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
2019-12-18 10:11:51 +13:00
Jonathan Druart 303176fa7d Bug 23768: Adjust the test for invalid ISBN
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 342baeecbb)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
(cherry picked from commit ffbf5e1006cdf241507794357ef32a442dd54a53)
2019-12-17 16:47:43 +13:00
Jonathan Druart 7439bdab19 Bug 24145: (bug 22543 follow-up) Fix Auth.t
Auth.t is failing because of: 1. recent changes from bug 22543 and 2. wrong mocked CGI->param in tests
Without this patch we hit the exit statement that breaks the tests with the following error:

t/db_dependent/Auth.t .. 1/22 Un-mocked method 'url()' called at /kohadevbox/koha/C4/Auth.pm line 1223.
Un-mocked method 'redirect()' called at /kohadevbox/koha/C4/Auth.pm line 1227.
A context appears to have been destroyed without first calling release().
Based on $@ it does not look like an exception was thrown (this is not always
a reliable test)

This is a problem because the global error variables ($!, $@, and $?) will
not be restored. In addition some release callbacks will not work properly from
inside a DESTROY method.

Here are the context creation details, just in case a tool forgot to call
release():
  File: t/db_dependent/Auth.t
  Line: 74
  Tool: Test::More::subtest

Cleaning up the CONTEXT stack...
    # Looks like you planned 22 tests but ran 1.
t/db_dependent/Auth.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 21/22 subtests

Test Summary Report
-------------------
t/db_dependent/Auth.t (Wstat: 65280 Tests: 1 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 22 tests but ran 1.
Files=1, Tests=1,  2 wallclock secs ( 0.02 usr  0.00 sys +  1.54 cusr  0.24 csys =  1.80 CPU)
Result: FAIL

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

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 678b4bf464)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
(cherry picked from commit f7851500a9f44a4e5f5096f3f74ec9dba9c6991c)
2019-12-17 11:21:46 +13:00
Jonathan Druart 775dcf2144 Bug 23042: Correct shib param escaping
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-11-22 17:36:43 +00:00
Martin Renvoize dfb77c680c Bug 23042: Add tests to catch POST params in return URL
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-11-22 17:36:38 +00:00
Kyle M Hall 5a7bf6bbec Bug 23688: System preference uppercasesurnames broken by typo
In the process of moving this feature from memberentry.pl to Patron.pm, the 's' on uppercasesurnames was dropped, breaking the feature.

Test Plan:
1) Test uppercasesurnames, note it does not work
2) Apply this patch
3) Test uppercasesurnames, note it works now!

Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 62ad053894)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0c9c78341b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-11-13 22:41:18 +00:00
Fridolin Somers 17a646c633 Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t
I've choosen to add it to db_dependent because we may add other tests
to cover transferbook() cases that will change DB

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d096eeab8a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 19b44c8b44)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-11-13 22:35:23 +00:00
Tomas Cohen Arazi d340a6766f Bug 23624: (QA follow-up) Test error cases
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6c90c6f7d9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 34f49c908c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-10-17 22:29:40 +00:00
Tomas Cohen Arazi 3f325c3972 Bug 23624: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7958e7f3f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 654c13e7d9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-10-17 22:28:43 +00:00
Lucas Gass 51c0f7b624 Bug 23526: (RM follow-up) Fix failing test
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-10-17 01:51:58 +00:00
Tomas Cohen Arazi fa4f00dbbb Bug 23607: Make /patrons/:patron_id/account staff only
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8171c9d05d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4c681e4e91)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-10-17 01:15:27 +00:00
Fridolin Somers b77ba4981c Bug 23004: Unit test
Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b26c2a1863)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c67f4ce30a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-10-17 00:04:42 +00:00
Nick Clemens 9baac5074d Bug 23324: (QA follow-up) Use existing NormalizeISBN function
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5104d1eae6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a924e1e050)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-09-21 09:00:07 +00:00
Nick Clemens 144393dd9e Bug 23324: Add an ISBN normalization routine
To test:
1 - Set SearchEngine to ElasticSearch
2 - Stage the sample file (import it if it doesn't already exist in your catalog and then stage again)
3 - Set matching rule to ISBN
4 - No matches found
5 - Apply patch
6 - Apply no matchign rule
7 - Change the ISBN matching rule to use ISBN normalizer
8 - Apply matching rule for ISBN
9 - It matches!

Signed-off-by: Ron Houk <rhouk@ottumwapubliclibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3d15819443)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bb6f4f13ce)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-09-21 08:59:46 +00:00
Tomas Cohen Arazi 9b009c09d2 Bug 11677: Use zebra not-onloan-count index for availability limit
This uses the work from bug 18098 to use the count of not-onloan items to
determine availability.

It keeps the allrecords,AlwaysMatches='' portion of the query so it still catches
records with the tested indexed missing.
These shouldn't exist except in the case of missing data, but kept for future use as well as
it has no negative impact and minimizes the change made.

Note that availability in this sense means not check out and not lost. Transfers, holds, and not for loan statuses
should probably have indexes built in the same way as bug 18098 (there are related FIXMEs in the code)

This updates the export_records file used for testing - adding three records with a not-onloan-count (999$x) of 1,
but marking the item on the third record lost to prevent its return

To test:
   1 - make sure SearchEngine pref is set to 'Zebra'
   2 - Do a search on the OPAC that returns some records
   3 - Find a record in those results with more than one 1 item, and checkout 1 leaving 1 (or more) available
   4 - Find another record with only 1 item, check that item out
   5 - Limit opac search to available items - both records disappear
   6 - Apply patch
   7 - Restart all the things
   8 - Repeat search
   9 - First record should show, but no second
  10 - Mark other items of first record as lost, return items on second record
  11 - Repeat search, first record should not be in results, second should
  12 - prove -v t/db_dependent/Search.t

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d4468c5f33)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1fe12aef4d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-09-05 21:52:49 +00:00
Colin Campbell cf43db0a22 Bug 23251: Correct formatting of IMD data ending in apostrophe
IMD text data may end in an apostrophe (e.g. dreamin' )
This was causing the segment to be incorrectly formatted
as only the last character was checked, not the preceding
character to check whether it was quoted

add a test for this specific occurence

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0c4112a200)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d991ffdbee)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-08-31 04:49:44 +00:00
Ere Maijala 22585ec127 Bug 22524: Fix publication date and year search with Elasticsearch
Also fixes the mappings.yaml to use correct field name (left over issue from bug 19575), so reset mappings and reindex before testing.

Test plan:
1. Reset mappings and reindex biblios.
2. Check that tests in t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t pass.
3. Try that all of the following year range type work in publication date search and year limit in advanced search:
yyyy
yyyy-yyyy
-yyyy
yyyy-

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2293e6597c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d21a1fb964)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-08-31 03:35:36 +00:00
Jonathan Druart 6779695ba0 Bug 22142: Do not revert data if 'unchanged' was set
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cec6f46b47)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3c410ab3a3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-08-28 00:37:31 +00:00
Nick Clemens ac46c55e16 Bug 22142: Highlight the issue
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 52885ff55b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5f8bc12e59)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-08-28 00:37:16 +00:00
Kyle M Hall 5f7b2632d7 Bug 23103: Cannot checkin items lost by deleted patrons with fines attached
Test Plan:
1) Checkout an item to a patron
2) Ensure the item has a replacement cost (or itemtype has default)
3) Ensure patrons are charged when items lost
4) Mark the item lost
5) Confirm patron has a fine
6) Write off the fine
7) Delete the patron
8) Check in the item
9) Note the internal server error
10) Apply this patch
11) Repeat steps 1-8
12) Note there is no internal server error!
13) prove t/db_dependent/Circulation.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d2a2e4a8d5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5451e33184)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-08-14 02:06:40 +00:00
Marcel de Rooy d460fe8304 Bug 23177: [18.11.x] (QA follow-up) Move three subs from the middle to the top in Circulation.t
Removed trailing comma for last sub too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 23177: (QA follow-up) Move rollback to the end

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 23177: (QA follow-up) Remove subtest txn_begin and rollback

This resolves:
DBIx::Class::Storage::txn_rollback(): A txn_rollback in nested transaction is ineffective! (depth 1)
Removing unneeded subtest txn's. We should probably add them everywhere or
just at global level.

Test plan:
With all three patches applied, run Circulation.t a few times.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 23177: (RM follow-up) Further test clarifications

This patch makes a few minor improvements to Circulation.t
1) Adds a name to some of the scoped blocks by converting them to
   subtests.
2) Adds output messages to some tests where they were missing.

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

Bug 23177: Rebase fixes

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-08-13 20:27:04 +00:00
Nick Clemens 9963687308 Bug 12537: Don't retrieve XISBN results for the same biblionumber
For a biblio with multiple ISBNS we sometimes get our own record back when
check XISBN, we should test for this

To test:
1 - Edit a record in the catalogue, add two isbns:
     0521240670
     0521284198
2 - Enable ThingISBN and FRBRizeEditions and OPACFRBRizeEditions
3 - View the record in staff and OPAC
4 - You should see editions tab pointing to the same record
5 - Apply patch
6 - Reload the record details, you should no longer see editions tab
7 - Add the second ISBN to another record
8 - Reload details for original record, you shoudl see editions linking to the record with second ISBN
9 - prove -v t/db_dependent/XISBN.t

NOTE: Current tests don't work under elasticsearch, but the code does, tests should be rewritten on another bug

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fd5686b156)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 005a799051)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-08-06 04:35:29 +00:00
Martin Renvoize b5211d1566 Bug 23280: Silence warning
Corrects a typo in t/db_dependent/selenium/patrons_search.t introduced
by bug 22781.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 481d346131)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 55ace0434a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-08-06 00:17:12 +00:00
Mark Tompsett e4c7906dbd Bug 23199: Added tests for Koha::Patron
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e53bed5375)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 05dcd8489c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-08-02 20:15:59 +00:00
Nick Clemens 480ce53dd8 Bug 23077: Fix import of cardnumber 0
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9796f5adb3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dd91300c04)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-07-31 18:23:00 +00:00
Nick Clemens 225c3ba5ed Bug 23077: Unit tests
prove -v t/db_dependent/Koha/Patrons/Import.t

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 51bfa2ce28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit feaaa75f15)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-07-31 18:22:30 +00:00
Jonathan Druart 2d7529e953 Bug 23083: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 44469cf4c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dd850bdd07)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-07-26 03:39:51 +00:00
Mark Tompsett 7665edd38f Bug 23230: (follow-up) Fix broken tests
Before patch, the new tests don't run.
After patch, they do.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 288cc50555)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit af7c25d249)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-07-26 03:15:09 +00:00
Tomas Cohen Arazi bd2e6c6734 Bug 23230: Unit tests
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2ff5f9fb63)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5232a62639)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-07-26 03:14:20 +00:00
Jonathan Druart 496e507122 Bug 23211: Prevent SIP/Transaction.t to fail randomly
The checkout failed because patron's category is the one used for statistics (category_type=X).

To recreate the failure:
modified: t/db_dependent/SIP/Transaction.t
@ Transaction.t:37 @ subtest fill_holds_at_checkout => sub {
     plan tests => 6;

-    my $category = $builder->build({ source => 'Category' });
+    my $category = $builder->build({ source => 'Category', value => { category_type => 'X' }});
     my $branch   = $builder->build({ source => 'Branch' });
     my $borrower = $builder->build({ source => 'Borrower', value =>{
         branchcode => $branch->{branchcode},

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 466f99e442)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a38bc66100)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-07-25 20:49:45 +00:00
Julian Maurice f8b7a5f5e1 Bug 23156: [18.11] Add pagination to checkouts in ILS-DI GetPatronInfo service
When patrons have a lot of checkouts, GetPatronInfo can take a lot of
time. This patch introduces two new parameters to allow pagination of
this list of checkouts

Also, fix a warning in C4::ILSDI::Services::GetPatronInfo

Test plan:
1. Go to /cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=X&show_loans=1
   where X is a borrowernumber of a patron who has several checkouts
   Verify that all checkouts are listed
2. Add '&loans_per_page=1&loans_page=1' to the URL. Verify that you have
   now only one checkout listed, and that there is a new element
   <total_loans> which contain the total number of checkouts
3. Increase the page number in the URL until you have seen all checkouts
4. prove t/db_dependent/ILSDI_Services.t

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-07-25 20:43:05 +00:00
Mark Tompsett 47468fe93c Bug 23151: (follow-up) tweaked tests
This forces the tests to use the new changed_fields
field.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5c5a261e4e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8a52db3b2e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-07-22 23:58:36 +00:00
Jonathan Druart 68bd557329 Bug 23151: Add tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 286ffd5f2f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d08367c9aa)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-07-22 23:58:20 +00:00
Kyle M Hall d16af2544c Bug 18344: Add unit tests
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 60e24be115)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8981df1cf0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-06-19 19:22:48 +00:00
Martin Renvoize a3469609fc Bug 10215: (follow-up) Fix the failing test
We now handle NULL values at the database end and do not expect empty
strings.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 117061d884)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5d0f6f8cbb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2019-06-12 22:21:49 +00:00