Commit Graph

56886 Commits

Author SHA1 Message Date
Jonathan Druart 84ea94a203
Bug 39096: Add 'tidy all' commits to a git blame ignore file
To get a relevant blame we want to exclude some commits from bug 38664.

Test plan:
0. Do not apply this patch
1.
% git blame C4/Auth.pm (or other file)
Notice that there is a lot of reference to bug 38664 (you can see it
with the author "Koha Development Team")
2. Apply this patch
3. Tell git to use this new file:
 % git config blame.ignoreRevsFile .git-blame-ignore-revs

Repeat 1.
=> There are way less refs to "Koha Development Team"

Before:
% git blame C4/Auth.pm|grep "Koha Development Team" | wc -l
454
After:
% git blame C4/Auth.pm|grep "Koha Development Team" | wc -l
29

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:25 +01:00
Tomas Cohen Arazi 57f271d6b2
Bug 39106: Use LWP::UserAgent and add error checking
This patch replaces the (newly introduced use of) REST::Client library
with (the already existing in the dependencies) LWP::UserAgent.

Bonus 1: validation on the response status is added to print a proper
error message and die if bugzilla is not available

Bonus 2: License added to the file

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:24 +01:00
Jonathan Druart e562c96d2e
Bug 39106: Add REST::Client to cpanfile
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:24 +01:00
Jonathan Druart d58e670ffe
Bug 39106: The auto-rebase script - Add --bugzilla
Julian wrote a script a while ago to retrieve patches from bugzilla
and checkout the good commit to make sure the patches will apply cleanly.

This change reuses the same logic for the auto-rebase script.

Test plan:
0.
 a. You will need to install REST::Client using cpanm:
  `cpanm REST::Client`
 b. You need the --confirm flag from git-bz, see https://gitlab.com/koha-community/git-bz/-/issues/14
1. Pick a bug number with patches that does not apply on current main
2. Use the auto_rebase script with the --bugzilla option
3. Enjoy

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:23 +01:00
Victor Grousset/tuxayo b127a030f1
Bug 39115: (follow-up) Exclude Schema.pm from perltidy.t
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:22 +01:00
Jonathan Druart 2a3fe18734
Bug 39115: Finally use ':(exclude)' and grep
This was not working:
% git ls-files Koha/Schema.pm --exclude='Koha/Schema/Result' --exclude='Koha/Schema.pm'
Koha/Schema.pm

The efficiency of the script is getting worse and it will need to be
rewritten.
The xt/tt_tidy.t will take longer.

But at least it should work correctly now

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:22 +01:00
Jonathan Druart 44c7c99132
Bug 39115: Restore ability to tidy files not in git index (yet)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:21 +01:00
Jonathan Druart 9d1bdfd07f
Bug 39115: Replace (:exclude) with --exclude
I don't really explain this one, but this is something wrong with
(:exclude)

% git ls-files koha-tmpl/intranet-tmpl/js/i18n.js --exclude='koha-tmpl/intranet-tmpl/lib' --exclude='koha-tmpl/intranet-tmpl/js/Gettext.js' --exclude='koha-tmpl/opac-tmpl/lib'
koha-tmpl/intranet-tmpl/js/i18n.js
=> Return the file has expected

% git ls-files koha-tmpl/intranet-tmpl/js/i18n.js ':(exclude)koha-tmpl/intranet-tmpl/lib' ':(exclude)koha-tmpl/intranet-tmpl/js/Gettext.js' ':(exclude)koha-tmpl/opac-tmpl/lib'
=> Does not return anything!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:21 +01:00
Jonathan Druart d0c19234ac
Bug 39115: Remove exclude list from js_tidy.t
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:20 +01:00
Jonathan Druart e0d93e67f7
Bug 39115: Remove exclude list from tt_tidy.t
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:20 +01:00
Jonathan Druart 8ba8b9b1ce
Bug 39115: Do not tidy files that must not be touched
It should prevent to tidy files that must be kept unchanged.

It was initially a feature (the script does what you ask it to do),
but it's a mess maintain the list of files we want to keep tidy.

