Commit Graph

7321 Commits

Author SHA1 Message Date
Kyle M Hall 8e3a5dd83e Bug 38486: [24.05.x] Fix unit tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 98b7336d9f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-03-24 11:02:04 +01:00
Tomas Cohen Arazi 55821c5558 Bug 28478: Add Koha::Biblio->opac_suppressed()
This patch adds a convenient method at the Koha::Biblio level, as a
wrapper for the extrator added on this bug. Following the established
pattern we adopted a while back.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Biblio.t
=> SUCCESS: Tests pass! All use cases covered!
3. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit c1e2a4f164)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-26 13:53:14 +01:00
Tomas Cohen Arazi cddadab517 Bug 28478: Add get_opac_suppression extractor
This patch adds an extractor method for the historically hardcoded field
942$n. This way we have a single place in which we code the extraction
and sanitization of its value.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC.t
=> SUCCESS: Tests pass! All use cases are covered!
3. Sign off :-D

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit b8ff17d259)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-26 13:52:45 +01:00
Marcel de Rooy ef0e5e37c0 Bug 36081: (QA follow-up) Resolve IsNotDebit exception in ArticleRequests.t
Resolve (when running ArticleRequests.t):
Exception 'Koha::Exceptions::Account::IsNotDebit' thrown 'Account line 326 is not a debit'

This occurs after switching from ArticleRequest->new to TestBuilder.
TestBuilder creates an account line that has a credit_type_code and
a debit_type_code. (This could be fixed further somewhere else.)
For now, just setting debit_id to NULL.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit a8078a4f3d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-26 13:48:13 +01:00
Jonathan Druart 26e4471086 Bug 36081: Fix some failing tests
Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 5a8aef083d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-26 13:48:13 +01:00
Jonathan Druart e8a644744f Bug 36081: Mock format
Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 05353f0cf0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-26 13:48:13 +01:00
Jonathan Druart 3735b149db Bug 36081: Force TestBuilder to generate a valid format value
Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 5ff06fd18d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-26 13:48:13 +01:00
Jonathan Druart 899f0a7c8f Bug 36081: Use multivalue_preference
C4::Context->multivalue_preference is not used so far and split on |
However the values of "multiple" sysprefs are separated by... comma!

Let support both here.

This patch also removes silly JS code in the template.

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 7b0f6f6bc1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-26 13:46:32 +01:00
Marcel de Rooy ea1fbf8e7b Bug 36081: Check SupportedFormats server side
Test plan:
Add article request with format via OPAC.
Run t/db_dependent/Koha/ArticleRequest.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tests in t/db_dependent/Koha/ArticleRequest.t pass. I can add an
article request with a type. If I allow PHOTOCOPY but change the
HTML in the OPAC form so SCAN is submitted I get a nice (but
somewhat generic) error.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 3a817ca380)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-26 13:46:32 +01:00
David Cook e0841daec0 Bug 38488: Add Template::Toolkit filter for C4::Scrubber
This change adds a Template::Toolkit filter which is invoked
via " | scrub_html type => 'note' ".

Test plan:
0. Apply the patch
1. prove t/Koha/Plugins/HtmlScrubber.t

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit c536935238)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Jonathan Druart bfc3646150 Bug 39007: [24.05] Replace warning_like with is
Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit d6ca069f36)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Matt Blenkinsop ca0b6f250a Bug 39007: [24.05] (follow-up) Fix typo
Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit a4d0fcd68e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Matt Blenkinsop 3f23d9d76a Bug 39007: [24.05] Update API spec and unit test
Test plan:
1) Run prove t/db_dependent/api/v1/erm_sushi_services.t - FAIL
2) Apply patch
3) Repeat step 1 - PASS
4) Inspect patch diff and note that last_audit has been added to the API definition

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>

 Please enter the commit message for your changes. Lines starting

Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 020a27cdd7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Lari Taskula 824e7991c1 Bug 28907: REST - Remove allow-owner from public article requests cancel route
To test:
1. prove t/db_dependent/api/v1/article_requests.t
2. Apply patch
3. prove t/db_dependent/api/v1/article_requests.t

