Commit graph

5887 commits

Author SHA1 Message Date
d23293acb5 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>
2022-09-02 20:17:54 +00:00
a53650a2f8 Bug 15187: (QA follow-up) Fix test permissions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e6947b7408)
2022-09-02 17:56:54 +00:00
8a636ee908 Bug 15187: (QA follow-up) Add unit test
This patch adds a unit test for the newly introduced filter.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 058d411643)
2022-09-02 17:56:39 +00:00
899898400f Bug 30838: (QA follow-up) Add unit tests
Two tests added, one in t/db_dependent/Circulation.t to catch the
initial setting of to_address at enqueue time and a second in
t/db_dependent/Letters.t to catch the correcting at send time.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 17:33:18 +00:00
bc95ffa3e3 Bug 31086: (QA follow-up) Add unit tests
This patch adds the unit tests for the change to Koha::Hold::store.

We test for and catch the exception introduced for both the create and
update cases.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0685f0f40)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 17:08:24 +00:00
51f33cbc20 Bug 31086: (QA follow-up) Fix failing tests
This test was missed first time around, branchcode needed adding to all
the calls to AddReserve.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bdddc7ee0a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 17:08:06 +00:00
20226a8082 Bug 31086: Update existing unit tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bf2a9b5279)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 17:07:41 +00:00
5775f6c9a9 Bug 31202: Don't remove optional SIP fields with a value of "0"
If the value of a SIP field is "0", that evaluates to false, so any calls to maybe_add with a value of "0" will not get added to the SIP response message.

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

Signed-off-by: Michal Urban <michalurban177@gmail.com>
JK: Adjust commit title

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 14:46:50 +00:00
7d2086663e Bug 31201: Prevent Pseudonymization.t to fail
It's failing if selenium/patrons_search.t failed before, they are using
the same code and the selenium tests didn't clean correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ed83d77445)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 14:32:08 +00:00
555efbd447 Bug 27683: Unit test for GetAnalyticsCount
Run prove t/db_dependent/Items/GetAnalyticsCount.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd7652255c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 19:37:26 +00:00
Michal Urban
2dfd3b05e7 Bug 30447: Unit tests
Added tests to ensure that Koha::Holds->get_items_that_can_fill returns items with datecancelled and datearrived
Added test for correct number of items for each call of "get_items_that_fill"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b4a9edc83f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 19:34:59 +00:00
5974ff87c7 Bug 29105: Unit test
This patch adds a unit test for the addition of effective_item_type_id
to the items responses.

Test plan
1) Run the unit test prior to applying the second patch and confirm it
   fails
2) Apply the second patch and confirm the unit test now passes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6ca908816f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 19:18:47 +00:00
cef190f71c Bug 30882: (QA follow-up) Fix tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f8f9231562)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 18:04:28 +00:00
37e560ce88 Bug 29632: Unit tests
This patch adds unit tests, as well as changing existing test to use a mock
and read the data as passed in tests, rather than relying on what exists in
the DB

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 295987a061)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 17:35:28 +00:00
e9fde507b6 Bug 31069: Remove ExplodedTerms dependency on templates
This patch removes the use of templates and CGI in ExplodedTerms by using the
Koha::I18N library.

The functionality on the package is too simple, and messing with the
template paths complexity on the tests was too much, given we have a
nice way to have translatable strings at the package level.

This patch does that, and cleans up the test file as well, that required
complex template and CGI mocking to run properly.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/SuggestionEngine_ExplodedTerms.t
=> FAIL: It fails in master
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass
4. Follow the original test plan
=> SUCCESS: Things work
5. Enjoy the rest of the day and forget this ever happened

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 17:15:18 +00:00
63bd50e721 Bug 29094: Adding hold via SIP should check if patron can hold item first
When placing holds via SIP2, there is no holdability check. This seems very incorrect.

Test Plan:
1) Apply this patch
2) prove -r t/db_dependent/SIP

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7b21fb020b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 17:12:15 +00:00
f349393bd0 Bug 31134: Mock EdifactLSQ for t/Edifact.t
This patch adds a mock for the EdifactLSQ preference so we can
consistently pass when a database is not available.

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

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 16:10:46 +00:00
0a0a459a0d Bug 31139: Fix basic_workflow.t
Error while executing command: element not interactable: Element <input id="tag_952_subfield_w_810691" class="input_marceditor items.replacementpricedate noEnterSubmit flatpickr-input" name="items.replacementpricedate" type="hidden"> is not reachable by keyboard at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Not sure if it's coming from bug 30717 or not. git bisect told me it was the culprit but we released 22.05 and it seems that we got basic_workflow.t green since then.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 083769164b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 16:03:24 +00:00
9d251e587c Bug 31145: Supply defaults for vendors and funds
This is a convenience bug - when koha testing docker creates sample vendors and budgets there are small issues:

