Commit Graph

5708 Commits

Author SHA1 Message Date
Nick Clemens c0fa919492
Bug 22042: Block all return actions when BlockReturnOfWithdrawn items is set to block
Currently this syspref only bokcs the literal 'return' from a patron, i.e. the checkin

It still processes transfers, refunds lost items, updates NotForLoan status etc.

We should block all of these things

To test:
1 - Set BlockReturnOfWithdrawn to block
2 - Set an item as lost and withdrawn
3 - Check it in
4 - Item is found
5 - Apply patch
6 - Repeat 1-3
7 - Checkin is blocked, item still lost

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 321d8f7ce6)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-26 14:55:04 +01:00
Jonathan Druart aee75b61fc
Bug 32349: Remove TEST_QA
There is an env var that we are passing from koha-testing-docker, TEST_QA.
It's used in Koha from a single test file, t/00-testcritic.t.
If not set, no test is run.

Do we really need this? libtest-perl-critic-perl is packaged and automatically installed.

Signed-off-by: Mason James <mtj@kohaaloha.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0adc264edb)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit a375a94225)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a5e6294167)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-26 14:25:46 +01:00
David Cook c713d1c357
Bug 20596: Add unit test for multiple values in authority search
This patch adds a unit test which returns 2 authority records
via an implicit OR when searching for strings from two different
authority records.

Test plan:
1. prove t/db_dependent/Search.t

Signed-off-by: Jan Kissig <jan.kissig@th-wildau.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 76d676a868)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5921e1c523)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8146d064b5)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-26 11:45:27 +01:00
Jonathan Druart 81b0a77e8a
Bug 32622: Fix Auth.t on D10
It's caused by a version mismatch of Test::MockModule with D10,
which does not have this commit: fef9e742e4

We should remove the chaining here.

Test plan:
Confirm that Auth.t still pass, and is fixed on D10

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d3b4edf009)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit b36b7d5751)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3622b51abb)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-26 10:02:33 +01:00
Jonathan Druart 527b2b634f
Bug 29458: Fix selenium test
The authentication.t selenium tests (and a couple of others) were
failing with:
Error while executing command: element not interactable: Element <input class="btn btn-primary" type="submit"> could not be scrolled into view at /usr/local/share/perl/5.32.1/Selenium/Remote/Driver.pm line 411. at /usr/local/share/perl/5.32.1/Selenium/Remote/Driver.pm line 356.

We changed the other of the form, and t::lib::Selenium::submit_form was
not getting the correct (first) form. The one from the auth modal was
retrieved and submit button was clicked. Selenium raised an error as it
is not displayed.
The ->is_displayed selenium method does not work, as per the doc
"""
Note: This does *not* tell you an element's 'visibility' property; as it still takes up space in the DOM and is therefore considered 'displayed'.
"""
https://metacpan.org/pod/Selenium::Remote::WebElement#is_displayed

"The internet" is saying we should be able to use the following in our
xpath expression: not(ancestor::div[contains(@style,'display:none')]
but it actually only works if the display:none rule is defined on the
node (not from .css). Which does not work for us.

The only solution I found is to check for the size of the element, which
is (0,0) if not effectively displayed.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5520b8fb84)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 17:45:46 +01:00
Arthur Suzuki 7c0a1a25e3
Revert "Fix selenium tests"
This reverts commit 83805af568.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 17:44:39 +01:00
Arthur Suzuki 83805af568
Fix selenium tests
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 17:32:33 +01:00
Arthur Suzuki b79befe267
Revert "Bug 32208: Extend Auth.t"
This reverts commit 5529e5a0ca.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 14:56:30 +01:00
Marcel de Rooy 45dca37ea9
Bug 31908: [21.11.x] Fix Auth.t
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-01-13 11:28:13 +01:00
Marcel de Rooy 5529e5a0ca
Bug 32208: Extend Auth.t
Test plan:
Without follow-up patch, Auth.t should fail:
    not ok 5 - No permission response
    not ok 6 - checkauth returned failure

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a1134bfd8a)
2023-01-11 12:07:04 +00:00
Jonathan Druart 93777723f3
Bug 31908: Add selenium tests
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e378ee05f4)
2023-01-11 12:07:03 +00:00
Marcel de Rooy 3b8f75bb5e
Bug 31908: Add a test to show issue
Test plan:
Without next patch, run Auth.t.
Should fail now before next patch resolves problem:
    not ok 2 - Login of patron2 approved
    ok 3 - Did not return previous session ID
    not ok 4 - New session ID not empty

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d916250d31)
2023-01-11 12:07:03 +00:00
Tomas Cohen Arazi 352060d767
Bug 31086: (follow-up) There's no ->fill in 21.11
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-12-23 11:43:22 -03:00
Jonathan Druart 56ada053c4 Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls
We are seeing the following lines several times in the codebase
  $cache->clear_from_cache("default_value_for_mod_marc-");

