Commit graph

44052 commits

Author SHA1 Message Date
041808bc70 Bug 27946: (QA follow-up) Remove 'scan' terminology, requests may not be scans
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:07 -10:00
f5536c566e Bug 27946: Add UI handling of AR fees
This patch:
- Adds a notice about the fee to be charged to the patron (staff and
  OPAC)
- Adds the right UI description for ARTICLE_REQUEST_FEE debit types in
  the UI.

To test:
1. Have some article request fee rules
2. Play with placing an article request in OPAC and staff
=> SUCCESS: You see a message about the fee
=> SUCCESS: The fees are correctly applied to the patron
3. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:07 -10:00
b4fd79e750 Bug 27946: Make Koha::ArticleRequest->request add a fee if required
This patch makes the ->request method add a fee for the patron if
required. It relies on methods defined in Koha::Patron for the task. The
debit line is linked to the AR if applies.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:07 -10:00
d5c8aad712 Bug 27946: Article request fee methods in Koha::Patron
This patch adds article_request_fee() and add_article_request_fee_if_needed() methods to Koha::Patron.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:07 -10:00
62c340f06a Bug 27946: Add article request fee to circulation rules
This patch adds a new circulation rule: article requests fee.

It can be set per library and category.

To test:
1. Try setting sdifferent numeric values, change, and delete them
=> SUCCESS: Things work as expected
2. Make sure rules are loaded correctly when re-entering the circ rules
   page
=> SUCCESS: All good
3. Verify the data on the DB is stored as it should on each of your
   tests:
   $ koha-mysql kohadev
   > SELECT * FROM circulation_rules \
     WHERE rule_name='article_request_fee';
=> SUCCESS: All good (remember NULL => 'All' in the UI)
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:07 -10:00
2946891d21 Bug 27946: Add article_requests.debit_id and ARTICLE_REQUEST account debit type
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:07 -10:00
e1f7f3a661 Bug 21729: Update DBIC schema
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:07 -10:00
3d9dfe8e8c Bug 21729: DBRev 21.12.00.010
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
752318f7d6 Bug 21729: Add tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
baeea4533c Bug 21729: Simplify non-existent expiration date
No change in behaviour expected by this patch.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
b52f9adf08 Bug 21729: Keep expiration date set when placing a hold
The expiration date picked by the patron (or librarian) when placing a
hold is lost when a waiting hold is reverted.

We need a separate DB field to store this value and restore it when
needed: patron_expiration_date

The new behaviours are now:
Create a hold and specify an expiration date:
  expirationdate=patron_expiration_date

Fill the hold:
  expiration_date is calculated
  expiration_date set to the calculated value or to
patron_expiration_date if anterior
  patron_expiration_date not modified

Revert the waiting status:
  expirationdate set back to patron_expiration_date

Cancel expire reserves:
  if < expirationdate OR < patron_expiration_date
Note: This change should not be needed but won't hurt

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
ba5f0d39bd Bug 21729: DB changes
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
Katrin Fischer
450d0d117d Bug 29481: Terminology: Fix other occurrences of 'Collection code'
This changes "collection code" to be "collection" as Koha displays
the collection description and no codes. This will also help to make
the GUI more consistent overall.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
62a63fcffc Bug 29481: Terminology: Collection code, call number
This patch corrects an instance of the phrase "Collection code,"
replacing it with the standard "Collection."

To test, apply the patch and restart services.

- In the staff interface, go to Administration -> System preferences and
  set the OpacItemLocation preference to "library, collection code, and
  call number."
- In the OPAC, search the catalog using a term which will return
  multiple results.
- In the search results, item descriptions in the "Availability" line
  should read like this:

  [Collection, call number: Non-fiction 394.2663 Bu]

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

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-01-28 11:09:06 -10:00
46d3d63e46 Bug 29686: Adapt Koha to use new fulfillment API for OverDrive
This patch modifies the checkout_download_url routine in
WebSerivce::ILS::OverDrive::Patron

We now directly hit the fulfillment endpoint with redirects disabled
and fetch the URL

The overdrive.js is modified to use a single 'Get item' button for all
checked out items and to refer to the fulfillment page

To test:
1 - Enable all OverDrive system preferences
2 - Search on opac and confirm OD results returned
3 - Checkout an item
4 - Confirm you have the new 'Get item' button on 'OverDrive account'
    tab on opac-user.pl
5 - Confirm the 'Get item' button works