1 - The vendor website gets a random string - you can't edit the vendor without removing this
2 - The funds have random values for statistical categories, and you get empty dropdowns when choosing a fund in ordering

To test:
1 - Apply patch
2 - Restart all
3 - Edit 'My vendor'
4 - note webstie is empty and you can save without changing anythign
5 - Add order to basket for my vendor
6 - Confirm that when selecting a fund statistic 1 and statistic 2 remain as text input fields

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 15:59:16 +00:00
Julian Maurice
76e980bb1a Bug 29333: Fix encoding of imported UNIMARC authorities
MARC::Record and MARC::File::* modules sometimes use the position 09 of
the leader to detect encoding. A blank character means 'MARC-8' while an
'a' means 'UTF-8'.

In a UNIMARC authority this position is used to store the authority type
(see https://www.transition-bibliographique.fr/wp-content/uploads/2021/02/AIntroLabel-2004.pdf [FR]).
In this case, 'a' means 'Personal Name'.

The result is that the import will succeed for a Personal Name
authority, but it will fail for all other authority types.

Steps to reproduce:
0. Be sure to have a Koha UNIMARC instance.
1. Download the MARCXML for "Honoré de Balzac"
   curl -o balzac.marcxml https://www.idref.fr/02670305X.xml
2. Verify that it's encoded in UTF-8
   file balzac.marcxml
   (should output "balzac.marcxml: XML 1.0 document, UTF-8 Unicode
   text")
3. Go to Tools » Stage MARC for import and import balzac.marcxml with
   the following settings:
   Record type: Authority
   Character encoding: UTF-8
   Format: MARCXML
   Do not touch the other settings
4. Once imported, go to the staged MARC management tool and find your
   batch. Click on the authority title "Balzac Honoré de 1799-1850" to
   show the MARC inside a modal window. There should be no encoding
   issue.
5. Write down the imported record id (the number in column '#') and go
   to the MARC authority editor. Replace all URL parameters by
   'breedingid=THE_ID_YOU_WROTE_DOWN'
   The URL should look like this:
   /cgi-bin/koha/authorities/authorities.pl?breedingid=198
   You should see no encoding issues. Do not save the record.
6. Import the batch into the catalog. Verify that the authority record
   has no encoding issue.
7. Now download the MARCXML for "Athènes (Grèce)"
   curl -o athènes.marcxml https://www.idref.fr/027290530.xml
8. Repeat steps 2 to 6 using athènes.marcxml file. At steps 4 and 5 you
   should see encoding issues and that the position 9 of the leader was
   rewritten from 'c' to 'a'. Strangely, importing this batch fix the
   encoding issue, but we still lose the information in position 09 of
   the leader

This patch makes use of the MARCXML representation of the record instead
of the ISO2709 representation, because, unlike
MARC::Record::new_from_usmarc, MARC::Record::new_from_xml allows us to
pass directly the encoding and the format, which prevents data to be
double encoded when position 09 of the leader is different that 'a'

Test plan:
- Follow the "steps to reproduce" above and verify that you have no
  encoding issues.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 01d78e1ec7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-23 15:30:11 +00:00
d1770d4c49 Bug 31106: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 73ca6e2f57)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-12 14:39:03 +00:00
f38f548347 Bug 31179: (QA follow-up) Set field as hidden for tests
We want the tests to pass in the case where field is set to visibile in Koha

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d24cb97b06)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-12 14:30:02 +00:00
210a62cc3d Bug 31179: Don't copy invisible subfields when duplicating items
Duplicate item is intended to duplicate the visible cataloging fields of an item, however,
currently it is duplicating the complete internal record of the item

To recreate:
1 - find an item in Koha staff client, copy the barcode
2 - Issue this item to a patron
3 - Return to the record
4 - Edit items
5 - Click 'Actions->Duplicate' for the item in question
6 - Save the item
7 - Note in the items table above for that 'Total checkouts' 'Due date'
 etc. have not been copied to new item

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b90787d5c8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-12 14:29:34 +00:00
91c4d41115 Bug 29958: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3684a53dc3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-09 22:07:08 +00:00
Kevin Carnes
d6a3a10fc7 Bug 30152: Elasticsearch - queries with OR don't work with limits
When a query with "OR" is combined with a limit in Elasticsearch, the precedence is not preserved and the results are not correct.

