Commit Graph

58381 Commits

Author SHA1 Message Date
Owen Leonard 6185a5d6ee
Bug 39897: Make EDI accounts a configurable DataTable
This patch adds DataTable features and table settings to the EDI
accounts administration page.

The patch also includes some minor simplification of template logic in
the table.

To test, apply the patch and restart_all.

- Go to Administration -> EDI accounts.
- If necessary, add at least a few random EDI accounts.
- Test the DataTable listing the accounts you added. Confirm that all
  DataTable features work correctly: Sorting, filtering, column display,
  etc.
- Click the "Configure" button to jump to the table settings page in
  Administration.
  - Alter the default configuration by hiding columns, changing default
    sort order, etc. It's probably wise to uncheck the "Save
    configuration state on page change" checkbox so that you can easily
    see if your configuration changes work.
- Return to Administration -> EDI accounts and confirm that the new
  configuration is being applied.

Sponsored-by: Athens County Public Libraries
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 10d3a0940a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:56 +02:00
Pedro Amorim 3aa6bda853
Bug 39091: Add tests
Test plan:
prove t/db_dependent/api/v1/cash_registers.t

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1a32644618)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:56 +02:00
Pedro Amorim c28386ac74
Bug 39091: Add cash registers list REST API endpoint
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6649b406c1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:56 +02:00
Matt Blenkinsop 77864ff6d4
Bug 40417: Remove 'validation' method
We shouldn't use the ->validation method anymore as it isn't stable. We need to pass the params into the method accounting for any param changes made

Test plan:
1) Apply the regression test patch and run the test
2) Test should fail
3) Apply this patch
4) Run test again
5) Test should pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f30b6f668c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:55 +02:00
Matt Blenkinsop 78968f9436
Bug 40417: Regression test
prove t/db_dependent/Koha/REST/Plugin/Objects.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f45dd34d6e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:55 +02:00
Tomas Cohen Arazi 274bf141ab
Bug 40424: Make query-in-body rely on `$c->req->json`
This patch removes the reliance on `$c->validation->output` for the
query-in-body feature. This will allow bug 40417 to move forward.