Test plan:
Koha/Schema.pm is one of the file we don't want to modify/tidy
So let's play with this one, feel free to pick others (see the
exception list per filetype in the script)

 % perl misc/devel/tidy.pl --perl
will not touch Koha/Schema.pm

 % perl misc/devel/tidy.pl mainpage.pl Koha/Schema.pm
will not touch Koha/Schema.pm but mainpage.pl will

 % perl misc/devel/tidy.pl --no-write Koha/Schema.pm
The --no-write option is called by the QA script to compare the output
and see if files are tidy. We want to return something in this case. So
the file will be printed to STDOUT untouched

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-17 13:10:19 +01:00
Jonathan Druart 5dcfb91db3
Bug 39114: The auto-rebase script - Fix files removal
Wrong handling of the return of the try-catch, $git->rm has an output
("rm /file/path").

This patch retrieves the status from the `git diff-tree` output

Test plan:
git checkout HEAD~100 (so you are before 38664)
git rm mainpage.pl
edit C4/Auth.pm and make some changes
git commit -a --no-verify -m"Bug 12345: test"
then rebase your branch
Retrieve the auto_rebase.pl version from this patch and run it
perl auto_rebase.pl

The resulted commit should not contain mainpage.pl

WNC amended patch, tidied, ironically

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 17:11:10 +01:00
Jonathan Druart 4b5d6afc85
Bug 39119: Make js_tidy and vue_tidy test use the tidy script
They were still using prettier directly. They should use the tidy.pl as
it is doing some wrapper work.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 17:11:09 +01:00
Baptiste Wojtkowski 7d65987a4a
Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
TEST PLAN (on an UNIMARC machine):
1 - Create a list with items with different publicationyear if you do not have one.
2 - Edit the list and select "copyrightdate as date"
3 - See they are not sorted by date
4 - Apply patch
5 - See they are now sorted by date.

Note: The transformation of copyrightdate before loading the template is
only useful if the list is sorted by copyrightdate, which is quite
inconsistent but is actual for every Kohas at the moment.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:18:02 +01:00
Owen Leonard ab3e951c9c
Bug 39051: Fix submit button class on cash register statistics page
This patch corrects the class of the submit button on the cash register
statistics page. Bug 32091 added the "btn btn-default" class but it
should have been "btn-default."

To test, apply the patch and go to Reports -> Cash register statistics.

The submit button should have the yellow "primary" button color.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Button is now yellow.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:18:01 +01:00
Owen Leonard 8d162ec366
Bug 39050: Duplicate "type" attributes in ill-batch-modal.inc
This patch removes duplicate "type" attributes from two inputs in
ill-batch-modal.inc.

I don't know how to test this, but a visual inspection of the changes
should be enough.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Makes sense
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:18:01 +01:00
Marcel de Rooy 99b7f5635c
Bug 37650: (follow-up) Remove FIXME around CheckReserves call
The FIXME correctly stated that the CheckReserves call and follow-up
only should be executed within the cancel hold scope.

NOTE: Actually, I do not see how to trigger it in current code. Since
checking in a waiting hold triggers the NotIssued error. And the
cancel hold button is not available for holds in queue.

Test plan:
Place a hold on an item.
Checkin at pickup location. Confirm. Hold waiting now?
Try again but checkin at another branch. Transfer triggered?

The hard part (see my note). Try to get at the form where you can
cancel the hold (waiting or first in queue).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:18:00 +01:00
Marcel de Rooy 2f0659b1b2
Bug 37650: Add lookahead days in CheckReserves call in returns.pl
Test plan:
Enable future holds. Put a positive value in ConfirmFutureHolds.
Add a hold for tomorrow and pickup at B. Check item in at A.
Confirm hold.

Without this patch you should see a warn on L186:
  [WARN] Use of uninitialized value in string ne at /usr/share/koha/circ/returns.pl line 186.
With this patch, you should not see it anymore.