But values are never set for this key.

Test plan:
Ask you, "Is the above correct?"
Use the correct 'git grep' and 'git log' and confirm the assertion.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 93d44d1875)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 867c03bf6a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 17:01:38 +01:00
Janusz Kaczmarek 03e8300d57 Bug 19693: Add test sub to Merge.t
In those rare cases when authorities are updated by an external agency (or
even internally, by reviewing and correcting an exported authority file)
when the heading tag will be changed (seems odd but happens:

111 Congress ==> 110 Corporate body.Congress ;
100 Person ==> 110 Corporate body (a company named with person's name ;
151 City--object ==> 150 Object (city) etc.)

and then the authority record in Koha database will be updated with
bulkmarcimport or by calling directly ModAuthority from a custom script,
the merge function "doesn't know" that the change to the authority type
has been made and, consequently, doesn't adequately change the tag in
related fields in biblio records (as it would if two different records
with different authtypecode were merged with Koha interface).

This is because at the moment when merge function is being called
by ModAuthority:
Koha::Authority::Types->find($autfrom->authtypecode)
Koha::Authority::Types->find($authto->authtypecode)
both have the same value (because $mergefrom == $mergeto).

Therefore in case when $mergefrom == $mergeto and the heading tag changes,
$authtypefrom and $authfrom calculated in merge in the ordinar way are
misleading and should not be taken unto consideration.

Test plan:
==========

1. run t/db_dependent/Authority/Merge.t
2. you should see problems in "Test update A with modified heading tag
   (changing authtype)"
3. apply the patch
4. run t/db_dependent/Authority/Merge.t again
5. the test should pass

Alternatively:

1. have an authority record used in biblio;
   export it to file;
   change 1XX heading tag to a different (but reasonable) value
   and possibly change also the content of the heading
   (one can delete also 942 but it doesn't matter);
   make bulkmarcimport.pl -a -update -file <modified_auth_file> and
   see that the tag in biblio record has not been changed (whereas
   the type of authority record did change);

2. make orders in database (so that the authority type and the tag of
   the field in biblio record correspond); apply the patch;

3. repeat the test from 1.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4d75a9b3b7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1ac516addb)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 16:52:03 +01:00
Nick Clemens cbd00bc2fc Bug 31644: Add copy test and clarify some functions
This patch adds a tst for copy without subfields. I also clarify what eachstep does
so the next user/coder understands current behaviour

Update existing or add new: In the case where the field/subfield exists
we update, if we have two fields - one with the subfield, and one without, we
add the subfield to the one without

Copy field:
 - If given a subfield - we will add to existing fields in the record
 - If not given a subfield - we create an entirely new field

The logic of all of this is tricky, makes sense in a certain light, any complaints
are for a new bug :-)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 74742f5276)
(cherry picked from commit 98fe1f204a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 15:31:51 +01:00
Nick Clemens daab4314a6 Bug 31644: Unit test
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4ab009cc9a)
(cherry picked from commit 17c6bdde3f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 15:31:51 +01:00
Kyle Hall a5080a81c0 Bug 31920: Add transaction to subtest in t/db_dependent/Holds.t
A subest in t/db_dependent/Holds.t leaves behind database cruft.

Test Plan:
Using koha-testing-docker:
1) SELECT branchcode FROM branches
2) prove t/db_dependent/Holds.t
3) SELECT branchcode FROM branches
   Note cruft
4) reset_all
2) prove t/db_dependent/Holds.t
3) SELECT branchcode FROM branches
   No cruft!

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2b8b02a587)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 992d2b01f7)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 14:42:48 +01:00
Kyle M Hall b4f6dc92e1 Bug 31684: Set Koha::Plugin::Test version to 'v1.01'
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a26cc8a29b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8b81824e32)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 14:33:33 +01:00
Mason James 2316dc2be5 Bug 31883: Filter trim causes false warnings
Test plan:
Run xt/find-missing-filters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 246efd2e9b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 43ba61af5b)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-16 14:30:55 +01:00
Kyle Hall 479ef38873 Bug 31552: SIP2 option format_due_date not honored for AH field in item information response
Bug 28730 added the ability to format due dates based on Koha's date format, but missed formatting the due date field in the item information response.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Message.t

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 93e418c0b3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c7b340508)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 16:20:28 +01:00
Nick Clemens 624376b6cb Bug 29561: Unit test
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c473480d4e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5b6b095f1f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 15:33:27 +01:00
Tomas Cohen Arazi 77a3aff3aa Bug 31587: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fc7cc1467d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a09d225815)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 15:24:13 +01:00
Fridolin Somers b9df1bf22b Bug 31649: Add unit tests
Creates new test file GetBasketGroupAsCSV.t