NOTE:
Most items will also show the 'Get item' button in results, however,
magazines may not as each checkout has a unique 'reserve id' and the
'parent' id is not checked in our current code

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
50bb0f6e42 Bug 29403: (QA follow-up) Add comments why test should fail
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
cb4c3a5e21 Bug 29403: Fix unit test for bug 29718
Including a 'T' is actually valid for ISO date format, I was being
naughty and writing the test to follow our code rather than writing the
test to conform to the ISO spec first time around. Now we are properly
supporting 'T' in ISO dates with bug 29718, we need to update the test
here to properly reflect an invalid ISO date string.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
The commit message is misleading here. Look at the Z in the code changes.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
df34a4d53f Bug 29403: Fix api/v1/patrons.t
t::lib::Dates::compare expects either correct DateTime objects, or a
system formatted datetime strings to be passed.. but as we're testing
the API, we are consistently using RFC3339 strings for date-times and
ISO8601 strings for dates.  We need to therefore pre-process the strings
into DateTime objects for the comparison.

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

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: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
9b3a443477 Bug 29403: Match the whole string
This patch wraps the constructed regex such that we expect the entire
regex to match and don't allow leading or trailing garbage.

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

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: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
f7683117f6 Bug 29403: Unit tests
Add a unit test for proper iso date handling

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
d8431acd77 Bug 29718: (QA follow-up) ISO 8601 allows +02 and +0200
The UTC offset is appended to the time in the form:
    ±[hh]:[mm], ±[hh][mm], or ±[hh]

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
5a8535c642 Bug 29718: (QA follow-up) Remove duplicate test
I'd inadvertantly introduced the exact same test twice!  This patch
removes the duplicate and annotates the test to clarify the timezone
handling expectations.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
3269c4db0a Bug 29718: Mock the timezone
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
8a66d8b106 Bug 29718: Unit 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: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
da34328fc1 Bug 29718: (QA follow-up) Add optional offset handling
ISO8601 optionally supports timezone offsets. If a timezone is ommited,
we should assume 'local' time (Which in our case is instance
configuration time), if we are passed 'Z' or 'z' we should set timezone
to 'UTC', otherwise we should set the timezone to the passed offset.

Whilst ISO8601 does NOT support AM/PM, I left that intact as it has
historical relevance in Koha and we share the ISO parsing with SQL type
parsing amongth other things.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:05 -10:00
9daea562a8 Bug 29718: (QA follow-up) Make 'T' check case insensative
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:05 -10:00
e1b2fd264d Bug 29718: Support ISO8601
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:05 -10:00
c200bf6bc9 Bug 28962: Add del-unv-selfreg to crontab
We also add a test by inserting a simulated borrower modification
record in the same table which should not be deleted.

NOTE: This patch fixes the del-unv-selfreg parameter in the
cleanup db script. It did not even do what it promised :)

Test plan:
Verify if the crontab change is correct.
Run t/db_dependent/Members.t

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
60ab9ddcfb Bug 29722: (QA follow-up) Replace unusual single quote
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
Aleisha Amohia
489f1d8d4d Bug 29722: Add more sample quotes
This patch adds sample quotes from women, women of colour, trans women,
Black and Indigenous women, and people who weren't US Presidents!

To test:
1. Install a fresh Koha and import sample quotes
2. Go to Tools -> Quote editor
3. Confirm the quotes show

Sponsored-by: Catalyst IT

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
Hayley Pelham
50d2f00d45 Bug 29054: Add verbose check for warn in advance_notices.pl
To test:
1) Set EnhancedMessagingPreferences to Don't allow
2) In the koha-shell, run misc/cronjobs/advance_notices.pl -c
3) Note that you see the warning "The "EnhancedMessagingPreferences"
syspref is off... etc."
4) Apply the patch and restart services
5) In the koha-shell, run misc/cronjobs/advance_notices.pl -c and note
the warning no longer shows
6) Still in the shell, run misc/cronjobs/advance_notices.pl -c -v and
note the warning does show

Sponsored-by: Catalyst IT
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
c5a4c193f4 Bug 29397: Add .kohaSelect select2 wrapper function
This patch adds a kohaSelect wrapper function to simplify
paging/infinite scrolling with select2 using the Koha RESTful api's.

Invoke select2 select boxes as you normally would from JS, but instead
of calling .select2(config) use .kohaSelect(config).

If an 'ajax' property is defined in your config object, we wrap the
transport such that responses include a pagination key as expected by
select2.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
f9bb92fb80 Bug 29797: Fix display of itemnumbers on the background job detail view
If some items have not been deleted, the detail view of the background job will display "1 item(s) could not be deleted: ", without the list of itemnumbers.
Also add a space character between itemnumbers.

Test plan:
1. Check an item out
2. Use the batch delete items tool to delete the item that is checked
out and another one.
3. On the confirmation view, use the dev tool of your browser to remove
the "disabled" property of the disabled checkbox and select both
items.
4. Submit
5. Go to the detail view of the background job and confirm that you see
the itemnumber of the item that has failed to be deleted

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
474a19e0f1 Bug 29156: File missing warning in Koha::UploadedFile for permanent files only
When an uploaded file is deleted, when file does not exist there is a warning :
"Removing record for file.txt within category koha_upload, but file was missing."