NOTE: Before bug 34972 no transfer was created for future holds.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:18:00 +01:00
Owen Leonard fbec80904f
Bug 39021: Fix badly formatted dropdown on patron account transactions page
This patch makes minor markup changes in order for the "Email" menu item
to be styled correctly after the Bootstrap upgrade. The patch also
simplifies the submission of the form by removing unnecessary JS event
handling.

To test, apply the patch and locate a patron record to view.

- Open the "Accounting" tab
- Click "Create manual invoice"
- Put a charge on the patron's account and click "Save and pay"
- Pay the charge
- Click "Transactions"
  - In the "Actions" column there should be a "Receipt" menu.
  - The "Email" item should be correctly formatted, matching the "Print"
    entry.
  - Clicking "Email" should result in the page refreshing, with the
    message "Receipt sent" at the top.
  - If you don't have email set up you can confirm that the message was
    queued by creating an SQL report: "SELECT * FROM `message_queue`"
  - The report should show the message with the receipt you emailed.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:17:59 +01:00
Jonathan Druart 3b207c44cc
Bug 38823: Fix translatability for 'Reports' in ERM menu
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Confirmed that "Reports" is now treated the same way as every
other "title" in the file.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:17:59 +01:00
Petro Vashchuk 9d63fa8130
Bug 32949: Fix wrong input id
The input id was wrong, so instead "else" was handling the flatpickr data
as plain text, which prefilled junk data and therefore resetting value of
"Hard due date" field to "None defined".

To reproduce:
1. Head over to the smart rules admin page and create/use existing rule
for certain item type/category.
2. Set "hard due date" that rule to a certain date and save.
3. Edit that same rule again, but this time save it without any
changes. Do not click or interact with flatpickr field.
Date for hard due date will get lost and will be set as "None defined".
4. Apply the patch.
5. Repeat steps 2 and 3. Ensure that the data loss is not happening
anymore.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed test plan, works as advertised.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:17:58 +01:00
Nick Clemens d73e3399ca
Bug 39070: Don't request facets when searching for recrod matches
This patch adds a new option to Elasticsearch to skip facets in build_query and
build_query_compat.

There should be no behavior change, however, queries to ES should be simpler

To test:
1 - Export some record from Koha
2 - Stage the records for import, matching on 999c
3 - Confirm expected matches
4 - Switch batch to use ISBN for matching
5 - Confirm expected matches
6 - Apply patches, restart all
7 - Switch batch to use 999c
8 - Confirm matches
9 - Switch batch to use ISBN
10 - Confirm matches

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:17:58 +01:00
Nick Clemens e2207cb478
Bug 39076: Use state variable to avoid creating extra ES connections
As elsewhere in the code, we should use a state variable for our
'bib_searcher' object to avoid overhead of extra ES connections.

Worth noting - we don't actually use the 'bib_searcher' at all during
record auto linking as we pass skipmetadata

To test:
0 - Apply patch
1 - Enable biblio auto linking
    AutoLinkBiblios, CatalogModuleRelink, LinkerRelink
2 - Stage and import a marc file
3 - Confirm record authorities link as expected
4 - Search authorities in the staff interface
5 - Confirm usage counts are shown for results

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 16:17:57 +01:00
Jonathan Druart 8c0d196ff6
Bug 39077: Do not complain about obsolete translations
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:31:01 +01:00
Jonathan Druart 8514d0a91f
Bug 38474: Prevent Letters.t to fail on slow server
We must always use t::lib::Dates::compare when we compare dates in
tests.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:31:00 +01:00
Nick Clemens c5f598d874
Bug 39044: Pass budgets to template
This simply copies the fetch of budgets from the acqui/histsearch.pl script.

We should in the future make this a template or other method to avoid code duplication,
but we should fix the functionality first.

To test:
1 - Go to Acqusitions
2 - See the dropdown "Fund: All funds" in the order search section
3 - Click it
4 - Feel disappointed
5 - Apply patch and restart all
6 - Reload and click the dropdown
7 - Options! Feel warm and fuzzy

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:31:00 +01:00
Nick Clemens 58ec1ed304
Bug 39022: Display the current previous patron list before updating stored values
This patch just reverses the order so we display the list, then update it.