To test:
1) Set SearchEngine to Elasticsearch
2) Index records in Elasticsearch
3) Do an advanced search
4) Select More options
5) Enter a value for the first Keyword (e.g. Novels)
6) Change "and" before the second Keyword to "or"
7) Enter another value for the second Keyword (e.g. Prose)
8) Limit the search (e.g. Item type Books)
9) Do the search
10) Observe that records with the first keyword are not in the results
11) Apply the patch
12) Repeat the search
13) Observe that results with both keywords are in the results
14) Sign off

Sponsored-by: Lund University Library

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3ed649a0e0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-08-09 22:03:17 +00:00
484add49de Bug 30889: (follow-up) Warn if context is not defined
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit de90b39b4c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 17:25:21 +00:00
2b4eb64563 Bug 30865: Double-quote Host-item in Koha::Biblio->get_components_query
This patch adds double quotes around the term qualified by "Host-item"
in Koha::Biblio->get_components_query().

Without them, reserved charactrs like "=" will cause syntax errors like
"CCL parsing error (10014) Unknown qualifier ZOOM for query:
    Host-item=(MyTitle = Mysubtitle)
    at /usr/share/koha/lib/C4/Search.pm line 245."

Test plan:
0) Don't apply the patch
1) Create biblio with title and subtitle like (MyTitle : MySubtitle)
2) Note the warning "There was an error searching for analytic records,
   please see the logs for details." on the detail page
3) Apply the patch
4) koha-plack --restart kohadev
5) Refresh the detail page
6) Note that the warning message is gone
7) prove t/db_dependent/Koha/Biblio.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd385d90b8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 17:23:01 +00:00
248dc2787e Bug 30744: Use RecordProcessor in get_marc_notes
This patch utilises RecordProcessor to filter the MARC::Record for the
right interface prior to constructing the marc notes array.  We also
remove the use of C4::XSLT for replacing AV values in the MARC fields in
preference to using the RecordProcessor filter.

Signed-off-by: David Nind <david@davidnind.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>
(cherry picked from commit 029d7bacf0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 17:21:23 +00:00
4edaa27fc2 Bug 30848: Add exec flag to test
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8c926c976a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 17:16:12 +00:00
66999034d4 Bug 30848: Expand unit tests
Add to the unit tests to test Library and Itemtype expansions as well as
linking multiple subfields of the same marc field to such expansions.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6b04e3e18f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 17:15:42 +00:00
0a86104294 Bug 30848: Add an ExpandCodedFields RecordProcessor filter
This patch introduces a RecordProcessor filter for MARC::Record objects
that replaces Koha codes with descriptions in the MARC::Record passed to the processor.

Target usage:

  my $biblio = Koha::Biblios->find(
      $biblio_id,
      { prefetch => [ metadata ] }
  );

  my $record = $biblio->metadata->record;

  my $processor = Koha::RecordProcessor->new(
    {
        filters => ('ExpandCodedFields'),
        options => {
            interface     => 'opac',
            frameworkcode => $biblio->frameworkcode
        }
    }
  );

  $processor->process( $record );

Test plan
* Read the included unit test and confirm it makes sense and passes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 62bba6d9e1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 17:15:30 +00:00
dd65a03ab8 Bug 30889: Unit tests - process
This patch adds corresponding unit tests for the 'process' side of this
patchset. We check that the Context for the job to run in as set from
the Job context recorded at enqueue time.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 17:06:15 +00:00
8dcc54e8d7 Bug 30889: Unit tests
This patch adds a unit test for the 'enqueue' part of the bug. We check
that the mocked context (and interface) are recorded with the job
enqueue in the new 'context' field.

We do not yet test the 'process' end, where we then read the context out
and set the job Context from it.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 17:06:01 +00:00
488c1a71c9 Bug 30327: Add options for sorting components
This patch adds two new sysprefs:
 ComponentSortField
 ComponentSortOrder

These allow the user to choose how components should be sorted when displaying on the details page
of a record, and the corresponding search for all components

This also updates our search from simple_search_compat to search_compat to allow for sorting options

Note:
Some sorting under ES is unclear - this is a separate issue to be invesitgated
Our Zebra index does not offer 'record number' sorting, I will file a bug for that

To test:
 1 - Enable UseControlNumber (or not)
 2 - Add some components to a record by control number or title depending on above
 3 - Enable  ShowComponentRecords  syspref
 4 - View the record that has components
 5 - Note they are not sorted
 6 - Apply patch, updatedatabase
 7 - reload record
 8 - Note components are sorted by title ascending
 9 - Try different values for ComponentSortField and ComponentSortOrder
10 - Confirm sorting changes with system preferences
11 - Repeat test on staff and opac, with ES and Zebra search engines

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

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 16:33:03 +00:00
9f3b51216a Bug 29454: (follow-up) Cover more test cases
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 75fe055dcc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 15:54:53 +00:00
c207d740cd Bug 29454: Add unit test for Koha::Template::Plugin::ItemTypes
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 338ca787be)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 15:54:36 +00:00
Kevin Carnes
22c9ea9737 Bug 25669: (follow-up) Minor fixes
Bulk doesn't support include_type_name, update requirement to
Search::Elasticseach@6.80, and remove data type name from tests.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e926de5e8f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 15:28:00 +00:00
584c49961c Bug 31013: Quote branchcodes in Elasticsearch limits
This patch adds quoting when handling branchcodes in searching in order
to prevent errors when branchcodes are reserved words in ES

