Commit graph

44383 commits

Author SHA1 Message Date
f0fc5916db Bug 30007: (follow-up) Adjust Koha::Patrons->search_patrons_to_anonymise tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
812e1a5bb1 Bug 29857: (follow-up) Fix t/db_dependent/api/v1/transfer_limits.t
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
af601225bb Bug 29857: (follow-up) Fix t/db_dependent/Koha/BackgroundJobs/BatchUpdateBiblio.t
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
6573dd7ef9 Bug 29857: (follow-up) Fix t/db_dependent/Koha/Club/Hold.t
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
85c4ac7582 Bug 29857: (follow-up) Fix t/db_dependent/Koha/Plugins/Plugins.t
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
a7d941f31d Bug 29857: (follow-up) Fix t/Koha/REST/Plugin/Query.t
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
bbbb88f035 Bug 29857: (follow-up) Fix t/db_dependent/Koha/Patron/Modifications.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
5213c65cea Bug 29857: (follow-up) Fix t/db_dependent/Auth.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
d0e6731075 Bug 29857: (follow-up) Fix t/Koha/Email.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
007af54b5d Bug 29857: (follow-up) Fix t/Koha/Object/Message.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
9980a0f750 Bug 29857: (follow-up) Fix t/db_dependent/Koha/Biblio.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
279c63ad98 Bug 29857: (follow-up) Fix t/Koha/Plugins/Tab.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
86b853c7c6 Bug 29857: (follow-up) Fix Barcode_transform_hooks.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-02 09:40:05 -10:00
Katrin Fischer
fab5fdfc31 Bug 29589: (follow-up) Add TT filter
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
4df305bf19 Bug 29589: MARCOverlayRules - fix translatability issue
Strings must not contain html tags, we should use KohaSpan instead.

Test plan:
Apply the patch, update translation for a given language, edit XX-YY-staff-prog.po

Notice that the string is now
"The %s preference is not set, don't forget to enable it for rules to take effect."

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
b6de822ad6 Bug 30035: Fix month name in prediction pattern
We are using %B to display the month name but it seems that using the
CLDR pattern LLLL would be more appropriated.
https://metacpan.org/pod/DateTime#CLDR-Patterns
%B   - The full month name.
LLLL - The wide stand-alone form for the month.

For instance in Catalan:
https://metacpan.org/pod/DateTime::Locale::ca
%B will display "de gener" when LLLL will be "gener"

Test plan:
Create a new numbering pattern:
Home > Serials > Numbering patterns > New numbering pattern
Numbering formula: {X}
Label: monthname
Add: 1
Every: 1
Set back to: 1
When more than: 999
Formatting: Name of month
And test it at the bottom of the form
Locale: Catalan
The number column should contain "gener", not "de gener"
Test other locales and confirm that the output is correct (no change
expected for English, French and Spanish for instance).

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
b95602fcfd Bug 29687: Uninitialized warning C4/XSLT line 286
From plack-opac-error.log:
[WARN] Use of uninitialized value $value in concatenation (.) or string at /usr/share/koha/C4/XSLT.pm line 286.

Test plan:
An opac search triggered the warning. So repeat it without warns.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
fd1c259c0d Bug 30185: Missing return in db rev 210600003.pl
db rev files are constructed with a return {...}, db rev 210600003.pl is missing return word.
I don't know if it can impact the db upgrade but we should fix it for consistency.

To test upgrade from a version 21.05 and check db rev is applied.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
42181dfce7 Bug 30023: Make MarkIssueReturned use ->anonymize
Koha::Old::Checkout->anonymize takes care of checking the syspref and
raises an exception if not set. So no we can now leverage on it, instead
of checking manually and then tweaking the checkout object manually as
well.

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
bafd1c25e9 Bug 30023: Add Koha::Old::Checkout->anonymize
This patch adds the mentioned method. It replicates the Koha::Old::Hold
behavior, including the exception thrown on bad configuration.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Checkout.t
=> SUCCESS: Test pass
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
c4e5e04f57 Bug 30007: Make ->anonymize methods throw an exception if AnonymousPatron is not set
This patch makes the ->anonymize methods throw a
Koha::Exceptions::SysPref::NotSet exception when trying to anonymize
holds and checkouts without AnonymousPatron properly set.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Checkouts.t \
           t/db_dependent/Koha/Old/Holds.t \
           t/db_dependent/Koha/Old/Hold.t
=> FAIL: Tests fail, no exception thrown
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

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

https://bugs.koha-community.org/show_bug.cgi?id=3007
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
7ebeb58bfd Bug 30007: Add Koha::Exceptions::SysPref
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>

https://bugs.koha-community.org/show_bug.cgi?id=3007
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
8d63dd3760 Bug 30007: Regression tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