To test:
 1 - Enable showLastPatron system preference and set showLastPatronCount to 1
 2 - Go to a patron, say Ronnie Ballard
 3 - Note you have a link to 'Last patron' - hover or click split dropdown and see it is the patron you are viewing
 4 - Search for another patron, Edna Acosta
 5 - Note the 'Last patron' links point to Edna, and not Ronnie
 6 - Apply patch
 7 - Reload Edna, note last patron lists Edna
 8 - Search for Ronnie
 9 - Confirm previous patron is linked to Edna
10 - Click the link to go to Edna
11 - Confirm last patron now links to Ronnie
12 - Instead of following link, click on another tab for patron
13 - Now the link is updated to current patron, this was behaviour before 21246 as well
14 - Sign off.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:30:59 +01:00
Victor Grousset/tuxayo 7752b0e7cf
Bug 39132: Fix dbic: Revert changes to Schema.pm
It's autogenerated and checksum protected so should be touch only by
dbic.

JD amended patch: just the revert to Koha/Schema.pm here
Koha/Schema.pm will be skipped on bug 39115 (otherwise I will have to
rebase)
original title: Bug 39132: Fix dbic: Revert changes to Schema.pm and add it to denylist

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:30:59 +01:00
Tomas Cohen Arazi 9cbc606697
Bug 38988: Make the polling use case be normal in about page
This patch makes choosing `polling` for the `JobsNotificationMethod`
system preference not be considered problematic or different than
`STOMP`.

To test:
1. In `KTD` make sure you have `STOMP` selected
2. Make sure rabbitmq is running:
   $ ktd --shell
  k$ sudo -s
   $ service rabbitmq-server start
3. Go to the about page, 'Server information'
=> SUCCESS: 'Using RabbitMQ' displayed
4. Stop rabbit
   $ service rabbitmq-server stop
5. Repeat 3
=> SUCCESS: Using Rabbit but fallback to polling
6. Go to the 'System information' tab
=> SUCCESS: Error message about the broker not functional
7. Choose 'polling'
8. Repeat 3
=> FAIL: It says 'Using SQL polling' but in bold face <.<
9. Repeat 6
=> FAIL: There's an error about the broker, which we explicitly asked
not to use <.<
10. Apply this patch
11. Repeat 3
=> SUCCESS: Nothing weird, 'Using SQL polling' displayed.
12. Repeat 6
=> SUCCESS: No weird error about the broker.
13. Switch to 'STOMP'
=> SUCCESS: Behavior is the same with/without rabbit running
14. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:30:58 +01:00
Jonathan Druart bf14a89382
Bug 39112: Force the response on a single line
We don't need an empty blank line.

Might not have been caused by the tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:30:58 +01:00
Owen Leonard 6e0b7413e9
Bug 39112: Fix item search results error
This patch updates the template which generates item search JSON (for
use by the DataTable) to add a 'collapse' FILTER around it. This
eliminates whitespace which causes the JSON to be invalid.

To test, apply the patch and perform an item search in the staff
interface. It should return results without error.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:30:57 +01:00
Jonathan Druart 2ebf61c174
Bug 39126: tidy - Show error if stderr_buf is empty
If yarn is not installed:
Tidying file 1/1 (koha-tmpl/intranet-tmpl/prog/fr-FR/modules/intranet-main.tt)
Warning: something's wrong at misc/devel/tidy.pl line 79.

There is the error hidden in $error_message
open3: exec of yarn --silent run prettier --write koha-tmpl/intranet-tmpl/prog/fr-FR/modules/intranet-main.tt failed: No such file or directory

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-13 15:30:56 +01:00
Nick Clemens 796bfddf87
Bug 39056: Do not copy preferred_name to new patron when using Duplicate
It looks like this was a type/copy paste error, template fixed