It also fixes some wrong design decisions we made 5-6 years ago. This
was discussed with the Mojolicious::Plugin::OpenAPI maintainer and the
agreement was `$c->validation->output` was not stable nor intended to be
accessed like we do.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/Koha/REST/Plugin/Query.t \
           t/db_dependent/api/v1/*.t \
           t/db_dependent/Koha/REST/Plugin/*
=> SUCCESS: Tests pass!
2. Apply this patchset
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 17b851bff0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:54 +02:00
Tomas Cohen Arazi d81809b4ba
Bug 40424: Simplify existing code - preparation
I wanted to isolate the changes for the query-in-body handling and it
made sense to refactor this dupicated code at the same time. So I add
this patch for tidying the area in preparation for the other part.

Duplicated code gets simplified.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/Koha/REST/Plugin/Query.t \
           t/db_dependent/api/v1/*.t \
           t/db_dependent/Koha/REST/Plugin/
=> SUCCESS: Tests pass!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 710bf4bb1b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:54 +02:00
Tomas Cohen Arazi c7251cf7f5
Bug 40424: Add missing tests for search in body
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5c82766985)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:54 +02:00
Tomas Cohen Arazi 5eb0968866
Bug 40423: Add helper to stash x-koha-request-id header value
This patch aligns handling of the header with how other headers are
managed.

* A helper is added which reads the header and stashes the value
* The helper is called in the same place similar helpers are called
  (authenticate_api_request)
* The `objects.search_rs` helper is adjusted to use the stashed value
  instead of picking it from the reserved params.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ prove t/Koha/REST/Plugin/Query.t \
           t/db_dependent/api/v1/*.t \
           t/db_dependent/Koha/REST/Plugin/*
=> SUCCESS: Tests pass! No behavior change!
3. Sign off :-D

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5e94e44ee2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:53 +02:00
Tomas Cohen Arazi 87b3ef3c31
Bug 40423: Unit tests
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 84c8f53769)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:53 +02:00
Aman Pilgrim 4038fcb6e0
Bug 37604: Add an ID to the batch record deletion "Skip biblio...." checkbox
This patch adds an ID to the "Skip bibliographic records with open
acquisition orders" checkbox on the batch record deletion page (Cataloging >
Batch editing > Batch record deletion".

This is required so that when selecting or unselecting the checkbox, the focus
remains on the checkbox.

Test plan:
1. Navigate to Home > Cataloging > Batch record deletion
2. Click 'Skip bibliographic records with open acquisition orders' to toggle
   the Record type checkbox (selected by default).
3. Inspect the page (right click the page, select Inspect, and look at the
   values in the checheckbox input field):
  . before the patch there is no id for the field
  . after the patch there is an id="skip_open_orders" for the checkbox field

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b3666a7233)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:52 +02:00
Martin Renvoize b4a580b9e0
Bug 40387: Comment some of the superflous diag
The test output was a little verbose in places, however the diag's can
be helpful when debugging failures. I've opted to comment rather than
completely remove them.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a1bfc15cbf)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:52 +02:00
Martin Renvoize 3aae77e667
Bug 40387: Add tests for create_edi_order logger calls
Tests for the logger calls introduced in the create_edi_order
in the last commit.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4c69085376)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:52 +02:00
Martin Renvoize e1e604f1c1
Bug 40387: Add Test::NoWarnings and replace carp with Koha::Logger
This patch adds Test::NoWarnings to our EDI unit tests. In doing so, it
reminded me that we still had some old carp style error handling in the
process_quote section and that we shoudl replace those with calls to
Koha::Logger instead.

Changes made:
1. Added Test::NoWarnings import to catch any warnings
2. Replace 'carp "Message"' appropriately with
   '$logger->warn("Message")'

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ac3eced5d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:51 +02:00
Martin Renvoize 5c450b74a0
Bug 40387: Add test for undefined tax rate handling in EDI processing
This adds a test to verify that EDI invoice processing correctly handles
invoices without TAX segments (undefined tax rates).

The test covers:
1. Processing invoices without TAX segments
2. Verifying no warnings about uninitialized values in multiplication
3. Confirming tax rates are set to 0 when no tax information is present
4. Ensuring invoice processing completes successfully

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dda29248ba)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:51 +02:00
Martin Renvoize ece12b3373
Bug 40387: Fix undefined tax rate warnings in EDI invoice processing
When processing EDI invoices without TAX segments, warnings were
generated due to undefined tax rates in multiplication operations.

The tax_rate() method in Koha::Edifact::Line correctly returns undef
when no TAX segments are present in the EDI message. However, the
invoice processing code in Koha::EDI didn't handle this case properly.

This patch fixes the issue by:
- Adding checks for undefined tax rates before using them in calculations
- Defaulting to 0 tax rate when no tax information is present
- Ensuring tax_value calculations use 0 instead of undefined values

This eliminates "Use of uninitialized value in multiplication" warnings
while maintaining correct processing of invoices without tax information.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 68aa216317)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:50 +02:00
Martin Renvoize 3f5a42a7d0
Bug 40386: Remove warnings from EDI when running tests
This patch fixes several warnings that occur when running Edifact tests:

1. Changed `my $self = ()` to `my $self = {}` in Koha::Edifact constructor
   to properly initialize as hashref instead of empty list
2. Added null/empty checks in Koha::Edifact::Segment::_parse_seg() to prevent
   warnings when processing undefined or empty segments
3. Added null/empty checks in Koha::Edifact::Segment::_get_elements() to
   handle undefined segments gracefully
4. Added Test::NoWarnings to t/Edifact.t to catch any remaining warnings

These changes eliminate "Use of uninitialized value" warnings and ensure
clean test runs without affecting EDI functionality.

Test plan:
1. Run prove t/Edifact.t and verify no warnings are displayed
2. Test EDI message processing to ensure no regression

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ac266cad8b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:50 +02:00
Jonathan Druart e5eba4f13f
Bug 40371: Remove warnings from Budgets.t output
t/db_dependent/Budgets.t .. 153/156 Use of uninitialized value in multiplication (*) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 543.
Use of uninitialized value in numeric eq (==) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 554.
t/db_dependent/Budgets.t .. 154/156 Use of uninitialized value in multiplication (*) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 543.
Use of uninitialized value in numeric eq (==) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 554.
t/db_dependent/Budgets.t .. 155/156 Use of uninitialized value in addition (+) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 510.

This change seems correct, but I am not 100% sure it won't introduce a
regression. What about 0 vs undef?

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 15a8f0444d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:50 +02:00
Janusz Kaczmarek 35267ecfa8
Bug 40466: Zebra status misleading in "Server information" tab
After changes to about.pl the checking of the Zebra status has landed
in "sysinfo" section instead of "about". As a result "Zebra status"
always reports "Running" even if Zebra is off.

Test plan:
==========
1. Turn zebra server off (koha-zebra --stop kohadev) and check in
   "Server information" (More > About Koha) the "Zebra status" info.
   You will see "Running".
2. Apply the patch ; restart_all ; koha-zebra --stop kohadev
3. Check "Zebra status" in "Server information". You should see now:
   "Zebra server seems not to be available. Is it started?".

Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1835ced4c0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:49 +02:00
Marion Durand fa9279644a
Bug 39896: Add UNIMARC support for AuthorLinkSortBy
This patch add support for AuthorLinkSortBy and AuthorLinkSortOrder in
the default UNIMARC XSLT files.

The description of the syspref is also slighly updated to hint users of
custom XSLT file about the need to update their template.

To test:
0. On a UNIMARC database
1. Set AuthorLinkSortBy to 'title' and AuthorLinkSortORder to
   'descending'
2. On the intranet and OPAC, search for an author you have multiple
   titles from and click on a result
3. Click on a link one a name for an author
4. Note a new search is performed, sorted by field from defaultSortField
   preference and not by title descending
5. Apply the patch
6. restart_all
7. Check that the syspref description now include a note about custom
   XSLT files
8. Repeat step 2 and 3
9. Note a new search is performed, sorted by title descending
10. Test other values - confirm links are updated in both staff and opac

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4581e399bb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:49 +02:00
Emily Lamancusa f6ad2409df
Bug 39502: (QA follow-up) Remove title attribute as well
When an element should be ignored by screen readers, it should have no
title attribute or an empty title attribute, in addition to a null alt
attribute.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 672982a683)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:49 +02:00
Alexander Blanchard 8a6c09f9e3
Bug 39502: Web Usability: Decorative Images Do Not Need ALT Text
A accessibility audit has highlighted that some of the decorative images on
the opac have alt text which is often followed by a spen that also contains the same
text. This results in screen readers reading this information twice.
The suggested solution is to set the alt text to null in these instances.

Test Plan:
Prior to applying patch:
1) Navigate to Koha OPAC
2) Carry out a search
3) On one of the records right click on the  Material Type: under the heading
4) Select Inspect
5) Note that the image has an alt text that matches the span that follows
6) Click on the item title and repeat the process for the icon below the contributors.
7) Scroll down to the holdings table and repeat the process for the image in the Item Type column
8) Apply the patch
9) Repeat the steps above and notice that the alt is now null in order to ignored by screen readers
11) Note that for the Dev tools may show alt but if you right click on the page and select View Page Source you will see that the code is alt="" as expected by screen readers
12) Note that for alt tags that have been updated in the xsl files e.g. the small icons that follow 'Material Type: ' may be cached.

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c5f99a3150)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:48 +02:00
katy rayn 80526a92b4
Bug 39066: Update output terminology for reports
This patch updates the terminology for the output for
reports from "To screen into the browser" to
"To screen in the browser" ("into" changed to "to").

Test plan:
1. Go to Reports
2. Click on Acquisitions
3. Check output language is To screen in the browser
4. Go to Report
5. Click on Patrons
6. Check output langugae is To screen in the browser
7. Go to Reports
8. Click on Catalogy
9. Check output language is To screen in the browser
10. Go to Reports
11. Click Circulation
12. Check output language is To screen in the browser
13. Go to Reports
14. Click Serials
15. Check output language is To screen in the browser
16. Got to Reports
17. Click Cash register
18. Check output language is To screen in the browser
19. Go to Reports
20. Click Holds
21. Check output language is To screen in the browser
22. Go to Reports
23. Click Patrons with the most checkouts
24. Check output language is To screen in the browser
25. Go to Reports
26. Click Most-circulated items
27. Check output language is To screen in the browser
28. Go to Report
29. Click Patrons who haven't checked out
30. Check output language is To screen in the browser

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 152b8ef199)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:48 +02:00
Owen Leonard c0f86a7598
Bug 40222: Bootstrap popover components not updated for BS5
This patch corrects a couple of templates which include a Bootstrap
popover component, updating the data attributes which were missed during
the BS5 upgrade.

The patch also makes a minor change to CSS in order for the popover
heading to not have unwanted margins.

To test, apply the patch and rebuild the staff interface CSS.

- Perform a catalog search in the staff interface.
- Add one or more items to the cart.
- Open the cart and hover your cursor over the "Items" heading. A
  popover should be triggered with a message about item sorting.
- Go to Administration -> Circulation and Fine rules.
- Edit a rule to add content to the "Note" field.
- Save the rule and then hover your cursor over the "View note" text.
  The note you added should appear in a popover.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Flater <flaterdavid@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eb1e00455e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:47 +02:00
Jonathan Druart 6976635df1
Bug 40180: Fix Cypress test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1b3868e79c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:47 +02:00
Jonathan Druart 364e791f6f
Bug 40174: Fix codespell
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 984edc806c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:47 +02:00
Martin Renvoize 2d82766cdc
Bug 40447: Add comprehensive JSDoc documentation to Cypress plugins
This patch adds detailed JSDoc documentation to all Cypress testing
plugin files.

Documentation added to:
- insertData.js: Data insertion utilities with examples
- api-client.js: API wrapper functions with usage patterns
- mockData.js: Schema-based mock data generation
- auth.js: Authentication helper functions
- db.js: Database query utilities
- readYamlFile.js: YAML file reading utilities
- index.js: Main plugin configuration

Each function now includes:
- Complete parameter descriptions with types
- Return value documentation
- Practical usage examples
- Error conditions and handling
- Module-level overviews

This addresses the documentation gap identified during QA review,
hopefully making it easier for future devs to adopt the new framework of
tools.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d9122cd5ac)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:46 +02:00
Jonathan Druart e413d6eff2
Bug 40318: Add tests
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 3f6a2cb872)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:46 +02:00
Jonathan Druart 97220c5b99
Bug 40318: (bug 40067 follow-up) Prevent receive shipments opening in a new tab - vendor list view
1. Acquisitions > Search vendors > Search
2. In the actions column, click "Receive shipments"
=> Without this patch the receive shipment from vendor [name] page opens in a new tab/window
=> With this patch applied it does not

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 20439c9e97)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:45 +02:00
Jonathan Druart d13bdbe6d4
Bug 40430: Fix Toolbar_spec.ts
See comment 1 on the bug.

We are adding the capability to insert vendors and baskets.

Test plan:
Confirm that
  yarn cypress run t/cypress/integration/Toolbar_spec.ts
pass, even if you do not have any vendors in DB.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 250580016d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:45 +02:00
Jonathan Druart a63e3775ea
Bug 40433: Add missing maxLength to item, library and patron
The test added in xt/api.t was not fully accurate, we skipped the
columns that have the same name as the api attribute (ie. the ones not
part of to_api_mapping)

Test plan:
prove xt/api.t should pass

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 410497a4f0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:45 +02:00
Jonathan Druart 7f19ee1cbb
Bug 40345: Use then to prevent async issues
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 022cbe9e67)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:44 +02:00
Jonathan Druart 5989073a1e
Bug 40345: Properly cleanup old checkouts
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 56fb5dc52f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:44 +02:00
Jonathan Druart 9880d01b29
Bug 40345: Add tests for bug 38102
Test plan:
  yarn cypress run --spec t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts
must return green

Revert commits from bug 38102
Run again the Cypress tests
=> They fail

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6a913fcc8a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:44 +02:00
Jonathan Druart d942d12dba
Bug 40345: Force checkout
Pass the confirmation token to force the checkout

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ed2c56ee6e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:43 +02:00
Jonathan Druart e723214b74
Bug 40345: Add insertSamplePatron
So it's easier to build and insert a new patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 959b7e8f05)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:43 +02:00
Jonathan Druart 9ef3760c8a
Bug 40345: Pass a patron to insertSampleCheckout
So we won't generate a new patron per checkout

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 96bb7116b0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:42 +02:00
Jonathan Druart 50961ff2fc
Bug 40301: (bug 40299 follow-up) Add Cypress tests
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a88c1b5445)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:42 +02:00
Jonathan Druart ab57ff4c63
Bug 40301: Add insertSampleCheckout
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 19843bd9ba)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:42 +02:00
Jonathan Druart f8e6f72f26
Bug 40181: Make sure data won't be added by insertData
We are here testing that data inserted by insertData tasks can be
easily removed from the DB using deleteSampleObjects

Test plan:
Cypress test t/cypress/integration/t/insertData.ts must pass

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 34e4b19ff5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:41 +02:00
Jonathan Druart 0810cc3b7a
Bug 40346: Use KOHA_INTRANET_URL for the baseUrl
This will prevent the test to reload when the URL changes

See https://github.com/cypress-io/cypress/issues/2777

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3ba5e7863c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:41 +02:00
Jonathan Druart 21c3d61b03
Bug 40346: Add tests
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7733e6441f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:41 +02:00
Jonathan Druart 7ebd00b12f
Bug 40346: Introduce loginOpac and visitOpac - Cypress
To be able to test the OPAC interface we need to add those 2 new
commands

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3ff1e96931)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:40 +02:00
Jonathan Druart d3605ec96a
Bug 40180: Improve deleteSampleObjects
We want the task to accept an Object or an Array of Objects

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5e4032f0f1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:40 +02:00
Jonathan Druart e1fa9feb3f
Bug 40180: Add tests for insertSampleHold
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e3ee3a0541)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:39 +02:00
Jonathan Druart f66133bcd5
Bug 40180: (bug 40118 follow-up) Add Cypress tests
This patch heavily reuses what has been introduced by the previous
patches in the tree, and add a insertSampleHold task to be reusable
easily in other tests.

Test plan:
All Cypress tests must pass

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit af311b5395)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:39 +02:00
Jonathan Druart 604ede20d9
Bug 40174: Do not generate bigint
Prevent "Out of range value for column 'deliverytime'" in a later
follow-up bug reports.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 065f00ad67)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:39 +02:00
Jonathan Druart 26653b2a78
Bug 40174: Require RESTBasicAuth turned ON
From MM thread https://chat.koha-community.org/koha-community/pl/aptoodssm7gu8x491onfgxs1xr

Cypress tests need RESTBasicAuth - I’m stuck in a chicken-and-egg problem being eaten by its own tail...
I need advice. Some Cypress tests need RESTBasicAuth, but it's disabled by default.
My plan was to turn it on globally (ie. set before any tests, and reset to its original value after)
but we cannot right now:
Update in DB could work, but its cached
Call the svc script won't work, as we are not logged in yet (and this script require the session cookie)

so, I have a lot of solutions, but not sure which one to pick
* have a "flush cache" route (smells the rabbit hole)
* login to get the cookie, set the syspref via the svc script, logout (ugly, and will slower the cypress tests)
* require the pref on for cypress tests
* ?

I would opt now for the third option, turn it on in Jenkins when we run the cypress tests. And explode for devs when the pref is not set.
What do you think?

If we push this as it, Jenkins is going to fail.
We need to restructure how Jenkins is running the Cypress tests anyway:
we need a dedicated job to run them all. We will turn ON the syspref for
this job.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ddf8014ead)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:38 +02:00
Jonathan Druart b850118d3d
Bug 40174: Set minLength to 3
When we generate several objects we often get "Duplicate ID" from the
server. This mostly happens when the tests failed previously and the
objects have not been removed from the DB.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7f8e4fd4b5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:38 +02:00
Jonathan Druart 62bcd78596
Bug 40174: Deal with enum
Data too long for column 'checkprevcheckout'

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit da17bc0f91)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-08-22 09:47:38 +02:00