https://bugs.koha-community.org/show_bug.cgi?id=3007
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
c287121471 Bug 29857: (QA follow-up) Fix unit test Object.t
Unit test failling with :
    #   Failed test 'Exception message correct'
    #   at /kohadevbox/koha/t/db_dependent/Koha/Object.t line 335.
     #          got: 'Exception 'Koha::Exception' thrown 'Asked to embed items but its return value doesn't implement to_api'
    # '
    #     expected: 'Asked to embed items but its return value doesn't implement to_api'
     # Looks like you failed 1 test of 29.

Fixed by using $@->message like in other places.

prove t/db_dependent/Koha/Object.t

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
6ece7185b0 Bug 29857: (QA follow-up) Add license
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
3951145cf7 Bug 29857: Fix behavior
This patch makes:
- passed parameters be rendered alphabetically to allow testing.
- only the defined parameters be rendered in the string
- the method honor the fact that $self->message should be returned if
  passed to the constructor (i.e. if the developer called
Koha::Exceptions::MyException->throw( $string ) they will expect $string
to be rendered.

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/Koha/Exceptions.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
c10640e8a7 Bug 29857: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
2b9fae5445 Bug 29857: Rename base class as Koha::Exception
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
7429f28cfc Bug 29857: Provide a generic full_message method for our exceptions
We pass useful information when throwing exceptions, but we don't
display them! We must display all the details we need when the exception
is stringified.

Test plan:

Use the following snippet:
  use Koha::Exceptions::Elasticsearch;
  Koha::Exceptions::Elasticsearch::BadResponse->throw( type => "a good type", details => "and some details" );

Execute it without and with the patch.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
42096deea4 Bug 29857: Make the exception classes inherit from the base class
We have a base class Koha::Exceptions::Exception but it's not used in
most of our exception classes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
5daa64ca10 Bug 30164: Fix datatable wrapper when no filter passed
This problem appears (at least) on the cities list view:
If you pass a filter in the "Search cities" filter in the header, it
won't be taken into account and all the cities will be displayed.

There are two problems. First we are passing an "empty" q=[] in the
body, the filter from the header is passed as URL parameters. We should
not need to pass the q if it's empty.
Then the main problem is coming from a bug in
Koha::REST::Plugin::Query but I didn't manage to track it down. If we
have two 2 passed, only the second one will be used. We are certainly
using a hash somewhere we should not.

This patch is fixing the bug but not on the correct side. A follow-up
bug should take care of the main problem at lower level.

Test plan:
Hit /admin/cities.pl
Create some cities
Use the filter in the header of the page and submit
=> Without this patch all cities are retrieved
=> With this patch applied only the relevant cities are displayed.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
edfc821042 Bug 29338: (follow-up) only show print button when hold is waiting or intransit
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
b1bcf39200 Bug 29338: Add print hold/transfer button to request.tt
1. Apply patch
2. Make some holds, have some item level and some bib level
3. On request.tt notice a new column on the holds_table called 'Print hold/transfer slip'
4. Make sure the button works and takes you to the proper hold/transfer slip
5. Make sure it works well with both item/bib level holds

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
6a0d6b8bc3 Bug 30153: (QA follow-up) Fix unit tests
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:47 -10:00
Thomas Klausner
289551282d Bug 30153: Use uppercase AND to join query parts
C4::Search->FindDuplicate joins title and author using 'and'
(lowercase). When this query is passed on to ElasticSearch, it
interprets the lowercase 'and' as a term to search for, because the
operator has to be in uppercases ('AND').

Test plan:
* Reproduce the bug:
- Set SearchEngine to ElasticSearch (and make sure you have the data
  indexed etc)
- Find an existing book, note the title (245a) and the author (100a)
- Create a new book (Cataloging -> New Record)
- Fill in the same title and author using the same data as in an
  existing book (and any other fields that might be required)
- Click "save"
=> A new book will be created, the Duplicate Finder has failed

* Apply the patch

* Check if it's working now:
- Create a new book (Cataloging -> New Record)
- Fill in the same title and author using the same data as in an
  existing book (and any other fields that might be required)
- Click "save"
- The DuplicateFinder should now report the already exising book

Maybe we should also check if Zebra does not have any problems with the
uppercase 'AND'? In that case, repeat the above steps, but set
SearchEngine to Zebra :-)

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
a358f5b9ef Bug 29287: Add child funds to display of parent funds on acqui home
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Michael Sutherland <sudrland@vt.edu>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
David Schmidt
17ed92b6dd Bug 30132: Fix POD, show correct usage of Getopt::Long
the USAGE of overdue_notices.pl shows options such as -date OR
-csv that should be written with double dashes like --date or --csv

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
e63783a817 Bug 28663: Prevent discounts against void lines
With the introduction of double entry accounting for VOID actions, we
need to add an additional filter to the 'Apply discount' button appearance

