This patch adds a wait_for_server_ready check to t::lib::Selenium, so
Selenium-based tests poll the server until it responds successfully
before driving it, instead of assuming it is already up.
This guards against a race we saw on Jenkins CI:
t/db_dependent/selenium/00-onboarding.t and
t/db_dependent/selenium/01-installation.t both failed with 'no such
element: //div[@class="alert alert-success"]' right after the DB
connection check step, immediately after run_tests.pl's
get_commands_to_reset_db() restarted Apache/Plack. That helper
restarts services and moves straight to running the tests with no
readiness wait, so the very first requests can hit workers that are
still warming up. The test then fails on a missing page element even
though there is no bug in the installer flow itself.
A companion issue has been filed against koha-misc4dev to add a
readiness wait to run_tests.pl itself:
https://gitlab.com/koha-community/koha-misc4dev/-/work_items/108
Test plan:
1. Apply the patch
2. Run t/db_dependent/selenium/01-installation.t (or 00-onboarding.t)
against a fresh empty database with KOHA_TESTING=1, as usual
3. Confirm it still passes normally
4. To exercise the new wait: drop/recreate the database, then run
"sudo service apache2 restart" and "sudo service koha-common
restart", then immediately run the selenium test with no delay.
Confirm it either passes (server came up in time) or fails fast
with a clear "Cannot wait more for the server to be ready" message
rather than a confusing missing-element error deep in the install
wizard
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
If a plugin reports a date_authored or date_updated we can't parse,
remove the invalid property from the metadata hashref and emit a
warning.
To test this, introduce a separate test plugin directory and test file.
Having a plugin that produces warnings in the main test directory would
require accounting for this warning in every existing test that loads
plugins. Correspondingly, this patch also fixes an invalid date in an
existing test plugin.
Test plan:
1. Apply patch.
2. Run `prove -r t/db_dependent/Koha/Plugins/` and verify there are no
test failures.
Sponsored-by: Open Fifth
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This patch adds a parameter to call the method intranet_catalog_biblio_enhancements_toolbar_button with a biblionumber in the page catalogue/detail.pl.
Modification of cat-toolbar.inc to display new buttons correctly.
To test :
1. Apply the patch
2. Take a plugin who implements the method intranet_catalog_biblio_enhancements_toolbar_button
3. Check if the parameter biblionumber is passed correctly at this method
4. Create the new button in HTML in the plugin method
(button must be like the ones that are in the toolbar of the page detail.pl)
5. Go to the page in browser and check if the new button is displayed
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
All the previously written tests should continue to pass.
Sponsored-by: The Main Library Alliance <https://www.mainlib.org/>
Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
We sent a SIGKILL to the daemon which does not let it cleanup
Updating to SIGTERM (15) and handle the dbh disconnect gracefully in the
daemon.
Also handle SIGINT (ctrl+c) only because I think it can be useful (?)
Test plan:
prove t/db_dependent/www/search_utf8.t
=> Without this patch there are 3 warnings in the DB container log
db-1 | 2025-10-03 12:30:57 362 [Warning] Aborted connection 42 to db: 'koha_kohadev' user: 'koha_kohadev' host: '172.19.0.6' (Got an error reading communication packets)
=> With this patch applied there are none.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Generated using
`perl misc/devel/tidy.pl --perl`
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
The prettier plugin for TT has been adjusted to correctly parse our TT
files: most of them does not have an opening head but have a closing
head, then have an opening body but no closing body.
To avoid the parser to fail we are commenting those lines in a
pre-process step in the plugin, then uncomment them in the tidy script.
Which means we actually cannot parse correctly formatted HTML files.
https://gitlab.com/koha-community/prettier-plugin-template-toolkit/-/blob/main/src/parser.ts?ref_type=heads#L242
export const preprocess: Parser<Node>["preprocess"] = (text) => {
return text
.replace("</head>", "<!--</head>-->")
.replace(/<body(.*)/, "<!--<body$1-->")
.replace("</body>", "<!--</body>-->");
};
https://git.koha-community.org/Koha-community/Koha/src/branch/main/misc/devel/tidy.pl#L168
# Revert the substitutions done by the prettier plugin
my $content = read_file($file);
$content =~ s#<!--</head>-->#</head>#g;
$content =~ s#<!--<body(.*)-->#<body$1#g;
$content =~ s#<!--</body>-->#</body>#g;
(yes it's a bit messy, but our templates are messy)
Signed-off-by: Catherine Small <c.small@rcs.ac.uk>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This patch adds comprehensive unit tests for the new valuebuilder plugin
functionality. The tests verify that plugins can provide valuebuilders
through the get_valuebuilder() method and that FrameworkPlugin can
correctly load and integrate with plugin-based valuebuilders.
The tests use a dedicated TestValuebuilder plugin to ensure realistic
testing scenarios without relying on mocks, following the pattern
established in other plugin hook tests.
Test plan:
1. Run the new test file:
prove t/db_dependent/Koha/Plugins/Valuebuilder_hooks.t
2. Verify all tests pass (9 tests total)
3. Run all plugin tests to ensure no regressions:
prove t/db_dependent/Koha/Plugins/
4. Verify all plugin tests still pass (113 tests across 19 files)
5. Test the specific functionality:
- Verify plugins without get_valuebuilder() method are not found as valuebuilders
- Verify plugins with get_valuebuilder() method are correctly discovered
- Verify FrameworkPlugin can load plugin-based valuebuilders
- Verify JavaScript generation works with plugin valuebuilders
- Verify plugin enable/disable affects valuebuilder availability
6. Confirm FrameworkPlugin integration tests still pass:
prove t/db_dependent/FrameworkPlugin.t
Signed-off-by: Catherine Small <c.small@rcs.ac.uk>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
perl -wc misc/devel/create_test_data.pl
Attempt to call undefined import method with arguments ("schema") via package "Koha::Database" (Perhaps you forgot to load the package?) at /kohadevbox/koha/t/lib/TestBuilder.pm line 5.
Attempt to call undefined import method with arguments ("_type") via package "Koha::Biblios" (Perhaps you forgot to load the package?) at /kohadevbox/koha/t/lib/TestBuilder.pm line 7.
Attempt to call undefined import method with arguments ("_type") via package "Koha::Items" (Perhaps you forgot to load the package?) at /kohadevbox/koha/t/lib/TestBuilder.pm line 8.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This patch completes the deprecation cycle started in bug 36343 by
removing the backward compatibility code and deprecation warnings for
the old after_biblio_action hook signature.
Changes made:
1. Removed the duplicate biblio and biblio_id parameters from
_after_biblio_action_hooks in C4::Biblio that were marked for
deprecation in 24.11.00
2. Updated the test plugin to use only the new payload-based signature,
ensuring all parameters are accessed via $params->{payload}
The after_biblio_action hook now consistently uses the modern signature
with a payload parameter, matching the pattern used by other plugin hooks
like before_biblio_action, after_item_action, and after_hold_action.
Test plan:
1. Run: prove t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t
2. Run: prove t/db_dependent/Koha/Plugins/
3. Run: prove t/db_dependent/Biblio.t
4. All tests should pass
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
When using TestBuilder to build an order the tests will fail when the object will be saved:
00:09:41 koha-1 | # Looks like you planned 58 tests but ran 26.
00:09:41 koha-1 |
00:09:41 koha-1 | # Failed test 'cancel() tests'
00:09:41 koha-1 | # at t/db_dependent/Koha/Acquisition/Order.t line 1042.
00:09:41 koha-1 | Cannot insert order: Mandatory parameter quantity is missing at t/db_dependent/Koha/Acquisition/Order.t line 868.
00:09:41 koha-1 | # Looks like your test exited with 255 just after 14.
00:09:41 koha-1 | [22:03:54] t/db_dependent/Koha/Acquisition/Order.t
This happened on Koha_Main/3350
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
0) If k-t-d, run updatedatabase (ignore this if testing on a sandbox)
1) Enable ILLModule syspref:
{staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLModule
2) No need to install a backend as 35570 is in the tree
3) On a different browser session, without being lgoged in, access the create ILL request OPAC page directly:
{opac_url}/cgi-bin/koha/opac-illrequests.pl?method=create&backend=Standard
4) Notice you're presented with the login page, as expected
5) Enable ILLOpacUnauthenticatedRequest:
{staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLOpacUnauthenticatedRequest
6) Repeat step 3) Notice you now get the create ILL request form, with some additional inputs at the top specific to an unauthenticated request (first name, last name, e-mail address)
6.5) (optional) Confirm the 'Make an Interlibrary loan request' link exists at the bottom of the search results page, while unauthenticated on OPAC:
{opac_url}/cgi-bin/koha/opac-search.pl?idx=&q=music&weight_search=1
This should only show for authenticated OPAC users if ILLOpacUnauthenticatedRequest is off.
7) Test the form, try submitting with some blank fields, change type and library after and before inputing data in the input fields, etc.
8) Submit the form successfully. Notice you're presented with the unauthenticated request submission confirmation screen with a message and request details.
9) Go back to Staff UI, logged in, access ILL requests and confirm the unauthenticated request submitted through the OPAC is there:
{staff_url}/cgi-bin/koha/ill/ill-requests.pl
10) Test that you can add a patron afterwards, if needed, by clicking 'Edit request' on the toolbar of the manage request page, and entering a patron ID
11) Test that you're able to 'confirm' the request by clicking 'Confirm request', as if it was a regular 'NEW' request.
Additional testing:
Make sure existing ILL functionality interacts with this new optional workflow behavior.
For this, we're using ILLModuleDisclaimerByType. ILLCheckAvailability or AutoILLBackendPriority can also be used but require more setup (plugins, credentials, etc)
1) Configure ILLModuleDisclaimerByType, visit
{staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLModuleDisclaimerByType
2) Click the 'edit' link at the bottom of the syspref and copy the example code from the description into the text box. Save.
3) Repeat the original test plan from above, but make sure the request type is not 'article' (as that type is bypassed). Use 'journal', for example. Submit the request making sure you fill in all mandatory fields.
4) Notice you're now presented with the ILL request disclaimer screen, hit Submit. Notice the request is created as before.
5) Return to Staff UI, logged in, confirm this 2nd unauthenticated request has been created and the type disclaimer info is stored and presented when viewing the request.
Run tests (k-t-d only):
prove t/db_dependent/Koha/ILL/Request/Config.t
prove t/db_dependent/selenium/opac_ill_requests.t
Sponsored-by: NHS England (National Health Service England)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds the borrowernumber as a parameter to the overwrite_calc_fine
plugin hook. E.g., the borrower is needed for calculating graduated fines.
Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This new hook allows to overwrite the koha standard calculation of fines.
This can be useful if your library has a fine policy with graduated fines
per overdue letter.
To test:
1) Apply patch.
2) Run prove -v t/db_dependent/Circulation/CalcFine.t
3) Run prove -v t/db_dependent/Koha/Plugins/Overdues.t
4) Sign off.
Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Added head2 right before sub with missing POD
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan:
Apply patches
Staff:
1) Visit the ILL sysprefs page:
/cgi-bin/koha/admin/preferences.pl?tab=interlibrary_loans
2) Enable ILLModule
3) Check the new AutoILLBackendPriority syspref. Notice it shows "No available backends"
4) Install 2 backend plugins from here:
https://github.com/PTFS-Europe/koha-ill-backend-plugin/releases/tag/v2.0.5https://github.com/PTFS-Europe/koha-ill-reprintsdesk/releases/tag/rc-v3.0.0
5) Repeat 1. Notice the backends now show.
6) Enable both for AutoILLBackendPriority by ticking each respective checkbox. Save.
7) Visit ILL requests:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl
8) Press "New auto ILL request"
9) You are presented the "Standard" create form. Pick type "journal" and put '123' on DOI. Enter '42' on cardnumber and pick a library. Click Create.
10) Notice you are now shown the "Confirm auto backend" stage screen.
11) PluginBackend has a 50% chance of being available or not for testing purposes. If it is, it'll suggest PluginBackend, if not, it'll default to Standard. ReprintsDesk will always error because it's missing credentials.
12) Pick any of the backends or accept the suggested one, click 'Create'. The request has been placed in that specific backend.
OPAC:
1) Following from the previous test plan, visit OPAC ill requests:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl
2) Click "Create a new auto request" and repeat the same inputs as before. Click 'Create'.
3) Notice you're directed to "Confirming your request" screen. It's doing the same as it does in the Staff UI, except it does not allow the patron to pick a different backend, it'll always selected the first available backend in the priority.
4) Create more requests, you'll notice some of them will land on PluginBackend, others will land on 'Standard' because PluginBackend will sometimes be available and others not.
Do more testing:
- Reorder the backends in the AutoILLBackendPriority syspref and save, notice they're shown and suggested accordingly after creating a request.
- Disable all backends from AutoILLBackendPriority. Notice the original behaviour of requiring the user to select a backend before creating the request is restored on both opac and staff.
Run unit tests:
prove t/db_dependent/Illrequest/ConfirmAuto.t
prove t/db_dependent/Koha/ILL/Backends.t
Sponsored-by: NHS England
Sponsored-by: PTFS Europe Ltd
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
because of statement after exec we get:
# Previous test 1217 'POD coverage for t/lib/Mocks/Logger.pm'
# Statement unlikely to be reached at /kohadevbox/koha/t/lib/Mocks/Zebra.pm line 119.
# at /kohadevbox/koha/t/lib/Mocks/Zebra.pm line 119.
# require t/lib/Mocks/Zebra.pm called at (eval 4894) line 1
# eval ' require t::lib::Mocks::Zebra ' called at /usr/share/perl5/Pod/Coverage.pm line 308
# Pod::Coverage::_get_syms(Pod::Coverage=HASH(0x569d3a0bbf50), "t::lib::Mocks::Zebra") called at /usr/share/perl5/Pod/Coverage.pm line 152
# Pod::Coverage::coverage(Pod::Coverage=HASH(0x569d3a0bbf50)) called at /usr/share/perl5/Pod/Coverage.pm line 209
# Pod::Coverage::naked(Pod::Coverage=HASH(0x569d3a0bbf50)) called at xt/author/pod_coverage.t line 40
# main::check_pod_coverage("t/lib/Mocks/Zebra.pm") called at xt/author/pod_coverage.t line 30
Test plan:
Run `prove xt/author/pod_coverage.t` and confirm that the tests pass
with this patch applied.
Also confirm that t/db_dependent/www/search_utf8.t still passes
Note that xt/author/pod_coverage.t is coming from bug 39367.
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested on top of bug 39367. Patch makes the mentioned tests pass.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Also adds empty string as default value for deletedauth_header.marcxml
in TestBuilder.
Test plan:
Run dbrev.
Run t/db_dependent/TestBuilder.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a diag method to the Mocks::Logger object. This aids in
debugging logging errors by simply outputting all log lines to screen in
a diag statement.
Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is generated using:
% perl misc/devel/tidy.pl
*within* ktd, to get the same version of perltidy than what will be used
by our CI (currently v20230309).
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This particular script has POD at the end rather than inline POD. This
patch simply moves the POD addition for this patchset into the bottom
section.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
The linked biblio_id of a generated test ILL request needs to be created by build_sample_biblio->AddBiblio.
Or else the related biblio is created by just 'build' and is not indexed + its related metadata is missing.
To test:
1) Apply the [DONT PUSH] patch and enable ILLModule
2) Run the script for ILL requests:
misc/devel/create_test_data.pl -n 5 -s Illrequest -d backend=Standard
3) Visit the ILLModule:
http://<intra_url>/cgi-bin/koha/ill/ill-requests.pl
4) Notice it loads 5 test ILL requests correctly
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
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>
Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
TODO - better review C4::Auth's changes. Are all the removal of
_new_userenv correct/enough?
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
TestBuilder generates random strings for branches.opacuserjs and branches.opacusercss which produces invalid JS and CSS.
Selenium has several warnings related to this:
koha-selenium-1 | JavaScript error: http://koha:8080/cgi-bin/koha/opac-user.pl, line 1744: ReferenceError: CLYxPjQ152 is not defined
koha-selenium-1 | JavaScript error: http://koha:8080/cgi-bin/koha/opac-search.pl, line 2069: ReferenceError: CLYxPjQ152 is not defined
koha-selenium-1 | JavaScript error: http://koha:8080/cgi-bin/koha/opac-reserve.pl, line 1351: ReferenceError: CLYxPjQ152 is not defined
Because of the following in the DOM
<script>
CLYxPjQ152
</script>
This patch suggests to set to an empty string by default, to prevent random failure or inconsistent behaviours when testing the UI.
Test plan:
Run t/db_dependent/selenium/authentication.t and watch the selenium
output.
With this patch applied you will not see the "JavaScript error" lines
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan:
Run t/db_dependent/AuthorisedValues.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
A plugin hook for GetPreparedLetter would be very useful. It could be used to add universal headers and/or footers to messages, attach news, and modify notices in other ways in whole or in part. It could even be used for call webhooks when certain types of notices are sent.
For example, the MessageBee ( https://uniquelibrary.com/messagebee/ ) plugin for Koha generates YAML based notice content, which is then further processed by the before_send_messages hook. This process is unreliable due to the possible changes in data between the creation of the yaml and the reading of that yaml and transforming it into JSON with much more data. For example, the yaml may contain an issue_id, but that checkout may have been returned in the meantime. A hook like this would allow the MessageBee plugin to skip the yaml step and create the json data directly which is then sent to MessageBee for transmission to the patron.
Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Plugins/Transform_prepared_letter_hook.t
3) Download and install the Kitchen Sink plugin v2.4.0
https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases/tag/v2.4.0
4) Generate any notice or slip, such as a checkin or checkout notice
5) Note that all notices now end with "Thanks for using your local library!"
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>