To test:
1 - Find a patron, ensure preferred_name is populated
2 - Duplicate
3 - Note preferred_name is carried over
4 - Apply patch
5 - Cancel and duplicate again
6 - Preferred name is blank!

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-12 15:28:18 +01:00
Baptiste Wojtkowski b65eb561e9
Bug 38847: Fix error when renewing an expired child patron without a guarantor
This fixes an internal server error when renewing an expired
child patron without a guarantor, when the ChildNeedsGuarantor
is set to "must have".

Test plan:
1. Create or edit a child patron:
   - Don't add a guarantor.
   - Set the "Expiry date" to a date in the past.
2. Set the ChildNeedsGuarantor system preference to "must have".
3. Refresh or view the patron's check out or details page, and
   select the "Renew" link under the attention heading -
   this generates an internal server error message.
4. Apply patch.
5. Repeat step 3, you will now get a standard error message
   "This patron could not be renewed: they need a guarantor."
6. Add a guarantor for the patron.
7. Repeat step 3, and click "Renew" - the patron is now renewed.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-12 15:28:17 +01:00
Nick Clemens 9a1e7654e5
Bug 34971: (QA follow-up) Op is now cud-reopen
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-12 15:28:17 +01:00
Baptiste Wojtkowski 7298dc064f
Bug 34971: Fix permission to close a serial subscription (edit)
Note: there is a minor bug I had to correct, I don't split into two
patches since it is very minor and necessary to test that one.

Patch 1 - (this one) When a user is on serial collection information, the subscription is
not passed to the template, and therefore not passed to serials-toolbar.inc.
This makes sense if collection information is called with a biblionumber
but not if collection information is called with a subscription id.
Consequently, subscription.closed is always false and it is not possible
to reopen a basket.

Patch 2 - User with incorrect permission can close serials, they just
need to access to the page. This is due to serials-toolbar.inc expecting
a variable named "cannotedit", which is provided by
"subscription-details.pl" and not by "serials-collection.pl"

TEST PLAN:
Before applying patches :
1 - log in as a user with only receive_serial permission
2 - Open two pages one on
  /serials-collection.pl?subscriptionid=ID_A, another on
  /serials-collection.pl?subscriptionid=ID_B
3 - On serial A's collection page, check you can close the serial (wrong
  behaviour), note you can close it again but not reopen it
4 - Apply first patch
5 - Check you can reopen the serial (wrong behaviour) keep the page open
6 - On serial B's collection page, close the serial, keep the page open
7 - Apply second patch
8 - On page left open on 3 -, click on close, you are redirected to a
  login page.
8 - Go back to serial A's collection page -> there is no close button
  anymore
9 - On page left open on 4 -, click on reopen, you are redirected to a
  login page
10 - Go back to serial B's collection page -> there is no close button
  anymore

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-12 15:28:16 +01:00
Baptiste Wojtkowski 268d725eab
Bug 34971: Fix reopen button display on serial-collection
Patch 1 - (this one) When a user is on serial collection information, the subscription is
not passed to the template, and therefore not passed to serials-toolbar.inc.
This makes sense if collection information is called with a biblionumber
but not if collection information is called with a subscription id.
Consequently, subscription.closed is always false and it is not possible
to reopen a basket.

Patch 2 - User with incorrect permission can close serials, they just
need to access to the page. This is due to serials-toolbar.inc expecting
a variable named "cannotedit", which is provided by
"subscription-details.pl" and not by "serials-collection.pl"

TEST PLAN:
Before applying patches :
1 - log in as a user with only receive_serial permission
2 - Open two pages one on
  /serials-collection.pl?subscriptionid=ID_A, another on
  /serials-collection.pl?subscriptionid=ID_B
3 - On serial A's collection page, check you can close the serial (wrong
  behaviour), note you can close it again but not reopen it
4 - Apply first patch
5 - Check you can reopen the serial (wrong behaviour) keep the page open
6 - On serial B's collection page, close the serial, keep the page open
7 - Apply second patch
8 - On page left open on 3 -, click on close, you are redirected to a
  login page.
8 - Go back to serial A's collection page -> there is no close button
  anymore
