It has been removed in the controller by the previous patch.
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: Chloé Zermatten <chloe.zermatten@openfifth.co.uk>
This patch forces download of invoice files rather than showing
them inline where they can potentially perform XSS
Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. Find or create an active vendor
3. Create a basket if one doesn't already exist
4. Receive a shipment for the vendor
5. Create an invoice
6. Go to the invoice
7. In the URL change invoice.pl to invoice-files.pl
(or turn on AcqEnableFiles and go to it that way)
8. Upload an image file (e.g. SVG) or PDF
9. Click on the filename
10. Note that instead of displaying in the browser,
the file will be downloaded
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: Chloé Zermatten <chloe.zermatten@openfifth.co.uk>
When a specific item is selected in the booking modal, the end date
disable logic was incorrectly checking if ALL bookable items were
unavailable before disabling a date. This meant dates with existing
bookings for the selected item remained selectable if other items
were available.
Now when a specific item is selected (booking_item_id != 0), the
logic checks if that specific item is in the unavailable_items list.
The "all items unavailable" check is only used when "Any item" is
selected.
This aligns the end date selection behavior with the start date
selection behavior, which already correctly checks only the selected
item.
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e58d39671f)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This commit fixes a bug where the trail period was preventing selection
of the maximum end date allowed by circulation rules, even when there
were no booking conflicts in the trail period.
The Problem:
============
The hover logic in place_booking.js checked if ANY disabled date fell
within the trail period and would prevent selection. However, dates can
be disabled for multiple reasons:
1. They conflict with an existing booking (correct reason to disable)
2. They are beyond the maxDate set by circulation rules (incorrect!)
3. They are in the past
When hovering over the max selectable end date, the trail period would
extend beyond the maxDate. Those dates were disabled by flatpickr
automatically, and the code incorrectly interpreted this as a booking
conflict, preventing selection of the otherwise valid max date.
The Fix:
========
Modified the trail period conflict check (lines 995-1005) to only
consider dates that are within the max date range. Disabled dates
beyond the maxDate are now ignored when checking for trail conflicts.
Before:
if (elemDate.isAfter(trailStart) && elemDate.isSameOrBefore(trailEnd)) {
trailDisable = true;
}
After:
if (elemDate.isAfter(trailStart) && elemDate.isSameOrBefore(trailEnd)) {
const maxDate = periodPicker.config.maxDate ? dayjs(periodPicker.config.maxDate) : null;
if (!maxDate || elemDate.isSameOrBefore(maxDate)) {
trailDisable = true;
}
}
This ensures trail periods only prevent selection when they conflict
with actual bookings, not when they extend beyond the circulation
rules' maximum date.
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 22c8829738)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This commit adds comprehensive Cypress tests for the lead and trail period
functionality in the bookings modal date picker. These tests validate the
hover effects, conflict detection, and date selection constraints.
The tests use cy.clock() to fix "today" to June 10, 2026, enabling
deterministic testing without date arithmetic complications.
Test coverage includes:
- Lead period visual hints (CSS classes on hover)
- Lead period conflict prevention with past dates
- Lead period conflict prevention with existing bookings
- Trail period visual hints (CSS classes on hover)
- Trail period conflict prevention with existing bookings
- Max date selection when trail period is clear (no false restrictions)
Test setup:
- Fixed date: June 10, 2026
- Lead period: 2 days
- Trail period: 3 days
- Issue length: 3 days with 2 renewals of 2 days each
- Max booking period: 7 days
- Blocker booking: June 25-27 (tests both lead and trail conflicts)
Test phases:
1. Hover June 13 - lead period (June 11-12) is clear, no leadDisable
2. Select June 13, hover June 16 - trail period (June 17-19) is clear
3a. Hover June 11 - lead period includes past date (June 9), leadDisable
3b. Hover June 29 - lead period overlaps blocker (June 27), leadDisable
4. Select June 20, hover June 23 - trail overlaps blocker, trailDisable
5. Select June 13, hover June 20 (max) - trail is clear, selectable
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9284a43817)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 928abfcdc2)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
When selecting a booking start date that triggers month navigation
(e.g., selecting Feb 1 while viewing January), the flatpickr calendar
would lose the 'startRange' CSS class on the selected date. This
occurred because setting maxDate in the onChange handler triggered a
calendar redraw, and flatpickr only applies startRange during the
initial click event, not during redraws.
This caused the Cypress test "should handle date range validation
correctly" to fail on dates near month boundaries (e.g., January 30).
The fix re-applies the startRange class after the maxDate is set,
using setTimeout to ensure it runs after the redraw completes. A
guard ensures this only happens when exactly one date is selected,
preventing interference with end date selection.
To test:
- Apply patch
- Open a biblio detail page with bookable items
- Click "Place booking"
- Select a patron, pickup location, and item
- In the date picker, click a date that's in the next month
(visible in the "next month" area of the calendar)
- Verify the selected date shows the startRange styling (highlighted
as the range start)
- Select an end date
- Verify the range is properly selected and the form can be submitted
- Run Cypress tests:
yarn cypress run --spec t/cypress/integration/Circulation/bookingsModalDatePicker_spec.ts
- Verify all tests pass
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 37c8b7544e)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1e4b9e33c7)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This patch addresses two critical issues in the booking modal:
1. Race condition in edit mode:
When editing a booking, the item selection would sometimes fail to
properly initialize because the item options weren't fully loaded
with their data attributes. This caused the itemtype field to not
auto-populate correctly.
Fixed by moving the item pre-selection to occur after a brief delay
and ensuring the select2:select event is triggered with proper data
parameters including the element reference.
2. Flatpickr redraw issue:
The datepicker would lose its disabled dates after certain operations
because the disable configuration wasn't being reapplied during redraws.
Fixed by explicitly setting the disable configuration before calling
redraw() to ensure disabled dates are properly maintained.
Additionally fixes a scope issue with the booking loop variable.
Test plan:
1. Create a booking with specific dates
2. Edit the booking - verify the item and itemtype are correctly selected
3. Change selections in the modal - verify disabled dates remain correct
4. Create new bookings - verify date restrictions work properly
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6c63cb90fa)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This patch adds comprehensive Cypress end-to-end tests for the booking modal,
covering all critical functionality to prevent regressions.
Test coverage includes:
- Basic modal functionality (bookingsModalBasic_spec.ts):
* Modal loading and initial state
* Progressive field enabling based on user selections
* Item type and item dependencies
* Form validation
* Booking submission (create and update)
* Form interactions and field visibility
* Edit mode functionality
* Error handling
- Date picker functionality (bookingsModalDatePicker_spec.ts):
* Flatpickr initialization with future-date constraints
* Date disabling for existing bookings
* Date range validation
* Circulation rules date calculations and visual feedback
* Lead and trail period functionality
* Event dots for dates with existing bookings
These tests ensure the booking modal works correctly across all scenarios and
helps maintain code quality during future development.
Test plan:
1. Run the tests inside KTD container:
docker exec --user kohadev-koha --workdir /kohadevbox/koha -i kohadev-koha-1 \
bash -c 'npx cypress run --spec "t/cypress/integration/Circulation/bookings*.ts"'
2. Verify all 15 tests pass (9 basic + 6 datepicker)
3. Confirm test coverage is comprehensive for the booking modal
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit acc2985e6a)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This adds helper methods for cypress to work with flatpickr date pickers:
- openFlatpickr() - open the calendar
- selectFlatpickrDate() - select a single date
- selectFlatpickrDateRange() - select date range
- clearFlatpickr() - clear the selected dates
- getFlatpickrDate() - get specific date element
- getFlapickrSelectedDates() - get flatpickr selected dates array
- navigateToFlatpickrMonth() - navigate calendar
These helpers simplify date picker testing when using flatpickr.
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7c4f5eeb56)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This adds helper methods for cypress to work with select2 dropdowns:
- selectFromSelect2ByIndex() - select by option index
- selectFromSelect2() - select by text value
- clearSelect2() - clear selection
These helpers handle the complexities of interacting with Select2
components which cannot be selected using standard Cypress commands.
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit de4badb166)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This patch updates the markup of the include which displays patron
information on the checkout and patron detail pages. The changes are
minor and should have no visible effect.
To test, apply the patch and search for a patron in the staff interface.
View the patron information in the sidebar on both the checkout and
patron detail pages. Everything should look correct.
Sponsored-by: Athens County Public Libraries
Signed-off-by: Manvi <manvisharma1006@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6efd0b04e0)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit db11834480)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
test plan -
step 1 - apply patch
step 2 - observe in koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:221 that Target item is not reservable is now cannot be placed on hold
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 02b752e25c)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Corrected and standardized the capitalization of "Override Renew hold
for another" to "Override renew hold for another"
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 23dfbd051f)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Test Plan:
1. Apply Patch, go to the staff client
2. Navigate to the Administration
3. Search for staffShibOnly within System Preferences
4. Check that the description properly displays the right information
"staff to log in by means other than Shibboleth"
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ccf41d8b21)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Updates the XSLT templates for detail pages in the staff interface
and OPAC to label 041$d in MARC21 as "Sung or spoken language",
matching the MARC21 definition.
For music libraries, this also better reflects the information
about the record.
To test:
1. Apply patch
2. Catalog a record with 041$d
3. Navigate to the record details both in the staff interface
and OPAC
4. Observe "Sung or spoken language: <041$d>"
Signed-off-by: Lawrence O'Regan-Lloyd <loreganlloyd@clamsnet.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 88e07a074e)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This change explicitly turns off RELATIVE in Koha/TemplateUtils.pm
Test plan (Koha/TemplateUtils.pm):
0. Apply the patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/cgi-bin/koha/tools/letter.pl
2. Click "New notice" and choose "reports"
3. Add the following to the report:
[% IF ( x == 1 ) %]
One
[% ELSE %]
Two
[% END %]
4. Go to http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved
5. Create a report like the following:
SELECT biblionumber FROM biblio;
6. Click "Run with template" and choose the Reports template you made
7. Note that the output shows "Two"
8. Edit your Reports notice and include the following:
[% INSERT ../etc/passwd %]
9. Re-run the report using "Run with template"
10. Note that the output shows the regular SQL results (ie template transform not successful)
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b86095ffe7)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
In bug 39184 we set EVAL_PERL and ABSOLUTE to 0, which is the default. RELATIVE also defaults to 0. For security we should probably specify that as well in case the default is changed somehow.
Test Plan:
1) Apply this patch
2) Generate some notices
3) No change should be noted!
Signed-off-by: noah <noah@inlibro.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bd85f990da)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Test plan (before applying patch):
1) Enable ILLModule
2) Create a new ILL request, visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) After creating the request, you're on the 'Manage request' page.
4) Click 'Edit request'. Click 'Submit'. Notice you're redirected to the list table.
5) Apply patch. Repeat. Notice you're sent to the ILL request 'Manage request' page.
Signed-off-by: Richard Bridgen <richard.bridgen@nhs.net>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit db22aad838)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 356903a96a)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This patch adapts the Koha::Auth::Identity::Provider class to
make use of this, and also to prove the behavior is correct (expected
results, exceptions, encoding, etc).
To test:
1. Run:
$ ktd --shell
k$ prove t/db_dependent/Koha/Auth/Identity/Provider.t \
t/db_dependent/api/v1/idp.t
=> SUCCESS: Identity provider related tests pass!
2. Apply this patches
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 71fce974e3)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This patch introduces a new class for extending Koha::Object-based
classes so they have reusable ways to deal with JSON encoded fields.
As documented in the POD, classes can now
```perl
use base qw(Koha::Object Koha::Object::JSONFields);
```
and will have the following methods available:
* decode_json_field
* set_encoded_json_field
For convenience, the Koha::Auth::Identity::Provider class is tweaked to
make use of this, and also to prove the behavior is correct (expected
results, exceptions, encoding, etc).
To test:
1. Apply this patch
2. Run:
$ ktd --shell
k$ prove t/db_dependent/Koha/Object/JSONField.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6d4965f2d3)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d919f77118)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
The double-underscore function is required for translations to be picked
up in JS files.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d5de3ee6cd)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
To test:
1. Visit http://localhost:8080/cgi-bin/koha/opac-main.pl — notice that
the main search bar has a placeholder.
2. Visit the advanced search page. Notice that the search bars in the
advanced search do not have placeholders.
3. Apply this patch. restart_all
4. Refresh the page on the advanced search. Notice that the search bars
now have placeholders. Try switching out the dropdown options and
notice that the placeholder text changes depending on what you
select.
5. Test searches and make sure everything works as expected.
6. Sign off — have an amazing day! :D
Signed-off-by: Ludovic <ludovic.julien@inlibro.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7c5c8e74bc)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2ad6b96983)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This patch adds a new id="account-tabs" to that div.
To test:
Apply the patch and restart_all. Clear browser cache if necessary.
1. Go to a patron’s accounting tab → Transactions / Make payment / Manual invoice / Manual credit.
2. Inspect the HTML for the tabs menu. The surrounding div should have both class="toptabs" and id="account-tabs".
3. Verify styling and tab functionality remain unchanged.
4. Sign off and have a great day! :D
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b28daeb973)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
On the holdings tables the libraries are sorted by code, we should sort
them by description.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9f947a2517)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This coincidentally+nicely puts eISSN before ISSN on the 'manage request page' while keeping the rest of the order as before
Test plan:
1) Enable ILLModule
2) Create a new ILL request, visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Pick type one of 'journal article', 'conference', 'journal', 'generic resource'
4) Enter cardnumber, library, eISSN and other data if you want
5) Notice 'eISSN' shows on the 'Manage request' page.
6) Test again by creating an OPAC request, visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
Signed-off-by: Richard Bridgen <Richard.Bridgen@nhs.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 32ea6abb1e)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Richard Bridgen <Richard.Bridgen@nhs.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d8989fe57f)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
prove t/db_dependent/Koha/ILL/Backend/Standard.t
Signed-off-by: Richard Bridgen <Richard.Bridgen@nhs.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e6788ab699)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This change moves the wrapper so that the web page display correctly
Test plan:
0. Apply the patch
1. Enable the SelfCheckInModule system preference
2. Go to http://localhost:8080/cgi-bin/koha/sci/sci-main.pl
3. Note that there isn't a lot of whitespace between
the word "koha" and "Self check-in"
4. Celebrate
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 58f0439bcf)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
The after_hold_action plugin hook is currently called from within the
hold cancellation transaction in Koha::Hold->cancel(). This creates
a fragile architecture where any plugin performing database queries
can cause lock timeouts and transaction failures.
The issue manifests when plugins query tables with foreign key
relationships to biblio records. Even lightweight queries on seemingly
unrelated tables (like illrequests) can trigger lock conflicts due to
foreign key constraints that require shared locks on referenced rows.
Since the plugin hook executes while the transaction holds locks on
reserves/biblio tables, any plugin database access creates potential
for circular lock dependencies and timeouts.
This patch moves the plugin hook call outside the transaction boundary,
ensuring that:
- Core hold operations complete without plugin interference
- Plugins receive the same data but execute after transaction commit
- Database lock conflicts are eliminated
- Plugin failures cannot corrupt core hold cancellation logic
The hook receives identical data through a stored reference to the
cancelled hold, maintaining full backward compatibility while
eliminating the transaction fragility.
Test plan:
1. Install any plugin that implements after_hold_action hook with
database queries (e.g., ILL plugins checking hold relationships)
2. Create a hold and attempt to cancel it
3. Without patch: Operation may timeout with "Lock wait timeout exceeded"
4. With patch: Operation completes immediately
5. Verify plugin hook still receives correct hold data
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8f7a1b861f)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
The added patches make some changes:
* $c->req->json is used to access the request body, as explained by the
Mojolicious OpenAPI plugin author it should be done.
* Instead of calling `$basket->to_api` we use the `$c->objects->to_api`
helper which deals with calling context (embeds, etc). Otherwise it
would require doing it manually if embeds are added.
* Tests are grouped together the same way the rest of them are.
To test:
1. Apply this patches
2. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1/acquisitions_baskets.t
=> SUCCESS: Tests pass!
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ac9944f7b0)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Example usage:
POST /api/v1/acquisitions/baskets
{
"vendor_id": 1,
"name": "Basket #1",
}
Test plan:
1. Try requesting this endpoint with your favorite API tool
(I recommend https://github.com/frigus02/RESTer)
2. Run `prove t/db_dependent/api/v1/acquisitions_baskets/post.t`
Edit (tcohen): Re-did the commit with some fixes in the spec
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5e0a72f8a8)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Instead of re-fetching the patron object.
This also adjusts tests:
prove t/db_dependent/Koha/ILL/Requests.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 63d1023317)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Test plan, k-t-d:
1) Apply tests patch, run:
prove t/db_dependent/Koha/ILL/Requests.t
2) Notice it fails. Apply the second patch. Repeat. Notice it passes.
Test failure explanation (before fix patch):
# Failed test 'Cardnumber not supplied and couldnt find additional_contents for all libraries. Dont show copyrightclearance'
# at t/db_dependent/Koha/ILL/Requests.t line 1067.
# got: 'copyrightclearance'
# expected: 'commit'
Its searching the copyrightclearance additional_contents for the provided branchcode param (illrq->patron->branchcode) (and finding one) when it shouldn't. That parameter is only to be utilized for the newly created ILL request's library. The branchcode filter of the additional_contents must the be logged in user's cardnumber, not params->{branchcode}. If no logged in user exists and this stage is reached (ILLOpacUnauthenticatedRequest), then only 'All libraries' ILLModuleCopyrightClearance are to be fetched, as expected.
Human test plan, before applying patches:
1) Enable ILLModule
2) Logged in as koha:koha, create an OPAC request, visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
3) Pick any library not Centerville (the default library of the 'koha' user)
4) Notice the created request's library is CPL (Centerville). It ignored the library selection from the form.
5) Apply patches. Repeat. Notice the request's library is now the one that was selected on the form.
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit de5dfef766)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ee348649a2)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Currently, a job is marked failed if there are no records added or updated.
We should take ignored records into account.
Additionally, I mark the job failed when the number of records processed
doesn't equal the number of records in the batch.
To test:
1) Export some records from your Koha, include some with items
2) Stage and import those records into Koha, matching on biblionumber,
ignoring matcheds, updating items
3) View the import job, it is marked failed
4) View the batch, all records imported
5) Apply patch, restart all
6) Stage/import as before
7) Job is now marked finished
8) Records imported as before
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit aef17e613d)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 614020effa)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Otherwise it ends up as "Audit " in the .po
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f39a2118cd)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e549d21441)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3957a43e71)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a49af4a528)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bc4db881f4)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>