Observe success in both cases.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 0470a59c03)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Lari Taskula 6bf1026abf Bug 28907: REST - Remove allow-owner from public patron hold cancellation
To test:
1. prove t/db_dependent/api/v1/patrons_holds.t
2. Apply patch
3. prove t/db_dependent/api/v1/patrons_holds.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit e2bc259dda)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Lari Taskula 1501983655 Bug 28907: REST - Remove allow-owner from public guarantors can see charges and checkouts
To test:
1. prove t/db_dependent/api/v1/patrons.t
2. Apply patch
3. prove t/db_dependent/api/v1/patrons.t

Observe success in both cases.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 91ba054f5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Lari Taskula 5cdb3e6d79 Bug 28907: REST - Remove allow-owner from public checkouts route
To test:
1. prove t/db_dependent/api/v1/checkouts.t
2. Apply patch
3. prove t/db_dependent/api/v1/checkouts.t

Observe success in both cases.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 73283e04f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Lari Taskula 5a4f489fb1 Bug 28097: REST - Remove allow-owner from public password route
To test:
1. prove t/db_dependent/api/v1/patrons_password.t
2. Apply patch
3. prove t/db_dependent/api/v1/patrons_password.t

Observe success in both cases.

https://bugs.koha-community.org/show_bug.cgi?id=28907
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 441f7b4d07)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Lari Taskula 8be951515b Bug 28907: Add Koha::REST::Plugin::Auth::PublicRoutes
To test:
1. prove t/db_dependent/Koha/REST/Plugin/Auth/PublicRoutes.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit e810e4c668)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Phil Ringnalda 04642f5b54 Bug 38467: (follow-up) Fix test
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 7f999e0699)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Jonathan Druart 385dcfda1e Bug 38467: Add test
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 49603e9a70)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Marcel de Rooy 5dec1494fa Bug 37816: (QA follow-up) Avoid repetition, typo and pipe test
Combining three regexes into one. Typo replcing.
Adding a test with pipe in pwd.

Test plan:
Run t/SIP/Sip.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 34c0bd2c51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Magnus Enger 07164fa0c9 Bug 37816: Stop SIP2 from logging passwords
Koha's SIP2 server does a lot of logging, including all incoming
requests, in full. This means that passwords are logged, both for
the user the SIP2 client uses for logging into Koha, as well as
for the end users who provide a password to e.g. check something
out. This patch replaces passwords with three asterisks in
log strings, before they are written to the log.

To test, in ktd:
- Run the new tests:
  $ prove t/db_dependent/SIP/Sip.t
- Tail the SIP2 logs:
  $ sudo tail -f /var/log/koha/kohadev/sip*.log
- Telnet into the SIP2 server:
  $ telnet localhost 6001
- Try logging in by pasting this into the telnet session:
  "9300CNterm1|COmypassword|CPCPL|"
- Verify that "mypassword" is replaced by "***" in the logs
- Try different values for the password, including the correct password
  which is "term1" in ktd
- Try other SIP2 messages that include password fields (AC, AD, CO)