Test with :
prove t/db_dependent/Acquisition/GetBasketAsCSV.t
prove t/db_dependent/Acquisition/GetBasketGroupAsCSV.t

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 193d6c48a4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f076d3b66d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 14:38:57 +01:00
Marcel de Rooy fd0f1adceb Bug 31593: Remove Test::DBIx::Class from Context.t
No need to keep it.
Fixing a test description too.

Test plan:
Run t/db_dependent/Context.t

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 499562f0b8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3088c2f56a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 10:53:26 +01:00
Julian Maurice 1f926a8772 Bug 31441: Fix Koha::Item::as_marc_field when kohafield = ''
marc_subfield_structure.kohafield can be NULL, but it can also be an
empty string. But in that case, Koha::Item::as_marc_field ignores them,
which means the resulting MARC::Field object has missing data.
This can produce a bug in OPAC ISBD view (and probably other places
where this method is used)

Test plan:
1. Edit the default biblio MARC framework for the item field: find or
   create a subfield that is not linked to a DB column.
   Save even if you made no changes to make sure that
   marc_subfield_structure.kohafield is set to an empty string.
   I'll use 995$Z as an example for the following steps.
2. Add the following to syspref OPACISBD:
    #995|<br>Item:|{995Z}|
3. Create a biblio with an item and put a value into 995$Z
4. Go to the ISBD detail page for this record at OPAC. Confirm that the
   value you entered in 995$Z is not visible
5. Apply patch and restart koha
6. Refresh the ISBD detail page. Confirm that the 995$Z is now visible.
7. Run `prove t/db_dependent/Koha/Item.t`

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 389b9dfaf4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 272510faf7)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-12-14 10:44:49 +01:00
Arthur Suzuki 6045114224 Revert Bug 31421
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-21 10:56:22 +01:00
Julian Maurice ba48564356 Bug 25375: Fix QueryBuilder.t tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a4f09abd5c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3a2ac10bcf)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 18:16:23 +01:00
Nick Clemens b70eb7f8b0 Bug 25375: Adjust tests and test itemlost, not notforloan
Previous commit correctly lists Zebra availability test, but was a
bad edit. This fixes the availability test to use itemlost

Additiionally, tests were written before limits were agreed. Adjusted
for the current settings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 471facdf26)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 544b89cf90)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 18:16:23 +01:00
Julian Maurice fd5a9df95b Bug 25375: Add tests for the "available" ES field
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f48c5bbb8b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 97b58633d0)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 18:16:23 +01:00
Julian Maurice eaa45e93db Bug 27550: Add unit test for CloneBudgetHierarchy
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ca338bae1e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c7074be1c9)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 17:50:42 +01:00
Marcel de Rooy c9056ce0ac Bug 31598: Fix random failure on Jenkins for Upload.t
At some point the warn is made conditional for permanent
files. So it failed when TestBuilder picked a zero value
for permanent. Trivial fix.

Test plan:
Run t/db_dependent/Upload.t a few times

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9a92ee3194)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d7bf6f7084)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 17:32:13 +01:00
Nick Clemens d1a8c426fe Bug 30359: Unit tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b1e3398e84)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 79bc7a8de5)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 17:28:34 +01:00
Jonathan Druart 3b0925fe88 Bug 31154: Add test
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit edf8640cff)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8735f0732c)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 15:22:24 +01:00
Marcel de Rooy f7b1914fc4 Bug 31250: (QA follow-up) The future will be easier
As requested by Jonathan, we need more flexibility ;)
Here it comes.

Test plan:
Run t/CookieManager.t

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cffd36bcb4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d865ce1665)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 15:08:08 +01:00
Marcel de Rooy 6b86604469 Bug 31250: Deny clearing cookies with numeric suffix
This change allows us to add catalogue_editor_ to the deny list
in koha-conf.xml and keep cookies like catalogue_editor_123.