To test:
0 - Be using Elasticsearch with Koha
1 - Add a new branch code:OR name:Orly
2 - Add an item to this branch
3 - Use advanced search to limit search to only Orly
4 - Oh really bad, the search fails!
5 - Apply patch
6 - Repeat search
7 - Oh really good, the search succeeds
8 - prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a4c5bd5836)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-29 15:11:44 +00:00
fea07bfab8 Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t
to test...

1/ run prove, test is not run :(
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 0

2/ apply patch

3/ run prove, test is run :)
 prove ./t | grep 00-check-atomic-updates.t | wc -l
 2

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

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-26 16:46:00 +00:00
12b90bb02f Bug 12630: Rebase tests and cover CheckReserves
It turns out we do honor reservedate in CheckReserves, so a hold with a lower priority will
fill before a hold in the future. I add tests to cover this and fix the old tests to pass again

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-15 17:37:46 +00:00
Jonathan Druart
475a5b3fb2 Bug 12630: Add regression tests
Verify that the 2 tests failed before applying this patch and return
green after.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2369076f99)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-15 17:37:34 +00:00
aa7c47cfed Bug 30409: (QA follow-up) Avoid uninitialized variable warnings
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 730719c90c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-13 13:50:08 -06:00
Petro Vashchuk
391cb02d45 Bug 30409: barcodedecode() should always trim barcode
Barcode is trimmed of leading/trailing whitespaces in many instances
before the barcodedecode sub was called. This patch instead makes that
barcodedecode sub is going to trim it itself and removes unnecessary,
and repetitive code that was used before barcodedecode was called.

Steps to test:
1. Edit item with any barcode, add a bunch of whitespaces at the start
and at the bottom of it. Save the item. Ensure that this action ruins
the barcode and ensure that the spaces are still there by editing the
same item again.
2. Apply the patch.
3. Edit the same item again in the same fashion. Ensure that now all
whitespaces are getting trimmed and it doesn't affect the barcode in
any negative way.

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

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-13 19:44:18 +00:00
74318f7686 Bug 30780: Regression tests
This patch lowers the used permissions on the suspend/resume tests, and
adds tests for fine-grained permissions on cancelling a hold.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-13 19:39:13 +00:00
efcd9f8798 Bug 30399: Make Patron.t pass even if mandatory attributes exist
t/db_dependent/Koha/Patron.t is failing if mandatory attributes already
exist in the DB. We can make it pass easily by deleting all the
attributes before we run the tests.

Test plan:
  prove t/db_dependent/Koha/Patron.t
must return green even if one mandatory patron attribute exists.

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 523a2f297d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-13 19:07:43 +00:00
Michal Urban
f5144061ef Bug 30768: Capitalizing "pin" in 2FA setup
Change of text from "pin" to "PIN" in the 2FA setup interface.
This slight changes clarifies that "PIN" is an acronym,
 and increases user comprehension

To test:
1) Log in as an Administrator
2) Enable TwoFactorAuthentication
3) Log in to a user with superlibrarian permissions.
4) On the user profile page, click the "More" dropdown button,
click "Manage Two-Factor
5) Check that "pin" is displayed in lowercase, in both instances.
6) Apply patch.
7) Refresh the page and observe that "pin" has changed to "PIN"
8) Sign off.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ed4250e7a9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 19:33:55 +00:00
9fa5cf04ae Bug 30677: 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: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit de4fcc91f0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 17:11:18 +00:00
7c872c1968 Bug 30057: Move virtualshelf-related exceptions to a separate library
This patch moves the not-generic virtualshelf-related exceptions to
their own file. Callers are adjusted as required.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Virtualshelves.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass
4. Check virtualshelves work as expected
5. Sign off :-D

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

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 7704f51d51)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 16:15:12 +00:00
f3603ab9dc Bug 29871: Remove marcflavour param in Koha::Biblio->get_marc_notes
Test plan :
Display a biblio record with some MARC notes in details page and basket,
OPAC and staff
Run prove t/db_dependent/Koha/Biblio.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b74ce12b85)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 15:54:27 +00:00
2dbf1bf80f Bug 31005: Unit test
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39c3943076)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 09:46:05 -06:00