Update 2024-12-03: Fix issues pointed out by QA.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit cb20df02a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Jonathan Druart 9d38bcbf6d Bug 38829: Add a test
Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Added a shebang line.
Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 6388b14ba0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-24 14:19:22 +01:00
Nick Clemens 87212d662b Bug 37810: (QA follow-up) Tidy
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit da96f8cfe5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-21 15:23:41 +01:00
Pedro Amorim 427c45c854 Bug 37810: Add test
Test plan:
1) Apply only tests patch, run:
prove t/db_dependent/Koha/ERM/EUsage/UsageDataProvider.t
2) Verify tests fail
3) Apply fix patch
4) Run tests again, verify they pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit dfd9bc68cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-02-21 15:23:41 +01:00
Jonathan Druart 43076cabd2 Bug 38526: (bug 36822 follow-up): Improve datetime comparison in tests
17:39:54 koha_1       |     #   Failed test 'updated_on correctly saved on newly created user'
17:39:54 koha_1       |     #   at t/db_dependent/Auth_with_shibboleth.t line 319.
17:39:54 koha_1       |     #     Structures begin differing at:
17:39:54 koha_1       |     #          $got->[0] = '2024-11-19 16:39:30'
17:39:54 koha_1       |     #     $expected->[0] = '2024-11-19 16:39:29'
17:39:54 koha_1       |     # Looks like you failed 1 test of 54.

We must use t::lib::Dates::compare to compare datetimes in tests.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ed25a48ccf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3b31cf80c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 14:46:43 +01:00
Lucas Gass e98d0b2142 Bug 23426: (Rmaint follow-up) Adjust tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a61cfb1a35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 14:29:36 +01:00
Jan Kissig b6bfb2b7f0 Bug 23426: (follow-up) Fix failing test to send correct summary flag
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7509681e10)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e849ae175b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 14:29:36 +01:00
Jan Kissig d04f781661 Bug 23426: (follow-up) Add tests
Test plan:
[1] Prove t/db_dependent/SIP/Message.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
EDIT: Tidied inline.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit efe0b8c627)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3dec3a9cb8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 14:29:36 +01:00
Martin Renvoize 3d6f8429d1 Bug 38322: (QA follow-up) Fix spelling
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a9e7e8f14d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 087ceae831)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 14:19:33 +01:00
Nick Clemens 1ca7043c9a Bug 38322: Adjust tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0e899b8882)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1c2f7e2708)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 14:19:33 +01:00
Pedro Amorim a0f21e3c36 Bug 38284: Add tests
Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5acf88d91d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 41e74dd1a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 14:09:57 +01:00
Aleisha Amohia 7ced9fb502 Bug 33348: Tests
prove t/Koha/SearchEngine/Elasticsearch/Search.t

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8e73930408)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d444b97d03)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 14:07:57 +01:00
Janusz Kaczmarek 21bf7a728d Bug 38100: Unit tests
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit af270fc239)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1fbd8ebf83)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 14:04:40 +01:00
Baptiste Wojtkowski 8ac18f49c2 Bug 37684: Direct link to expired news are broken
When using a direct link to a news (koha.url/cgi-bin/koha/opac-main.pl?news_id=XXX), the link is broken if the news is expired.

Formerly, a using AdditionalContent->get( id => "my_news_id") on an
expired news was returning a news, and calling get without id was
returning all news but the expired ones.

This patch adds tests to check this behaviour by adding one expired news and performing following new tests:
1 - It may not be returned by AdditionalContent.get()
2 - It must be returned by AdditionalContent.get() using its id

This patch fixes the behaviour by addind the new behaviour or
AdditionalContent.get:
1 - Any news must be returned by AdditionalContent.get() using its id;

TEST PLAN:
1 - Apply patch
2 - Remove the changes made to Koha/AdditionalContents.pm
3 - Run tests -> one test must fail
4 - Create a news with a expired expiration date, notice the id of the
  news in the url of the modification panel
5 - Go to "opac.url/cgi-bin/koha/opac-main.pl?news_id=MY_ID" -> notice
  it does not work
6 - Reapply the whole patch
7 - Run test -> all test must pass
8 - Go to "opac.url/cgi-bin/koha/opac-main.pl?news_id=MY_ID" -> notice
  it does work now

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4ad5cbdb97)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1be8a9eedd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 11:52:58 +01:00
David Cook 31a0a7aec3 Bug 22223: t::lib::QA::TemplateFilters missing built-in TT filter "safe_url" causes false warnings
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fe495d19df)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4023df1789)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:54:10 +01:00
David Cook 0048be7498 Bug 22223: Add filter to make item URLs safe in template output
This change adds a "safe_url" filter which takes a text input and
returns a Perl URL object which stringifies to a safe URL.