9 - On page left open on 4 -, click on reopen, you are redirected to a
  login page
10 - Go back to serial B's collection page -> there is no close button
  anymore

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-12 15:28:16 +01:00
Jonathan Druart 6a24b67031
Bug 39000: Restore bg-danger color
In ktd 369 will show the "Encoding error" block:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=369

The background color has changed this the bootstrap update and now looks
ugly.

This patch reuse the same color (#f2dede) we had before the upgrade

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-12 15:28:15 +01:00
Jonathan Druart a76a1f0073
Bug 38664: The auto-rebase script - Create parent directory if missing
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-12 12:12:16 +01:00
Hammat Wele 2f9b826a55
Bug 38892: Show correct error message when we attempt to add guarantor as a child
When we attempt to add child as guarantor the error message shown is 'A guarantor cannot be a guarantee.' it doesn't make sense

To recreate:
1. Go to Patrons
2. Click 'New patron' > 'Kid'
3. Fill out surname and cardnumber
4. Under Patron guarantor, click Add guarantor
5. Search for category = Kid and choose one of the patrons
6. Choose the relationship
7. Click 'Save'
   --> Error A guarantor cannot be a guarantee.
8. Apply the patch
9. repeat previous steps
10. After clicking Save
   --> the error message shown is «Child patron cannot be a guarantor.»

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-12 12:12:15 +01:00
Jonathan Druart 86ea12f369
Bug 38664: Revert changes to errorpage.tt
This patch reverts the changes from bug 38718 made to errorpage.tt

It fixes Auth/csrf.ts cypress test, but most important restores the
correct UI on the error page when there is a CSRF error.

This was caused by the STOP from blocking_errors, that is introduced by
messages.inc included by main-container.inc
2025-02-12 07:05:51 +01:00
Jonathan Druart 60c71484ba
Bug 38664: Fix updatedatabase.pl
This patch fixes the following error:
sort (...) interpreted as function at /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 25950.

sort @words and sort { $a cmp $b } @words are functionally identical because
Perl's default sort behavior is string-wise ascending order (which is exactly
what { $a cmp $b } specifies).
2025-02-12 06:39:59 +01:00
Jonathan Druart a1d1d40155
Bug 38664: Add +x to xt/tt_tidy.t 2025-02-12 06:39:58 +01:00
Jonathan Druart 6daf09496a
Bug 38664: Add a xt test for TT files 2025-02-11 23:39:26 +01:00
Jonathan Druart c3f94f3d54
Bug 38664: xt/find-missing-filters.t
I have NO idea why this has been caught by the tidy patch!
2025-02-11 22:31:29 +01:00
Jonathan Druart 6836c428f4
Bug 38664: Fix xt/author/valid-templates.t
There was a missing END in basket/basket.tt (it should have been raised
by the tidy that something wrong happened, to investigate later)

The branch-selector change is a trick to make the test pass, or it fails
with:
  # undef error - WHILE loop terminated (> 1000 iterations)
2025-02-11 22:31:28 +01:00
Jonathan Druart bd3e07c756
Bug 38664: Revert changse made to t/db_dependent/misc/translator/sample.tt
We don't want to comment the whole block or it won't be parsed by the
translator tool.

This has been done initially to make the prettier plugin happy but it
didn't handle TT comments correctly. Now with version 2.0.2 it should be
better.

This patch fixes t/db_dependent/misc/translator/xgettext-tt2.t
2025-02-11 22:31:27 +01:00
Jonathan Druart cfec07a55b
Bug 38664: Update yarn.lock 2025-02-11 22:31:26 +01:00
Jonathan Druart 70cbed2da9
Bug 38664: Bump the version of the prettier plugin
It improves the parsing of TT comments, as well as correctly supporting
prettier-ignore within TT comments
2025-02-11 22:31:25 +01:00
Jonathan Druart 2b6598f01a
Bug 38664: prettier-ignore virtualshelves/tables/shelves_results.tt
You must have the version 2.0.2 of the prettier plugin!
2025-02-11 22:31:25 +01:00