Test plan:
Run t/CookieManager.t

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

To test:
1 - Sign in to staff client
2 - Search for records and edit one
3 - Switch to advanced editor
4 - View cookies (F12/developer panel/storage tab)
5 - Note cookie like 'catalogue_editor_##' with value 'advanced'
6 - Log out
7 - note cookie value deleted
8 - Log in and search/edit a record
9 - Basic editor loads
10 - Apply patch
11 - Add line to koha-conf as described in second patch
12 - Restart all
13 - Switch to advanced editor
14 - Cookie value updated
15 - Logout
16 - Cookie value remains
17 - Log in and search/edit
18 - Confirm advanced editor loads

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cb036faf2c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 58eb3713ec)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 15:08:08 +01:00
Kyle Hall 450872f764 Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c5810c3605)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c6eef3816)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 14:46:30 +01:00
Nick Clemens 8ca15f9841 Bug 31023: Unit tests
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit df184560a5)
(cherry picked from commit 4b9106d995)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 14:34:44 +01:00
Nick Clemens d607aaf911 Bug 28290: (follow-up) Unit test
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e36e6c55a7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9eb3d8332a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 14:33:50 +01:00
Jonathan Druart 24f194dc26 Bug 31421: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f2519aec6f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a7b67c08ac)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-11-14 11:32:40 +01:00
Nick Clemens 1ea8d99319 Bug 31076: Handle year limits with equal sign or colon
To test:
1 - Enable ES and index
2 - Set expandedSearchOption to 'show'
3 - Advanced search on staff and opac using Year field on staff and Publication date range on OPAC for:
    2005
    2005-
    -2005
    <2005
    >2005
    2005-2010
4 - Confirm ranges don't work on staff side, but do on opac
5 - Apply patch
6 - Repeat searches - they work on both staff and opac
7 - prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a11633379f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a72ecc3b27)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-10-19 05:07:19 +02:00
Fridolin Somers b3d4270a0e Bug 22605: (RM follow-up) Fix test suite
See https://jenkins.koha-community.org/view/master/job/Koha_Master_D10/560/

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2ed5de93d9)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-10-19 05:07:19 +02:00
Fridolin Somers fd853a50f3 Bug 28327: (follow-up) Comma as default CSV delimiter
Looks like most of existing code wants comma as default value.

Also impact installer/data/mysql/mandatory/sysprefs.sql.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7b645b0208)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4cf509b248)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-10-19 05:07:19 +02:00
Fridolin Somers 8bf8f1116f Bug 28327: Add unit tests
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a2e9b44074)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 41b645bad4)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-10-19 05:07:19 +02:00
Arthur Suzuki 83bd5c6b92 Bug 30779: fix t/db_dependent/ImportBatch.t tests count
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-10-19 05:07:19 +02:00
Tomas Cohen Arazi 89cfa3f37b Bug 31473: Fix fragile test about bad OpacHiddenItems conf
There's been a behavior change in recent MariaDB that made some cases
deal with truncated data in DOUBLE context instead of DECIMAL.

Probably this:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-27380

This made the affected test fail consistently on those versions.

This trick for checking OpacHiddenItems is correct (as introduced on bug
28125 doesn't really make use of the warning, just prints it in
about.pl) so one option was to just check for a warning.

I decided to keep the test, but add the optional DECIMAL|DOUBLE check on
the qr. This way other eventual changes will make it fail and serve as a
warning in case something more relevant changes.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3a5fb22ad8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit aebaf2495b)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-10-12 17:20:46 +02:00
Nick Clemens dd4deaadfc Bug 30779: Remove _update_import_record_marc and update tests
This patch removes the now unused: _update_import_record_marc

Additionally, as items are already present in import biblio we no longer need to embed
them, so that parameter is removed and the option removed from the sub and pod and everywhere
it was used

In all cases, we were embedding, so we don't need a way to get without

Tests updated

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b02b66acf5)
(cherry picked from commit 54ddc31c71)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-10-12 17:19:57 +02:00
Nick Clemens 85da1a4b16 Bug 26632: Remove two more occurrences
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 089f5a4cf5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 396fc44e2c)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-10-12 16:37:34 +02:00
Marcel de Rooy 9674c827a9 Bug 27849: (follow-up) Add test
Compacting the code a bit too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ad0aa754ee)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 558ee09dd5)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-10-12 15:08:57 +02:00
Kyle M Hall b42730ad9b Bug 31120: Add unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 511ae8298e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d23293acb5)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:54:53 +02:00