For temporary files, this warning is noisy.
For example when they are in /tmp, system reboot deleted them.

I propose to remove this warning for temporary files.

Test plan :
1) Upload a temporary and a permanent file via Tools > Upload
2) Delete the file on server
3) Delete the two files from Tools > Upload
4) Look at warning in log files
=> You see only warning for permanent file

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-01-21 21:34:51 -10:00
18e38b5b3e Bug 29837: Remove JS error during installer
Uncaught ReferenceError: _ is not defined

the _() function is called from calendar.inc, but calendar.inc is
 included before the definition of this function in
installer-intranet-bottom.inc

Test plan:
Confirm that the JS error is gone

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
3b555c54bb Bug 28943: (QA follow-up) Fix opac.pref
Fix YAML syntax of opac.pref, we must use dash for new lines.

Also removes duplicate text before syspref.
No need to say "code" since it is now a list of categories.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
54466c6bd7 Bug 28943: Lower the risk of accidental patron deletion
If you do not use a temporary self registration patron category,
you should actually make the preference
PatronSelfRegistrationExpireTemporaryAccountsDelay empty.

As the comment in sysprefs.sql already said, we should not let
a zero value in the pref delete patrons too.

The module is changed now, the test adjusted and
the description of both related sysprefs modified.

Test plan:
Run t/db_dependent/Members.t
Check in Administration the two adjusted OPAC pref descriptions.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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-01-21 21:34:51 -10:00
db07ca09cc Bug 29840: Deal with non-existing biblionumber in opac-reserve
We should not explode if the biblionumber passed in not in DB.

Test plan:
Hit /cgi-bin/koha/opac-reserve.pl?biblionumber=42424
and notice the error message.

Without this patch you got
Can't call method "holds" on an undefined value at
/kohadevbox/koha/opac/opac-reserve.pl line 172

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
53b693bae4 Bug 29838: Fix string interpolation in ImportBatch.t
Test plan:
Tests should return green

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
1aa2aa85d9 Bug 29865: Fix duplicate includes in circ/returns.pl
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
f88bbdada0 Bug 29646: (RM follow-up) Add space before colon
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
a1ac05193d Bug 29646: Fix undefined category crash in opac-password-recovery
The crash is a result of a not found borrower. This is typically
a bad or repeated recovery attempt.

Test plan:
Do a password recovery.
Use the mailed URL twice.
Without this patch, the second attempt crashes.
With this patch, the second attempt shows an error dialog.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-21 21:34:51 -10:00
Katrin Fischer
e653effe57 Bug 11750: (QA follow-up) Remove unconditional warn
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-19 12:13:49 -10:00
a5fd77be04 Bug 11750: Hide patron's attributes on overdue list if needed
If a patron's attributes is limited to some libraries, we must apply
this limit on the overdue list view.

Test plan:
1. Create the following patron attributes:
A that is not searchable
B is searchable and does not have library limitation
C is searchable and is limited to another library than yours
2. On the right part of the overdue list view you must see B only
Without this patch C is displayed as well.

Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-19 12:13:49 -10:00
43abf06b64 Bug 29764: Fix incorrect EmbedItems RecordProcessor filter POD
This patch makes the usage POD for the EmbedItems filter actually be
usable. The filter is used in opac-ISBDdetail.pl and the POD is updated
to how it is used there.

Not much to test.

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-19 12:13:49 -10:00
cf77d0f7b2 Bug 29806: (follow-up) Call ->as_list for ->pickup_locations on request.pl
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-19 12:13:49 -10:00
cdbfadbc92 Bug 29806: Fix POST /holds use of pickup_locations
This patch makes Koha::Item->pickup_locations and
Koha::Biblio->pickup_locations explicitly call ->as_list in list
context. This way we workaround bug 28871.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, the route gives a 500 (unhandled exception)
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass, the route correctly returns a 400 with a
message about the pickup location being invalid
5. Sign off :-D

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-19 12:13:49 -10:00
3eb2f8ebbe Bug 29806: Call ->as_list for ->pickup_locations on request.pl
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-19 12:13:49 -10:00
1207946665 Bug 29806: Regression tests
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-19 12:13:49 -10:00
fe0a0ee834 Bug 29807: Make Branches plugin handle empty pickup locations list
This patch makes the plugin handle empty Koha::Biblio->pickup_locations
and Koha::Item->pickup_locations correctly.

It does so by explicitly calling ->as_list. It also restores the logic
that was changed by 6cd1ffab4e so, now
that ->empty is handled correctly, it doesn't return ALL the pickup
locations when the item/biblio doesn't have valid pickup locations.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Template/Plugin/Branches.t
=> FAIL: Awful error
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-19 12:13:49 -10:00