This change is only needed in the OPAC as the staff interface
handles the item URL display using Javascript not Template Toolkit.

0. Apply patch and koha-plack --restart kohadev
1. Create an item for a record using the following URL
https://koha-community.org?url=https%3A%2F%2Fkoha-community.org
2. Go to the OPAC for that record and verify that the URL is
not double-escaped
3. Create a malicious payload (talk to QA/security team for this if necessary)
4. Note that the malicious payload is escaped
5. prove t/Koha/Plugins/SafeURL.t
6. Celebrate!

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e8e00cfeb3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 629d2a6f6c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:54:10 +01:00
Jonathan Druart ed9cdb267d Bug 33188: Remove warning from Koha::Item->hidden_in_opac
"Use of uninitialized value in string eq"

Test plan:
  prove t/db_dependent/Koha/Item.t
should return green

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidied the tests (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f575d4cd73)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1b27067e9a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:35:48 +01:00
Pedro Amorim 94720a0c4a Bug 37856: Add new test to test platform is correctly added to build_url
prove t/db\_dependent/Koha/ERM/EUsage/UsageDataProvider.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e7dbd2a8b7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit aae9a4466c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:16:51 +01:00
Pedro Amorim 0b14f213d9 Bug 37856: Fix existing test
A service_platform value was being randomly to 'service_platform' as is a new attribute.
Assign undef to that to fix existing test

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b3fb2e85fe)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6b8e7d7152)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:16:51 +01:00
Nick Clemens 7614ed0f1f Bug 37856: (QA follow-up) Tidy
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b7600e4801)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2e9a6b16f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:16:51 +01:00
Pedro Amorim 600d75dc40 Bug 37856: Add tests
This is using the groundwork from bug 37963.
This is testing the specific error this bug is addressing:
Required parameter Platform is missing

It is also testing that the error message is correctly shown as a background
job report message to the user

Test plan:
prove t/db_dependent/Koha/BackgroundJob/ErmSushiHarvester.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit edb6056a74)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 89de703030)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:16:51 +01:00
Nick Clemens bdc47186c8 Bug 37963: (QA follow-up) Tidy
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5b51ef78d4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 209b685871)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:11:23 +01:00
Pedro Amorim 78022e8f03 Bug 37963: Case 2 - Add tests for different case error message
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4c76d2b565)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d4255bf632)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:11:23 +01:00
Pedro Amorim 06c0a76aa5 Bug 37963: Case 1 - Add tests for invalid api key use case
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 05381ba6b1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 407661f5d3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-18 10:11:23 +01:00
Pedro Amorim 286564dea3 Bug 34920: [23.11.x] Add cypress tests
Run the agreements cypress test spec:

cypress run --spec t/cypress/integration/ERM/Agreements_spec.ts

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-12-18 09:58:09 +01:00
Matt Blenkinsop 810a1309cc Bug 38271: (QA follow-up) Fix testcritic
testcritic was failing due to a 'return undef' so this commit amends that

Test plan:
1) prove t/00-testcritic.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 640ce0bc6b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9bf772dd42)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-13 16:31:05 +01:00
Kyle M Hall 01d0ea0ef3 Bug 38271: (QA follow-up) Tidy code
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f68688b58)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5d0a019756)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-13 16:31:05 +01:00
Matt Blenkinsop 2606b4ee2e Bug 38271: Handle missing 008 fields in EDI
This patch adds handling to create a default 008 field on MARC records that are missing one when created through EDI.

Test plan:
1) prove t/db_dependent/Koha/EDI.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b00fb3d557)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4eccb57f06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-12-13 16:31:05 +01:00