Test plan
1/ Add a debt
2/ Pay the debt
3/ Void the payment
4/ Confirm that with the patch applied the 'Apply discount' button does
not appear on the 'Void' accountline.

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
3de4031de1 Bug 25025: Drag-and-drop cover image upload
This patch updates the Upload local cover image page so that the user
has the option of dragging a file from a folder on their computer
instead of using a file upload button.

The patch also adds a preview of uploaded single images and display of
existing images on the record you're adding to.

To test, apply the patch and make sure the LocalCoverImages system
preference is enabled.

- Go to Tools -> Upload local cover image and test the following
  processes:

- Upload single cover image, specifying a biblionumber
  - Test dragging an image from a file on your computer
  - Test clicking the "Drop files here or click..." link.
    - You should see a preview of the image file on the screen, with
      information about the file: file name, image type, file size.
      - Click "Process images"
        - with "Existing covers will be replaced" checked
        - with "Existing covers will be replaced" unchecked

  When the upload process completes you should see information about the
  title in the page heading and a thumbnail of the cover in the sidebar.
  - Test that the image can be deleted from this page. You should be
    redirected back to this page with the same title still selected.

- Upload a zip file of images
  - Test dragging an image from a file on your computer
  - Test clicking the "Drop files here or click..." link.
    - A zip file can't be previewed onscreen but you should see the same
      file information and a Font Awesome "zip file" icon.
      - Click "Process images"

From the bibliographic detail page, click the "Images" tab, and click
"Upload." With this workflow the field asking for a biblionumber should
not appear.

From the bibliographic detail page, in the holdings table, choose Edit
-> Upload image. This process should be the same as above but should
provide item information on the screen. Confirm that images are uploaded
correctly to the specific item.

Test with AllowMultipleCovers enabled and disabled to confirm that the
"Existing covers will be replaced" checkbox is enabled only when
multiple covers are possible.

Signed-off-by: Solène Desvaux <solene.desvaux@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
e33742c676 Bug 20689: (follow-up) Correct scope of template variables
The removal of the <select>s should have been accompanied by a
correction to the scope of tagfield and tagsubfield. It is also
unnecessary to conditionally include the "value" attribute.

To test, apply the patch and test the process for editing an item search
field. All the correct values should appear in form fields during edit,
and all values should save correctly.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
2884573f9a Bug 20689: (follow-up) Tiny typo fix
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
97d4689772 Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields
This patch adds some custom validation to the MARC tag and subfield
fields so that they are limited to alphanumeric characters.

Both templates (the main view and the edit view) have been modified so
that item_search_fields.js can be included in both.

To test, apply the patch and test the form by entering a variety of
different character combinations. The "MARC field" and "MARC subfield"
inputs should only accept alphanumeric entries.

Test both "new" and "edit" operations.
Test other operations like delete and cancel.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jose-Mario <jose-mario.monteiro-santos@inLibro.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
Katrin Fischer
c4f7a40793 Bug 20689: Replace marc (sub)field pull downs with input fields on item search fields config
The pull down for marc subfields on the item search fields config page is
long and hard to use. It also doesn't include the commonly used
upper case letters for custom item subfields.

Also hard to use with its 999 entries is the marc field list. It doesn't
allow for tags like 01e, which exist in our MARC21 default framework.

To test:
- Go to Administration > Item search fields
- Add different mappings with and without subfields
- Verify the entered values are stored correctly
- Edit mappings
- Verify editing works and changes save correctly

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
eec528c3f6 Bug 30084: Remove dependency of liblocale-codes-perl (follow-up)
trival patch, no test plan

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-01 22:47:46 -10:00
4cc3c0a760 Bug 30133: (follow-up) Update objects.search POD
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-24 14:35:36 -10:00
feb49d5088 Bug 30133: Fix pagination in /biblios/:bibio_id/pickup_locations
This patch does the same thing we did for items on the previous patch,
but for biblios. The tests are almost the same as well.

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

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-24 14:35:36 -10:00
07893d66e8 Bug 30133: Simplify code
This patch simplifies the code, and also fixes a problem with branchcode
comparisson failing, highlighted when running the tests

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/items.t
=> FAIL: Tests fail. Notably:
- Link header pagination is wrong
- X-*Total-Count headers have two values (dupicated)
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-24 14:35:36 -10:00
1758b58642 Bug 30133: Avoid calling c->objects->search twice
Calling this twice sets double pagination headers, which messes up the page for the requests and
retrieves on ly the end of the list

This patch simply avoids a doulbe call

TO DO: must implement same for Biblio->pickup_locations and cover with tests
this also returns all as needing override

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-24 14:35:36 -10:00
60b07917f3 Bug 30133: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-24 14:35:36 -10:00
75ab422aad Bug 29703: Use get_effective_rules in GetBranchItemRule
To test:
1 - prove -v t/db_dependent/Circulation/Branch.t

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-24 14:35:36 -10:00