]> git.koha-community.org Git - koha.git/log
koha.git
11 hours agoBug 37528: (QA follow-up) Slight rephrase of system preference and warning message
Katrin Fischer [Fri, 18 Oct 2024 11:41:01 +0000 (11:41 +0000)]
Bug 37528: (QA follow-up) Slight rephrase of system preference and warning message

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 hours agoBug 37892: (QA follow-up) Fix condition in memberentry
Marcel de Rooy [Fri, 20 Sep 2024 09:07:42 +0000 (09:07 +0000)]
Bug 37892: (QA follow-up) Fix condition in memberentry

Patron may be undefined. So the test may crash.
Also there is an issue with operator precedence.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 hours agoBug 37892: (QA follow-up) Add tests for ->is_guarantor/ee
Marcel de Rooy [Fri, 20 Sep 2024 08:44:30 +0000 (08:44 +0000)]
Bug 37892: (QA follow-up) Add tests for ->is_guarantor/ee

Test plan:
Run t/db_dependent/Koha/Patron.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 hours agoBug 37892: Fix guarantor restriction, add tests
Nick Clemens [Wed, 11 Sep 2024 14:04:17 +0000 (14:04 +0000)]
Bug 37892: Fix guarantor restriction, add tests

[SQUASHED IN QA]

These patches will alter the checks for a patron that prevent a category with
'can_be_guarantee' from being a guarantor.  Two patrons in the same category should be
allowed to have a guarantee/guarantor relationship

The tests below assume you are using the KTD sample data. Update borrowernumbers if not.

To test:
 0 - Apply tests patch
 1 - Set the 'Patron' category as 'Can be a guarantee'
 2 - Add a relationship between two patrons of the same category
     This is restricted from the staff interface
     perl -e 'use Koha::Patrons; my $p = Koha::Patrons->find(5)->add_guarantor({ guarantor_id => 23, relationship => 'father'});'
 3 - Note there is no warning or exception. This should be allowed.
 4 - Checkout an item to Edna (borrowernumber 5)
 5 - Set 'TrackLastPatronActivityTriggers' to 'Checking in an item'
 6 - Try to check the item in, KABOOM
 7 - Set 'TrackLastPatronActivityTriggers' to 'Checking out an item'
 8 - Try to issue an item to Enda, KABOOM
 9 - prove -v t/db_dependent/Koha/Patron.t, fail
10 - Apply second patch
11 - prove -v t/db_dependent/Koha/Patron.t, one more test passes, but then fail
12 - Apply third patch
13 - prove -v t/db_dependent/Koha/Patron.t, pass!
14 - restart_all
15 - Checkout to Enda, OK!
16 - Checkin from Edna, OK!
17 - Find two more patrons in the category and attempt to link them
18 - 'Guarantor cannot be a guarantee'
19 - Apply fourth patch
20 - You can add a guarantor from the same category in interface
21 - Try to add a guarantor to the guarantor assigned in 20
22 - Confirm you cannot add a guarantor - "Guarantor cannot be a guarantee"

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Bug 37892: Fix patron updates

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Bug 37892: Fix patron creation

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Bug 37892: Fix memberentry.pl

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Bug 37892: (follow-up) Fix patron creation

This patch fixes the 22. of the test plan (22 - Confirm you cannot add a guarantor - "Guarantor cannot be a guarantee"
        )

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Bug 37892: (follow-up) Fix patron creation

TEST PLAN:
1 - Do the 22 parts of the test plan
2 - Add a guarantor to one patron not selected before (let's say A is
  the guarantee, B the guarantor)
3 - Try and add a guarantor to B -> you will success
4 - Remove B's guarantor
5 - Apply this patch
6 - Repeat 3 -> you will not be able to

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Bug 37892: (follow-up) Tidyness

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT]
Renamed a subtest to patron creation tests in Patron.t.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 hours agoBug 37528: (follow-up) Add help strings for blank borrowerrelationship
Baptiste Wojtkowski [Wed, 9 Oct 2024 07:39:07 +0000 (09:39 +0200)]
Bug 37528: (follow-up) Add help strings for blank borrowerrelationship

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 hours agoBug 37528: (follow-up) Tidyness
Baptiste Wojtkowski [Mon, 16 Sep 2024 13:32:14 +0000 (15:32 +0200)]
Bug 37528: (follow-up) Tidyness

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 hours agoBug 37528: check if selected relationship is valid
Johanna Räisä [Thu, 1 Aug 2024 05:46:09 +0000 (08:46 +0300)]
Bug 37528: check if selected relationship is valid

This patch checks if the selected relationship is valid before trying to save the patron record.
It takes the list of valid relationships from borrowerRelationships syspref and checks if the selected relationship is in the list.

Also this patch fixes relationship field required message when BorrowerMandatoryField is not set.
The required message is shown when adding the guarantee from guarantor's detail page.

Test plan:
1) Add at least one option to borrowerRelationships syspref.
2) Leave the relationship unchecked from BorrowerMandatoryField syspref.
3) Create a new guarantee patron.
4) Add a guarantor to the guarantee patron.
5) Leave the relationship field empty and try to save the patron record.
6) Notice the 500 error page.
7) Apply the patch.
8) Repeat steps 3-5.
9) Notice the error message "Guarantor relationship is invalid".

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 hours agoBug 38183: Get the active tab number from data-attribute
Lucas Gass [Tue, 15 Oct 2024 23:50:00 +0000 (23:50 +0000)]
Bug 38183: Get the active tab number from data-attribute

To test:

1. Have more than 1 staff member who can manage suggestions
2. Create some suggestions
3. Move some suggestions to different statuses (Pending/Accepted/Rejected) so you have multiple tabs on the "Suggestions management" page.
4. Go to the first tab, check some suggestions, and click "Select manager" under "Update manager".
5. Pick a new manager, notice nothing changes on that tab.
6. Now look at the last tab in your list of tabs, see the suggestion manager has been set incorrectly to the last tab.
7. APPLY PATCH
8. Try 4-5 again. The manager should be selected correctly.
9. Try setting the manaager from every tab, making sure it works right.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 hours agoBug 38156: Sort issues by borrowernumber before parallel chunking
Emily Lamancusa [Fri, 11 Oct 2024 19:26:25 +0000 (15:26 -0400)]
Bug 38156: Sort issues by borrowernumber before parallel chunking

When the automatic renewal cron job is using parallel processing, it
aims to process all of the renewals for any given patron together in one
chunk to avoid data conflicts. To accomplish this, it starts a new data
chunk each time it encounters a new patron. However, if a patron's
renewing checkouts aren't all consecutive in the database, that patron's
data ends up split across multiple chunks.

We need to sort the issues by borrowernumber before attempting to chunk
them in order to make sure they are chunked and processed correctly.

To test (using KTD default test data):
Setup:
1. Edit the default circulation rule:
    - Set Automatic renewal to "Yes"
    - Set No automatic renewal before to 3
2. Open the following patron accounts in separate tabs:
    - Floyd Delgado
    - Joyce Gaines
    - Edna Acosta
    - Mary Burton
3. Perform the following patron account edits for each of the above
   patrons (and keep the tabs open):
    - Enable automatic renewal notices, and set them to digests only
    - Add a value to the email field
4. Enter the kshell (ktd --shell)
5. Edit /etc/koha/sites/kohadev/koha-conf.xml, and add the following
   lines near the end, just above the </config> and </yazgfs> closing
   tags:
<auto_renew_cronjob>
    <parallel_loops_count>2</parallel_loops_count>
</auto_renew_cronjob>
6. restart_all

Reproducing the issue:
7. Apply the test patch only
8. Run perl generate_checkouts.pl to generate test data
9. perl misc/cronjobs/automatic_renewals.pl -v -c
--> The test patch added output that will show how the renewals were
    chunked into "chunk 0" and "chunk 1" for the two parallel loops.
    Note that the issues for each borrower are not processed nicely in
    one chunk, but are separated across multiple chunks and alternated
    with other borrowers.
10. Check the checkouts for each of the four patrons from above
--> All checkouts should have renewed
11. Check the notices tab for each of the four patrons
--> Notice errors in the automatic renewal digest notices. A patron's
    renewals may be split across multiple digests, a digest may be
    missing renewals, or a patron may not have received a digest at all

Testing the patch:
12. Apply the second patch
13. Reset the due dates on all checkouts so that they will all be
    eligible for automatic renewal again:
    - koha-mysql kohadev
    - UPDATE issues SET date_due=<two days from today>;
14. perl misc/cronjobs/automatic_renewals.pl -v -c
--> Note that the renewals are now correctly chunked by patron
15. Check the checkouts and notices tab for each of the four patrons
--> All checkouts should have renewed, and all patrons should have a
    single new Auto Renewals Digest notice that correctly lists all of
    their renewed items

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidied the code block inline (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 13342: Not logged user can place a review/comment
Hammat Wele [Tue, 3 Sep 2024 20:31:21 +0000 (20:31 +0000)]
Bug 13342: Not logged user can place a review/comment

We are able to comment a notice even when no user is connected

To test

1. Log in to OPAC.
2. Find a Biblio and open the comments tab.
3. Open another tab/window, and log out from the account.
4. Return to the first tab.
5. Click "Post your comments on this title."
 --> We are able to post a comment
6. Apply the patch
7. Repeat step 1, 2, 3, 4, 5
 --> You should be redirected to the login page.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Bug 13342: Tidy

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 37720: (follow-up) Adjust tests
Lucas Gass [Mon, 30 Sep 2024 20:45:04 +0000 (20:45 +0000)]
Bug 37720: (follow-up) Adjust tests

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 37720: Prevent XSS in label creator
Jonathan Druart [Wed, 28 Aug 2024 10:18:06 +0000 (12:18 +0200)]
Bug 37720: Prevent XSS in label creator

Because labels/label-edit-batch.pl fills a DataTable with things that include
a link created by C4/Creators/Lib.pm, it outputs them with the $raw filter,
so HTML in author/title/callnumber is executed in the label batch editor.
While we wait for a fix that moves the link creation into the template and
out of C4, encoding HTML in Lib.pm for the bits going into the link, and
switching from $raw to the html filter for the rest of the things, will at
least get rid of the XSS.

Test plan:
 1. Without this patch, but with the patch from bug 37654 so you don't get
    alert()s in batch import, download attachment 170675 [details]
 2. Cataloging - Stage records for import - browse to the downloaded file -
    Upload file - when the upload finishes Stage for import - when staging
    finishes View batch (get alert()s if you didn't apply bug 37654) - Import
    this batch into the catalog
 3. Once the import finishes, Cataloging - Manage staged records
 4. In the row for your import, in the # Items column, click "(Create label
    batch)"
 5. In the "Label batch #n created" message, click the link to the batch #
 6. Because the batch includes a call number with an open <script>, you'll
    get XSS alert()s and then one about something going wrong while loading
    the table, with only one of the two records showing in the batch editor
 7. Apply patch, restart_all
 8. Cataloging - Label creator - Manage Label batches
 9. In the row for your batch, click Edit
10. You will see both labels, with their attempts at XSS visible as text
    rather than being interpreted as HTML

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 37681: Fix XSS in staff interface item URLs on detail page
David Cook [Tue, 20 Aug 2024 00:54:38 +0000 (00:54 +0000)]
Bug 37681: Fix XSS in staff interface item URLs on detail page

This patch uses Javascript objects and safe sinks to prevent XSS
in the item URLs on the staff interface detail page.

It also makes sure those URLs don't get double-escaped. Yippee!

Test plan:
0. Apply the patch
1. Add/edit an item with the following URL:
http://prosentient.com.au?q=http%3A%2F%2Fprosentient.com.au
2. Add/edit a different item with the following URLs:
http://prosentient.com.au?q=http%3A%2F%2Fprosentient.com.au |
http://prosentient.com.au?q=http%3A%2F%2Fprosentient.com.au
3. Go to the staff interface detail page
4. Notice that the URLs are not double-encoded!
5. Try out a malicious payload (talk to QA/security about this)
6. Confirm that the malicious payload fails to execute the XSS
7. Celebrate!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 36598: (QA follow-up): tidy up code
Victor Grousset/tuxayo [Tue, 14 May 2024 18:39:00 +0000 (20:39 +0200)]
Bug 36598: (QA follow-up): tidy up code

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 36598: Add comments asking to keep both CSRF checks in sync
Julian Maurice [Tue, 14 May 2024 07:34:31 +0000 (09:34 +0200)]
Bug 36598: Add comments asking to keep both CSRF checks in sync

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 36598: Prevent use of unsafe HTTP method with non-cud op parameter
Julian Maurice [Tue, 14 May 2024 07:15:50 +0000 (09:15 +0200)]
Bug 36598: Prevent use of unsafe HTTP method with non-cud op parameter

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 36598: Improve documentation and error message in CSRF plugin
Julian Maurice [Mon, 13 May 2024 13:06:04 +0000 (15:06 +0200)]
Bug 36598: Improve documentation and error message in CSRF plugin

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 36598: Fix CSRF header name (underscore -> hyphen)
Julian Maurice [Fri, 3 May 2024 07:17:37 +0000 (09:17 +0200)]
Bug 36598: Fix CSRF header name (underscore -> hyphen)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 36598: Prohibit CUD operations with safe HTTP methods (GET/HEAD/...)
Julian Maurice [Mon, 15 Apr 2024 07:08:48 +0000 (09:08 +0200)]
Bug 36598: Prohibit CUD operations with safe HTTP methods (GET/HEAD/...)

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 36598: Enable CSRF protection for Mojolicious apps
Julian Maurice [Fri, 12 Apr 2024 13:08:17 +0000 (15:08 +0200)]
Bug 36598: Enable CSRF protection for Mojolicious apps

Test plan:
1. Run bin/opac daemon -l http://*:3001/
2. Go to http://localhost:3001/cgi-bin/koha/opac-user.pl
3. With browser devtools, locate csrf_token hidden input within the
   login form and remove it or modify it
4. Try to submit the form with correct credentials, it should fail
   ("Wrong CSRF token")
5. Reload the page, try to log in normally without modifying the DOM, it
   should succeed
6. Run bin/intranet daemon -l http://*:3002/
7. Go to http://localhost:3002/cgi-bin/koha/mainpage.pl
8. With browser devtools, locate csrf_token hidden input within the
   login form and remove it or modify it
9. Try to submit the form with correct credentials, it should fail
   ("Wrong CSRF token")
10. Reload the page, try to log in normally without modifying the DOM,
    it should succeed
11. Run prove t/db_dependent/mojo/csrf.t

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 37654: XSS in Batch record import for Citation column
Phil Ringnalda [Fri, 16 Aug 2024 02:57:42 +0000 (19:57 -0700)]
Bug 37654: XSS in Batch record import for Citation column

Viewing a staged MARC record batch loads a DataTable from
/tools/batch_records_ajax.pl, and both batch_records_ajax.pl and the
DataTable just trust the author/title/isbn/issn to be free of HTML. They
shouldn't.

Test plan:
1. Without this patch applied, download attachment 170418, then Cataloging
   - Stage records for import - Select the downloaded file - Upload file -
   Stage for import
2. When the background job completes, View batch - you'll get three alert()s
   from the title, author, and ISSN, and the author and ISSN displayed huge
3. Apply patch, restart_all
4. Manage staged records - click HTMLescapingimporttestrecord.mrc - get zero
   alerts and no <h2> display

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 37656: XSS in Advanced editor from Z39.50 search results
Phil Ringnalda [Fri, 16 Aug 2024 04:22:12 +0000 (21:22 -0700)]
Bug 37656: XSS in Advanced editor from Z39.50 search results

The Advanced editor inserts data from Z39.50 results into the search results
page without escaping HTML. Whether it's German records with "<<A>> Title"
or someone with a compromised catalog or a book with the title "<em> for
emphasis" it shouldn't.

Test plan:
 1. Not a dependency, but you'll avoid getting even more alerts while batch
    importing by starting with the patch from bug 37654
 2. Without this patch applied, download attachment 170421
 3. Administration - set the preference EnableAdvancedCatalogingEditor to
    Enable
 4. Cataloging - Stage records for import - browse to the downloaded file -
    Upload file - Stage for import
 5. Once the background job finishes, View batch (getting alerts if you
    didn't apply the patch from bug 37654) - Import this batch into the
    catalog
 6. When the import finishes, Search the catalog for script, on the imported
    record Edit record (if you wind up in the basic editor, Settings - Switch
    to Advanced editor)
 7. In the left sidebar below the search inputs, click Advanced », check
    the checkbox for Local catalog and uncheck any others, then search for
    the Title script
 8. You'll get five alerts, and the word "edition" displayed in huge text
 9. Close the search popup, apply patch, shift+reload the advanced editor
    page to clear your cache
10. Repeat step 7, but this time you won't get any alerts, and you'll see
    the title and the other <script> inclusions.

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 hours agoBug 37655: Basic editor needs to HTML-escape the bib record title used as a heading
Phil Ringnalda [Thu, 15 Aug 2024 22:41:18 +0000 (15:41 -0700)]
Bug 37655: Basic editor needs to HTML-escape the bib record title used as a heading

We stick the title of a bib record you are editing in the basic editor into
an <h1> without escaping any HTML it might contain. We should instead escape
it.

Test plan:

1. Without the patch, search for any record in the catalog and click Edit
   record (if you are in the advanced editor, switch to the basic one)
2. Tab 2, Field 245, Subfield a, paste <script>alert('boo ❤')</script><h2>
   at the end of the subfield
3. Save, then from the record detail page select Edit - Edit record
4. You will have gotten an alert(), and the entire form will be the size
   of an <h2>. That's ugly, so go back to the detail page.
5. Apply patch, restart_all
6. Edit - Edit record
7. Now you should not get an alert, the whole title inluding the <script>
   should display in italics, and the "(Record number nnn)" after it should
   not be italicized.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 days agoBug 37838: Fix broken remove button in course reserves
wainuiwitikapark [Tue, 10 Sep 2024 03:06:15 +0000 (03:06 +0000)]
Bug 37838: Fix broken remove button in course reserves

To test:
1) Go to staff client -> Course reserves
2) Create a course or go to an existing course
3) Add reserves to the course (will need at least 21 items to be able to go to a second page of results)
4) Go to the second page of results on the course details page
5) Click the Remove button next to a result
6) Notice how the button just makes the page move to the top
7) Apply patch
8) Repeat steps 1-5
9) Notice how the remove button is working as expected

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 days agoBug 38112: (QA follow-up) Hide description when search is cleared
Emily Lamancusa [Tue, 15 Oct 2024 20:50:03 +0000 (16:50 -0400)]
Bug 38112: (QA follow-up) Hide description when search is cleared

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 days agoBug 38112: Restore description of patrons search
Jonathan Druart [Tue, 8 Oct 2024 08:43:41 +0000 (10:43 +0200)]
Bug 38112: Restore description of patrons search

Certainly caused by bug 35329.

We used to display a description of the patrons search, but it is no longer displayed.

Test plan:
On the main patrons search select some values in the form on the left
and search. You should see a "Patrons found for: " h3 that will be
displayed and is supposed to describe the current search.
I don't think it's working very well to be honest, maybe a candidate for
candidate, especially if nobody else noticed its disappearance.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 days agoBug 38162: Pass the rota_id correctly when deleting
Lucas Gass [Sat, 12 Oct 2024 14:28:57 +0000 (14:28 +0000)]
Bug 38162: Pass the rota_id correctly when deleting

To test:

1. Enable StockRotation
2. Got to Cataloging -> Stock rotation
3. Create a new Rota
4. Try to delete it
5. See the error "Can't call method "delete" on an undefined value at /kohadevbox/koha/tools/stockrotation.pl line 231"
6. APPLY PATCH
7. Try again, the rota should be deleted properly.

Signed-off-by: Laura ONeil <laura@bywatersolutions.com>
Signed-off-by: Alyssa <alyssa.drake@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 days agoBug 38146: Display full datetime of datelastseen in item holdings
Emily Lamancusa [Thu, 10 Oct 2024 18:31:45 +0000 (14:31 -0400)]
Bug 38146: Display full datetime of datelastseen in item holdings

To test:
1. Check in an item
2. Look at the item holdings table for the bib record that item is on
--> Note the date last seen column displays dates, but not the time
3. Apply patch and restart_all
4. Refresh the page
--> Date last seen column now shows the time you checked the item in

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 days agoBug 38005: (follow-up) Add/adjust tests
Lucas Gass [Fri, 11 Oct 2024 19:12:18 +0000 (19:12 +0000)]
Bug 38005: (follow-up) Add/adjust tests

NC amended patch, tidied
Bug 38005: (QA follow-up) Tidy

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 days agoBug 38126: Skip allocated holds when filling from transport cost matrix
Nick Clemens [Tue, 8 Oct 2024 18:10:46 +0000 (18:10 +0000)]
Bug 38126: Skip allocated holds when filling from transport cost matrix

This patch simply weeds out allocated holds before filling from the matrix

To test:
 1 - Enable RealTimeHoldsQueue
 2 - Enable UseTransportCostMatrix
 3 - Enable LocalHoldsPriority Give/Home/Home
 4 - Administration - Transport cost matrix - enable transfers to/from Centreville and other libraries, add a cost, and save
 5 - Find a bib with a Centerville item
 6 - Place a hold for a centerville patron
 7 - Circulation - Holds queue - All libraries
 8 - Note hold is entered twice
 9 - On command line:
    perl misc/cronjobs/holds/build_holds_queue.pl --force
10 - Run holds queue again, still there twice
11 - Apply patch
12 - On command line:
    perl misc/cronjobs/holds/build_holds_queue.pl --force
    Confirm allocated only once
13 - Delete hold, place again from bib record (to test real time allocation)
14 - Confirm allocated only once

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38016: Rename booking circulation rules
Aleisha Amohia [Fri, 27 Sep 2024 14:57:48 +0000 (14:57 +0000)]
Bug 38016: Rename booking circulation rules

This enhancement renames the bookings circulation rules to better describe what they do.

To test:

1. Go to Koha Administration -> Circulation and fines rules
2. Scroll to the 'Default holds and bookings policies by item type' section
3. Notice the bookings rules in this table:
  - Booking preparation period
  - Booking precaution period
4. Apply the patch and refresh the page
5. Confirm the bookings have been renamed to:
  - Booking pre-processing (days)
  - Booking post-processing (days)
6. Confirm these names make sense and it is clear what the rules are used for and how they are applied
7. Put values in the input fields for these rules and confirm saving a rule works as expected

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38129: Display note regarding permissions in suggestion manager search pop-up...
Jonathan Druart [Wed, 9 Oct 2024 07:35:27 +0000 (09:35 +0200)]
Bug 38129: Display note regarding permissions in suggestion manager search pop-up modal

1. In the staff interface, go to More > Suggestions > New purchase
   suggestion
2. Click 'Select manager'
   => With this patch you see a note regarding permissions
3. Search for 'alford' (for example)
   => User is not returned, they do not have the suggestion permission

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 36742: (follow-up) Add hidden branchcode input for OPAC article requests
Owen Leonard [Tue, 2 Jul 2024 13:55:47 +0000 (13:55 +0000)]
Bug 36742: (follow-up) Add hidden branchcode input for OPAC article requests

This patch adds a hidden input containing the logged-in user's
branchcode to the article request form when there is only one public
branch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 36742: Do not show library selection options if there is one or fewer public...
Owen Leonard [Thu, 27 Jun 2024 19:15:11 +0000 (19:15 +0000)]
Bug 36742: Do not show library selection options if there is one or fewer public libraries

If a system has only one library or only one library which is public we
don't need to show library-selection menus. It doesn't make sense to
show a dropdown with only one choice.

This patch updates instances of Branches.all to add a "public => 1"
parameter.

To test, apply the patch and start with a set of multiple public
libraries in your system (where public means the entry in Administration
-> Libraries for that library has the "Public" option set to "Yes").

Log in to the OPAC test these pages, in each case confirming that the
the library dropdown appears correctly.

- OPAC home page (with OpacAddMastheadLibraryPulldown enabled)
- OPAC news section (with existing news items and OpacNewsLibrarySelect
  enabled)
- Advanced search (Location and availability section)
- The "Most popular" page (with OpacTopissue enabled)
- The suggestion entry form (with suggestion enabled)
- The article request entry form (with ArticleRequests enabled and
  circulation rules configured to allow requests)

Test again with only one library or only one public library.
Test again with no public libraries.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38097: Add class to not_retuned message
Andrew Fuerste Henry [Fri, 4 Oct 2024 16:31:52 +0000 (16:31 +0000)]
Bug 38097: Add class to not_retuned message

To test:
1: Enable ShowAllCheckins
2: Check in an item that was not checked out
3: Find "Item was not checked in" message in checkin table, confirm its only class is "problem"
4: apply patch, restart_all
5: repeat 2
6: confirm "Item was not checked in" now has the class "not_returned"

Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38081: maskitoTimeOptionsGenerator does not properly support 12-hour times in...
CJ Lynce [Thu, 3 Oct 2024 18:02:47 +0000 (18:02 +0000)]
Bug 38081: maskitoTimeOptionsGenerator does not properly support 12-hour times in calendar.inc

This patch corrects an issue where flatpickr time-only input boxes
    boxes were not having their inputs masked (limited) properly
    due to maskitoTimeOptionsGenerator not properly supporting
    12-hour time inputs for time-only input boxes.

To test:
1. Login to the staff intranet.
2. Open Administration->Libraries-> Edit any library.
3. Open your browser's development console (typically via F12)
    Verify a 'TypeError' message has been thrown for this page.
4. Type in any text into any of the opening hours
    This should be limiting only to properly formatted HH:MM.
5. Apply patch
6. Repeat steps 2-4
    Verify no errors show on your browser's development console.
    Verify opening hours entry are limited to proper HH:MM format.
7. Open Administration->System Preferences and change TimeFormat
    to 12-hours, Save.
8. Repeat steps 2-4
    Verify opening hours text entry are limited to properly
    formatted HH:MM AM/PM (or am/pm)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 13945: Prevent multiple dialog modals from popping up when capturing a hold at...
Laura Escamilla [Wed, 15 May 2024 15:34:22 +0000 (15:34 +0000)]
Bug 13945: Prevent multiple dialog modals from popping up when capturing a hold at checkin

1. Select/Create Library Branches:
    - Select or create two library branches: Library A and Library B.

2. Locate/Create Item:
    - Locate or create an item with the "Current library" and "Home library" set to Library A.

3. Place Hold:
    - Place a hold on the item for a patron whose pickup location is Library B.

4. Check-in at Library A - First Attempt:
    - Check in the item at Library A.
    - Verify that the 'Hold found' modal pops up.
    - Click on 'Confirm hold and transfer'.

5. Check-in at Library A - Second Attempt:
    - Check in the item at Library A again.
    - Verify that the 'Hold found' modal pops up.
    - Click on 'Ignore'.
    - Verify that the 'Please return this item to (Library B)' modal has popped up behind it.

6. Apply Patch and Restart:
    - Apply the patch to the system.
    - Restart all relevant services.

7. Repeat Check-in Process:
    - Repeat steps 4 and 5.
    - Verify that no matter how many times you check in the item and hit 'Ignore' or 'Confirm the hold', the second modal does not pop up.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 23426: (follow-up) Add tests
Jan Kissig [Mon, 22 Jul 2024 10:41:40 +0000 (12:41 +0200)]
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>
7 days agoBug 23426: Add fine items to patron information response in SIP2
Jan Kissig [Thu, 25 Apr 2024 09:13:55 +0000 (11:13 +0200)]
Bug 23426: Add fine items to patron information response in SIP2

This patch adds fine items (AV) to patron information response in SIP2
In addition the active currency we be part of the response (BH)
This also fixes the number of items in the response which are specified in BP and BQ in the request

to test:
a) create a manual invoice for patron 23529000035676 : http://localhost:8081/cgi-bin/koha/members/maninvoice.pl?borrowernumber=19
b) in ktd call: perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1   -l CPL --patron 23529000035676 -m patron_information -s "      Y   "
c) verify that no |AV field is in response
d) apply patch
e) in ktd call: perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1   -l CPL --patron 23529000035676 -m patron_information -s "      Y   "
f) verify that response includes fields like '|AVManual fee '

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Tidied inline
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 37791: (follow-up) Last occurence
Tomas Cohen Arazi [Fri, 30 Aug 2024 11:40:14 +0000 (08:40 -0300)]
Bug 37791: (follow-up) Last occurence

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 37791: Fix 'Biblio not found' messages on the API
Tomas Cohen Arazi [Fri, 30 Aug 2024 11:38:35 +0000 (08:38 -0300)]
Bug 37791: Fix 'Biblio not found' messages on the API

This patch fixes some API-related cases of 'Biblio' terminology
incorrectly used.

To test:
1. Run:
   $ ktd --shell
  k$ git grep 'Biblio not found'
=> FAIL: Several occurences
2. Run:
  k$ git grep 'render_resource_not_found("Biblio")'
=> FAIL: Several occurences
3. Apply this patches
4. Repeat 1 and 2
=> SUCCESS: No more occurences!
5. Run:
  k$ prove t/db_dependent/api/v1/
=> SUCCESS: Tests pass!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 37945: Remove fixedHeader for sysprefs
Jonathan Druart [Wed, 9 Oct 2024 14:01:48 +0000 (16:01 +0200)]
Bug 37945: Remove fixedHeader for sysprefs

It breaks the scroll when a subsection is clicked.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38057: Fix checkmarks in Change framework menu in Advanced editor after Bootstrap...
Phil Ringnalda [Wed, 2 Oct 2024 04:34:10 +0000 (21:34 -0700)]
Bug 38057: Fix checkmarks in Change framework menu in Advanced editor after Bootstrap5 update

The advanced editor was using a class hidden from bootstrap.min.css to
hide checkmarks in the part of the Settings menu that lets you change
frameworks. Now that's gone, so it needs to have its own class.

Test plan:
1. Set the preference EnableAdvancedCatalogingEditor to Enable
2. Cataloging - Advanced editor - click the Settings menu
3. In Change framework, ... checkmarks, checkmarks everywhere, and they
   don't change when you choose a different one, so after the first
   change you can't even tell what's current
4. Apply patch, Shift+Reload the advanced editor page to bypass the cache
5. Click the Setting menu, see that only the current framework has a
   checkmark, change to a different one and reopen the Settings menu,
   see that the one you changed to now has the only checkmark

Sponsored-by: Chetco Community Public Library
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 37954: DBRev 24.06.00.036
Katrin Fischer [Fri, 11 Oct 2024 09:40:36 +0000 (09:40 +0000)]
Bug 37954: DBRev 24.06.00.036

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 37954: Atomic update
Nick Clemens [Thu, 19 Sep 2024 11:40:24 +0000 (11:40 +0000)]
Bug 37954: Atomic update

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 37954: Fix barcode column name
Pedro Amorim [Wed, 18 Sep 2024 10:22:51 +0000 (10:22 +0000)]
Bug 37954: Fix barcode column name

Patch https://github.com/Koha-Community/Koha/commit/6cbbfa2 changed
holdings_barcode to holdings_barcodes

I believe this caused the configuration from the table to no longer
work (barcodes!=barcode)

Test plan:
1) Access any bibllio:
   <staff_url>/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
2) On the top right of the table, click 'Configure'
3) Expand 'Catalog', search for 'holdings_barcode'. Tick 'is hidden by
   default'. Save.
4) Visit the biblio again, notice the column is still showing.
5) Apply patch. Restart all + flush_memcached. Repeat.
6) Bonus: On the table, click 'Show filters'. Make sure barcode
   filtering still works.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 29194: Create logical ordering of patron messaging preferences
Sam Lau [Fri, 26 Jul 2024 16:42:12 +0000 (16:42 +0000)]
Bug 29194: Create logical ordering of patron messaging preferences

This patch introduces a default ordering for patron messaging preferences. The prefs are then sorted by this ordering before being displayed.

To test:
1) Visit a patrons detail page.
2) Note the message prefs aren't ordered (or rather sorted by 'message_attribute_id')
3) Apply patch, restart_all
4) Ensure they are now sorted in teh following fashion:
        'Hold_Filled'      => 1,
        'Hold_Reminder'    => 2,
        'Recall_Requested' => 3,
        'Recall_Waiting'   => 4,
        'Ill_ready'        => 5,
        'Ill_unavailable'  => 6,
        'Ill_update'       => 7,
        'Item_Checkout'    => 8,
        'Auto_Renewals'    => 9,
        'Advance_Notice'   => 10,
        'Item_Due'         => 11,
        'Item_Check_in'    => 12

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Please note discussion on BZ about the preferred order ;)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 36375: Fix inconsistencies in content warning display
Martin Renvoize [Tue, 1 Oct 2024 12:33:57 +0000 (13:33 +0100)]
Bug 36375: Fix inconsistencies in content warning display

As suggested by Fridolin, we move the display into a template to improve
consistency and maintanence and whilst doing this we also pick the
suggested subfield selection.

Signed-off-by: Hannah Prince <hannah.prince@uhb.nhs.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38109: Sort patron category types before display
Nick Clemens [Mon, 7 Oct 2024 19:58:17 +0000 (19:58 +0000)]
Bug 38109: Sort patron category types before display

To test
1 - Patrons -> New patron -> {any category}
2 - Find the category dropdown
3 - Note the order of categories types
4 - Reload the page
5 - Note a new order
6 - Apply patch
7 - Refresh page, category types now ordered (by code)
8 - Refresh again, no change!

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38005: Pass opac_editable to search params when interface is OPAC
Lucas Gass [Wed, 25 Sep 2024 21:17:22 +0000 (21:17 +0000)]
Bug 38005: Pass opac_editable to search params when interface is OPAC

1. Create a patron attribute.
2. Check it as Mandatory.
3. Do NOT make it display or editable in the OPAC.
4. Go to OPAC self reg form
5. You will not see the attribute.
6. Submit the form and see the 500 error.
7. Apply patch, restart_all.
8. Try again, now you should be able to submit the OPAC form.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38043: Add unit tests for KohaTimes TT filter
CJ Lynce [Thu, 3 Oct 2024 14:24:31 +0000 (14:24 +0000)]
Bug 38043: Add unit tests for KohaTimes TT filter

This adds units tests for the new KohaTimes TT filter.
This also corrects a minor issue with a wrong comparitor operation in
    KohaTimes.pm causing a WARN to be thrown.

To test
1. Apply patch
2. prove t/db_dependent/Template/Plugin/KohaTimes.t
3. Verify 5 Tests PASS

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38071: Ensure search.dt is triggered
Jonathan Druart [Mon, 7 Oct 2024 08:49:36 +0000 (10:49 +0200)]
Bug 38071: Ensure search.dt is triggered

I don't really understand why the previous code is not working, but
the search.dt event handler is not correctly set when initComplete is
passed to the constructor (for instance from the patrons search)

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38027: (QA follow-up) Fix flatpickr onChange when input is cleared
Julian Maurice [Fri, 4 Oct 2024 14:03:32 +0000 (16:03 +0200)]
Bug 38027: (QA follow-up) Fix flatpickr onChange when input is cleared

With the onChange event handler fixed, it's ok to call clear() instead
of setDate('')

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38027: Set date to empty value instead of using flatpickr clear()
Lucas Gass [Fri, 27 Sep 2024 21:17:49 +0000 (21:17 +0000)]
Bug 38027: Set date to empty value instead of using flatpickr clear()

1. Find a datetime field in Koha. For example, specifying due dates on the checkout page.
2. Specify a datetime.
3. Use the red 'X' icon to clear the date.
4. Notice a console error 'parsedDate' is undef
5. Now the flatpickr is date, not datetime
6. APPLY patch
7. Try again, this time no console error and the flatpickr remains a datetime one

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 37709: Die and notify if file cannot be opened
Nick Clemens [Thu, 22 Aug 2024 11:35:45 +0000 (11:35 +0000)]
Bug 37709: Die and notify if file cannot be opened

1 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v
2 - Output:
    Characteristic MARC flavour: MARC21

    0 MARC records done in 0.00804400444030762 seconds
3 - Apply patch
4 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v
5 - Output:
    Characteristic MARC flavour: MARC21
    Could not open notafile.mrc: No such file or directory at misc/migration_tools/bulkmarcimport.pl line 262.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 37953: (bug 35138 follow-up) Fix DisplayLibraryFacets - facet order
Jonathan Druart [Wed, 18 Sep 2024 08:40:32 +0000 (10:40 +0200)]
Bug 37953: (bug 35138 follow-up) Fix DisplayLibraryFacets - facet order

Before bug 35138:
DisplayLibraryFacets had priority over the settings in the mappings page.
If you had DisplayLibraryFacets set to "holding library" (only) then only the holding library facet was displayed.

On 231200036 we were not adjusting the facet order/appearance, but the
label, which was wrong. The label must be adjusted for both facets and
the order depending on DisplayLibraryFacets.
Note that bug 37446 is adding a new db rev to adjust the label for
installations that have been updated already.

Test plan:
0. checkout c120975b783 (the commit right before 35138 has been pushed)
1. reset_all
2. holding library is set in DisplayLibraryFacets by default
3. checkout main (so without this patch)
4. updatedatabase
=> ES search result display both facets

5. Repeat 0,1,2 and checkout main + this patch, updatedatabase
=> ES search result display only the holding library facet

Feel free to try with another value in DisplayLibraryFacets

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38118: Display columns if not empty in drawCallback
Jonathan Druart [Tue, 8 Oct 2024 13:38:18 +0000 (15:38 +0200)]
Bug 38118: Display columns if not empty in drawCallback

Instead of updating only when DT init is complete we are going to update
the visibility when the table will be redrawn.

Test plan:
1 - Find/Add a bib record with no items
2 - Add 20 items from Centerville
    Edit ->Edit items -> enter CENTER1 into barcode ->'Add multiple copies' -> 20
3 - Add 20 items from Fairview as above but enter 'FAIR1' for barcode and 'FAIR ITEM' as callnumber
4 - Add 1 item from Midway with barcode MIDWAY1
5 - Edit a midway patron to grant 'catalogue' and 'edit_items' permission - NOT edit_any_item
6 - Sign in as the patron above
7 - Find the record
8 - Note there is callnumber and actions/edit columns
9 - Go to page 2 of items - callnumber visible
10 - Go to page 3 - edit column

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 36435: Catch harmless errors in koha-dump
Aleisha Amohia [Wed, 1 May 2024 02:18:19 +0000 (02:18 +0000)]
Bug 36435: Catch harmless errors in koha-dump

tar has exit status 1 if any file has changed while being read, which is likely to happen as the logfiles are included. this patch will catch these harmless errors so that koha-dump will still return a success code.

Test plan:
1. Create a number of backups and edit their modify time to being older than 2 days
2. run the koha-run-backups script and try and write to one of the files it includes while it's being backed up (you'll trigger a warning from tar saying the file changed as it was being read)
3. verify that the older backups are not being cleaned up and deleted despite new backups being made.
4. Apply this patch
5. Complete steps 1-2 again and then go and look to see if the older backups are being deleted.

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Co-authored-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Michał Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38049: Call .tooltip() only if needed
Jonathan Druart [Tue, 1 Oct 2024 12:15:07 +0000 (14:15 +0200)]
Bug 38049: Call .tooltip() only if needed

This is cheating, yes.

We had a cypress test failing because of this line
  $(...).tooltip is not a function

It's failing randomly on Admin/RecordSources_spec.ts, which does not
need the tooltip.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38049: Remove tooltip call from DT
Jonathan Druart [Tue, 1 Oct 2024 09:42:07 +0000 (11:42 +0200)]
Bug 38049: Remove tooltip call from DT

Not really sure why we had this line, but Owen decided to remove it when
upgrading to Bootstrap5.

So let's remove them from the other files as well.

Waiting for Owen to confirm this one.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoRevert "Bug 37917: Add some wait time to RecordSources_spec.ts for the intercepted...
Jonathan Druart [Tue, 1 Oct 2024 09:40:56 +0000 (11:40 +0200)]
Revert "Bug 37917: Add some wait time to RecordSources_spec.ts for the intercepted request responses"

This reverts commit 23b00bdc06d28e012724a37ed5052bf056026302.

JD: No, really, don't wait.
And it does not fix the issue initially raised on bug 37917

https://bugs.koha-community.org/show_bug.cgi?id=38049
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38089: (follow-up) More fixes for errors in original submission
Martin Renvoize [Mon, 7 Oct 2024 14:26:35 +0000 (15:26 +0100)]
Bug 38089: (follow-up) More fixes for errors in original submission

The original submission missed a number of slip types that are print on
demand without queueing.

These all need an "id" passing in to the template and in some cases we
were also missing passing in the new style parameter too (preservation)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38089: (QA follow-up) Ensure style works on members/printslip.pl
Nick Clemens [Fri, 4 Oct 2024 16:43:44 +0000 (16:43 +0000)]
Bug 38089: (QA follow-up) Ensure style works on members/printslip.pl

When moving the style up, it was moved before the code that handles printing a single slip, i.e.
taking the variables and forming a slip hash.

This patch moves that code to the top and additionally passes through the CODE of the notice so the ID is not blank

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38089: Move style to head and correct regular expression
Martin Renvoize [Fri, 4 Oct 2024 08:26:49 +0000 (09:26 +0100)]
Bug 38089: Move style to head and correct regular expression

This patch moves the local style sections from the body to the head
where they belong and it also updates the regular expression used to
prepend the slip_id id to css selectors rather than replace them

To test:
1 - Create a new notice in the 'Patron (custom slips)' module called 'Testing'
2 - Set print content as:
    Try the  <span class="styled">styling</span> stuff.
3 - Set the 'Format' as:
    .styled {color:red;font-weight: bold;}
4 - Set system preference IntrnaetSlipPrinterJS to "//test"
    http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=IntranetSlipPrinterJS
    This will prevent auto printing popup
5 - Go to a patron and click Print -> Print Testing
6 - Note incorrect styling
7 - Apply patch, restart all
8 - Print Testing again
9 - Confirm styling is correct

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38094: (follow-up) edit_catalogue implies fast_cataloguing
Tomas Cohen Arazi [Fri, 4 Oct 2024 14:41:12 +0000 (11:41 -0300)]
Bug 38094: (follow-up) edit_catalogue implies fast_cataloguing

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38094: Allow librarians with fast add permissions to edit existing fast add records
Kyle M Hall [Fri, 4 Oct 2024 14:10:13 +0000 (10:10 -0400)]
Bug 38094: Allow librarians with fast add permissions to edit existing fast add records

The ability to create fast add records was fixed on bug 38076, but they still cannot be edited after they are saved.

Test Plan:
1) Create a librarian with only fast add cataloging permissions
2) Create a fast add record, save it
3) Attempt to edit that record, you cannot!
4) Apply this patch
5) Restart all the things!
6) Attempt to edit that record, you can!
7) Attempt to edit a non-FA record, you cannot!

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38094: Regression tests
Tomas Cohen Arazi [Fri, 4 Oct 2024 14:27:50 +0000 (11:27 -0300)]
Bug 38094: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38076: (QA follow-up): Make permission edit_catalogue imply fast_cataloging
Kyle M Hall [Fri, 4 Oct 2024 14:56:44 +0000 (10:56 -0400)]
Bug 38076: (QA follow-up): Make permission edit_catalogue imply fast_cataloging

Any librarian with the edit_catalogue sub-permission should also be able
to edit fast catalog records. If that was not true, a cataloger could
not convert fast adds into full records.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38076: Fix inability of fast catalogers to add/edit FA framework records
Kyle M Hall [Thu, 3 Oct 2024 14:09:18 +0000 (14:09 +0000)]
Bug 38076: Fix inability of fast catalogers to add/edit FA framework records

If a librarian does not have the editcatalogue permission, but does have the fast_cataloging permission, they should be able to add and edit fast cataloging records. Instead they are presented with a login screen and the message that they do not have sufficient permissions.

Test Plan:
1) Create a librarian with only fast add cataloging permissions
2) Attempt to create a fast cat item from the circ menu
3) Note the login screen and error
4) Apply this patch
5) Restart all the things!
6) Try again, you can now create FA records!

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
7 days agoBug 38069: (bug 37955 follow-up) Fix edition of table settings
Jonathan Druart [Thu, 3 Oct 2024 07:51:31 +0000 (09:51 +0200)]
Bug 38069: (bug 37955 follow-up) Fix edition of table settings

The form cannot longer be saved, and no appear appear (nothing in log,
nothing on the UI)

This is coming from bug 37955 where we modify the table_id to fix
anchors, but we didn't care of the rest of the code using this TT
variable.

This patch suggests to replace # and _ with |

Test plan:
Confirm that the form can be edited, saved, and that it is taken
correctly into account.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 37265: Consideration of UniqueItemFields setting when receiving items in an order
Michał Dudzik [Mon, 8 Jul 2024 15:23:45 +0000 (17:23 +0200)]
Bug 37265: Consideration of UniqueItemFields setting when receiving items in an order

When using the Koha acquisition module to receive items (basket receiving
an order), Koha does not consideration of UniqueItemFields setting.
The problem is that you can accidentally attach 3 items to an order with the same values.

Test plan:
1. Set preference UniqueItemFields: Public note (itemnotes)
2. Go to the acquisition module.
3. Create a basket with the option for 'Create items when:' set to receiving an order.
4. Add an order to the basket, for example: From a new (empty) record with the Quantity set to 3 or more.
5. Close the basket.
6. Receive the order.
7. Add a public note: TEST, and receive the first item (Add item).
8. You will see that the next item has the same public note.
9. Apply this patch and repeat step 7 - the public note is not used for the next note.

Sponsored-by: kohawbibliotece.pl
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37931: Adjustment for "show fewer" link
Jonathan Druart [Wed, 18 Sep 2024 09:06:18 +0000 (11:06 +0200)]
Bug 37931: Adjustment for "show fewer" link

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37931: Fix OPAC item type facet label
Lari Taskula [Mon, 16 Sep 2024 13:15:34 +0000 (13:15 +0000)]
Bug 37931: Fix OPAC item type facet label

To test:
1. Have additional language installed and set up for OPAC
2. Search something
3. Notice "Item types" facet label untranslated
4. Apply patch and make sure translations are updated
5. Observe facet label "Item types" translated
6. See patch [1] "Bug 36750: Fix some labels" in Bug 36750
7. Observe item type change missing for OPAC but present in staff client

[1] https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166289

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37430: (Bug 33407 follow-up) Unit tests
Nick Clemens [Wed, 12 Jun 2024 11:41:53 +0000 (11:41 +0000)]
Bug 37430: (Bug 33407 follow-up) Unit tests

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37430: (Bug 33407 follow-up) ISBD punctuation removal in ES searches
Janusz Kaczmarek [Mon, 22 Jul 2024 12:01:40 +0000 (12:01 +0000)]
Bug 37430: (Bug 33407 follow-up) ISBD punctuation removal in ES searches

Tiny adjustment for very special and malicious cases needed in
Koha::SearchEngine::Elasticsearch::QueryBuilder::clean_search_term.

Extended unit tests added following Nick's suggestions in
Bug 33407 discussion.

Test plan
=========
1. Use ktd with Elasticsearch and ktd's test data.
2. Edit the 4th record (The C programming language) and add a semicolon
   followed by a space before the slash in 245 $a to have:
   The C programming language ; /
3. Make a search for the first ISBD zone taken verbatim from the forth
   record:
   The C programming language ; / Brian W. Kernighan, Dennis M. Ritchie

   There should be no result.
4. Apply the patch, restart plack.
5. Repeat the search. You should get the record.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37446: DBRev 24.06.00.035
Martin Renvoize [Wed, 2 Oct 2024 09:40:06 +0000 (10:40 +0100)]
Bug 37446: DBRev 24.06.00.035

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37446: Fix search facets for holding and home libraries
Aleisha Amohia [Thu, 29 Aug 2024 04:52:28 +0000 (04:52 +0000)]
Bug 37446: Fix search facets for holding and home libraries

This bug ensures that the facet labels for holdingbranch and homebranch are updated, regardless of how the DisplayLibraryFacets system preference is set.

To test:

1. Check out an earlier version of Koha, for example `git checkout v23.11.08-1`
2. Spin up your development environment with elasticsearch, for example `ktd --es7 up`
3. Once it's ready, go to the staff interface and search for the DisplayLibraryFacets system preference in Koha administration. Set to 'holding library' if not already.
4. Do a catalogue search, notice the facets on the side. "Holding libraries" should show as normal. There should be no facet for home libraries.
5. In your terminal, check out 24.05.x, for example `git checkout v24.05.03`
6. Run database updates to upgrade Koha, for example `sudo koha-upgrade-schema kohadev`, and restart services `restart_all`
7. Repeat step 4. Notice the error in the facets "homelibrary"

8. Apply patch from Bug 37446
9. Repeat step 6
10. Repeat step 4. This time the facet should read "Home libraries"

Sponsored-by: Toi Ohomai Institute of Technology
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>
2 weeks agoBug 35087: (follow-up) Accept only values which will be saved correctly
Owen Leonard [Wed, 31 Jan 2024 16:47:34 +0000 (16:47 +0000)]
Bug 35087: (follow-up) Accept only values which will be saved correctly

This patch adds a regex (thanks to Katrin for the help) specific to the
range of values which will be accepted by the discount column in the
database which has the type "float(6,4)".

The patch also removes the format() filter from the template so that
values returned from the database won't be truncated:

Using "format ('%.1f')", a value in the db of '9.009' would appear in
the edit form as '9.0', a change which could be missed if the user was
editing some other field in the vendor edit form.

To test, apply the patch and clear your browser cache if necessary.

- Go to Acquisitions -> Vendors -> Edit vendor.
- Under "Ordering information," test entering various values in the
  "Discount" field. It should accept numbers with up to two digits
   before the decimal and up to three digits after the decimal:

   9, 99, -99, 99.9, 0.99, 99.99, 99.999

- In each of these cases, confirm that a value accepted by the
  client-side validation is also accepted when you submit the form and
  is correctly displayed when you edit that vendor again.

- It should not accept:

   100, 100.001, 100.00001

- The error message has been updated to read, "Please enter a decimal
  number in the format: 0.0"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Sonia <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 35087: Discount rate only accepts a point as decimal separator
Thibaud Guillot [Thu, 18 Jan 2024 08:28:29 +0000 (09:28 +0100)]
Bug 35087: Discount rate only accepts a point as decimal separator

When a comma is used to define the discount rate of a vendor,
the data is not recorded (as NULL), it is however recorded if the
separator is a point.

Test plan:

1) Go to acqui module and edit a vendor
2) Set a discount rate with a comma as decimal separator
3) Edit again or request your database to see that there is no data
   saved
4) Do it again with a point as decimal and see it works
5) Apply this patch and reloard the build for the templates
 6) Repeat step 2 and see the warning to inform you that you must use a
    point

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Sonia <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37848: Fix "Run with template" dropdown menu style
Owen Leonard [Fri, 6 Sep 2024 11:42:09 +0000 (11:42 +0000)]
Bug 37848: Fix "Run with template" dropdown menu style

This patch adds the missing "dropdown-item" class to the "Run with
template" dropdown menu markup in order to correct the menu's style.

The patch also adds a template ID to the menu items' id attributes so
that we don't have duplicate IDs.

To test, apply the patch and go to Tools -> Notices.

(testing steps copied from Bug 36157)

1. Create a notice with the module of "Reports" -- add something to the
   "Print" section. Example from the other bug:

    [% FOREACH b IN data %]
      <div class="panel panel-default">
         <div class="panel-heading">[% b.surname %], [% b.firstname %]</div>
         <div class="panel-body">Expiration: [% b.dateexpiry %]</div>
         <div class="panel-footer">ID: [% b.borrowernumber %]</div>
      </div>
    [% END %]

2. Create and run a saved report. Example from bug 36157:

    SELECT * FROM borrowers

3. Click on the "Run with template" dropdown and confirm that it is
   styled correctly.
4. Click to run the report with the template and confirm that it works
   correctly.

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: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 38000: Update imports
Pedro Amorim [Tue, 24 Sep 2024 14:25:11 +0000 (14:25 +0000)]
Bug 38000: Update imports

Noticed this while debugging a search related problem on a live server. This is cosmetic only.

Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37967: DBRev 24.06.00.034
Martin Renvoize [Wed, 2 Oct 2024 09:26:27 +0000 (10:26 +0100)]
Bug 37967: DBRev 24.06.00.034

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37967: (QA follow-up) Add bug number/description and perltidy atomicupdate
Lucas Gass [Tue, 24 Sep 2024 19:33:44 +0000 (19:33 +0000)]
Bug 37967: (QA follow-up) Add bug number/description and perltidy atomicupdate

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37967: Allow auto renewals notices to be sent via phone
Kyle M Hall [Thu, 19 Sep 2024 18:31:56 +0000 (14:31 -0400)]
Bug 37967: Allow auto renewals notices to be sent via phone

Auto renewals via phone are only disallowed because itiva did not support them.
There is no reason to disallow auto-reneals for the generic phone transport.
Twilio, for example, would have no problem sending those phone notices.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Note you can now select phone for auto-renewals!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37928: Add missing dropdown-item class to "Upload image"
Jonathan Druart [Mon, 16 Sep 2024 10:26:49 +0000 (12:26 +0200)]
Bug 37928: Add missing dropdown-item class to "Upload image"

"Upload image" item not correctly styled

Test plan:
Go to the bib detail page with at least one item.
Open the action dropdown list and notice the "Upload image" is correctly
styled with this patch

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37362: Do not show the lists button if there are no public lists and opacuserlogi...
Owen Leonard [Wed, 4 Sep 2024 13:32:27 +0000 (13:32 +0000)]
Bug 37362: Do not show the lists button if there are no public lists and opacuserlogin is off

This patch updates the OPAC header so that if opacuserlogin is off and
there are no public shelves, the Lists button does not appear. If
opacuserlogin is turned off the only kind of lists the user can interact
with are public ones, and without public lists there's nothing to do.

To test, apply the patch and test the arrangement of the OPAC header in
these cases:

- opacuserlogin is on, user is logged in, and there are no public lists:
  - The Lists button appears and contains only "Your lists" menu items.
- opacuserlogin is on, user is logged in, and there are public lists:
  - The Lists button appears and the menu contains controls for both
    public and private lists.
- opacuserlogin is off and there are public lists:
  - The Lists button appears and shows only controls for public lists.
- opacuserlogin is off and there are no public lists:
  - The Lists button does not appear.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37807: Disable "Export today's checked in barcodes" when needed
Jonathan Druart [Mon, 2 Sep 2024 12:38:59 +0000 (14:38 +0200)]
Bug 37807: Disable "Export today's checked in barcodes" when needed

If patron has privacy==2 ("Never: Delete my history immediately"), the "Export today's checked in barcodes" button is supposed to be disabled, with a tooltip with an explanation, but it is not.

Test plan:
Turn on OpacPrivacy and select "Never" in your privacy settings (OPAC)
Go to the circulation page for this patron (staff) and notice that the
export button (under "More") is disabled and has a tooltip when the
mouse hover it.

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>
2 weeks agoBug 37730: Batch patron modification header scroll
Chloe Zermatten [Mon, 30 Sep 2024 15:03:23 +0000 (15:03 +0000)]
Bug 37730: Batch patron modification header scroll

When scroling down <staff_url>/cgi-bin/koha/tools/modborrowers.pl,
there is a point where the table header leaves the normal flow of
the page to stick to the top of the screen instead. When this
occurs, the header becomes fixed: if scrolling through the table
horizontally, only the body will move. This is an issue as it means
that in this situation, some column headers cannot be viewed and the
data does not necessarily match the header under which it is found.

This patch resolves this issue by allowing the header to scroll
horizontally and ensuring that the width of the column headers
still match that of the columns themselves.

Test plan:

A) Reproduce the bug as per Pedro's intructions:

***
1) Visit "batch patron modification":
<staff_url>/cgi-bin/koha/tools/modborrowers.pl
2) Enter multiple cardnumbers, in k-t-d you may use these:
23529000104159
23529000120056
23529000714163
23529000651225
23529000445172
23529000105040
23529000224510
23529000591678
3) Press "Continue"
4) Scroll down the page enough that the table headers row becomes
   "detached"
   and sticks to the top of the page as you scroll down.
5) Scroll the table horizontally. Notice the headers are stuck even
   though
   the data columns have moved horizontally, causing the headers and
data to
   not match.
***

B) Apply the patch
C) Go through steps 1-5 again. This time, notice that the header scrolls
   along with the table body and that the column headers and data always
match.

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>
2 weeks agoBug 37810: (QA follow-up) Tidy
Nick Clemens [Tue, 1 Oct 2024 14:05:56 +0000 (14:05 +0000)]
Bug 37810: (QA follow-up) Tidy

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37810: Consider ServiceActive on status response
Pedro Amorim [Mon, 2 Sep 2024 14:51:31 +0000 (14:51 +0000)]
Bug 37810: Consider ServiceActive on status response

Some SUSHI providers return ServiceActive instead of the documented Service_Active:
https://countermetrics.stoplight.io/docs/counter-sushi-api/f0dd30f814944-server-status

This ensures the test connection does not fail regardless of what is used

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>
2 weeks agoBug 37810: Add test
Pedro Amorim [Thu, 19 Sep 2024 12:36:54 +0000 (12:36 +0000)]
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>
2 weeks agoBug 37891: (QA follow-up): Fix tt_valid QA test
Pedro Amorim [Mon, 30 Sep 2024 13:47:06 +0000 (13:47 +0000)]
Bug 37891: (QA follow-up): Fix tt_valid QA test

1) Apply both patches
2) $ qa -c 2 -v 2

Amended-by: Jonathan Druart
Add the different attribute at the end of the node so that we can easily
see what's different between the two lines

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 37891: Submit SMS related data even if SMSSendDriver is empty.
Pedro Amorim [Wed, 11 Sep 2024 10:40:17 +0000 (10:40 +0000)]
Bug 37891: Submit SMS related data even if SMSSendDriver is empty.

The bug is caused by the SMS data not being submitted as its fieldset is disabled if SMSSendDriver is empty.
This causes the SMS instance of the notice to not be updated when the edit happens, becoming out of sync.
Once it becomes out of sync with the other notices of same code but different transport_type, the 'GROUP BY branchcode,module,code,name,branchname' in letter.pl will fail, as the name no longer matches, listing the same notice twice on the notices table.

This patch updates the logic on the template to have the SMS input elements be disabled/readonly instead of having disabled='disabled' on the SMS fieldset.
This keeps the same functionality i.e. staff member is unable to edit SMS notice if SMSSendDriver is disabled, but ensures that SMS related data is submitted to the controller when the notice edit save happens.

Test plan:
1) Visit notices and slips:
  <staff_url>/cgi-bin/koha/tools/letter.pl
2) Search for a notice code e.g. 'ILL_REQUEST_UPDATE'.
3) Notice only one result is returned. Click 'Edit'.
4) Edit the 'Name'. Click 'Save'.
5) Repeat 2. Notice two results are now returned.
6) Apply patch. Repeat test plan. Notice only one result is returned at the end.

Signed-off-by: Jason Robb <jrobb@sekls.org>
Amended-by: Jonathan Druart
Align

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 38035: Exclude "sound" from the list of installed languages
Jonathan Druart [Mon, 30 Sep 2024 14:46:38 +0000 (16:46 +0200)]
Bug 38035: Exclude "sound" from the list of installed languages

Not sure how this is coming from, neither why we have not noticed that
before, but "sound" is listed under `koha-translate --list`

It's coming from `ls koha-tmpl/intranet-tmpl/prog`

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 36594: (RM follow-up) Add new filter to filters test
Martin Renvoize [Mon, 30 Sep 2024 17:21:13 +0000 (18:21 +0100)]
Bug 36594: (RM follow-up) Add new filter to filters test

This is the patch I meant to write before pushing but brain fade failed
me.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 35655: (follow-up) Fix perlcritic error
Tomas Cohen Arazi [Mon, 30 Sep 2024 16:52:21 +0000 (13:52 -0300)]
Bug 35655: (follow-up) Fix perlcritic error

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 weeks agoBug 35655: DBRev 24.06.00.033
Tomas Cohen Arazi [Mon, 30 Sep 2024 15:47:19 +0000 (12:47 -0300)]
Bug 35655: DBRev 24.06.00.033

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 weeks agoBug 37871: Remove extraneous 246 subfields from the title mappings (Elasticsearch...
Caroline Cyr La Rose [Fri, 13 Sep 2024 16:33:22 +0000 (12:33 -0400)]
Bug 37871: Remove extraneous 246 subfields from the title mappings (Elasticsearch, MARC21)

This patch limits indexing of field 246 to $a, $b, $n, and $p in
various title indexes.
Previously, all 246 subfields were indexed, including non-title
subfields such as $i (Display text), $g (Miscellaneous information),
and linking subfields, making the title index very large and giving
false results.

To test:

1. Add all the 246 subfields to the default bibliographic framework
   1.1. Go to Administration > MARC bibliographic framework
   1.2. Click Actions > MARC structure next to the Default framework
   1.3. Search for 246
   1.4. Click Actions > Edit subfields
   1.5. For each subfield, make sure Editor is checked
   1.6. Click Save changes

2. Create a new record and fill out all the 246 subfields
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Fill out all the subfields in 246 (I simply write the name of
        the subfield in the text field e.g. Display text in 246$i)
   2.5. Click Save
   2.6. Click Normal to access the detailed record

3. View the Elastic search record
   --> All the subfields (including "Display text", "Miscellaneous
       information" and other non-title subfields) should be indexed in
       - title
       - title__suggestion
       - title-abbreviated
       - title-abbreviated__sort
       - title expanded
       - title-expanded__sort
       - title-former
       - title-former__sort

4. Make a title or keyword search for "Display" (or whatever you wrote
   in 246$i)
   --> Your record should be in the results

5. Apply patch

6. Rebuild the index using -r

koha-elasticsearch --rebuild -d -r -v kohadev

7. Redo step 3
   --> Only 246 $a, $b, $n, and $p should be indexed

8. Redo step 4
   --> Your record should NOT be in the results

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 35655: Add unit tests
Kyle M Hall [Thu, 26 Sep 2024 19:16:44 +0000 (15:16 -0400)]
Bug 35655: Add unit tests

Add the ability to specify STOMP connection info via environment
variables and utilize those in unit tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 weeks agoBug 35655: Only use STOMP if JobsNotificationMethod set to do so
Tomas Cohen Arazi [Thu, 12 Sep 2024 14:14:22 +0000 (11:14 -0300)]
Bug 35655: Only use STOMP if JobsNotificationMethod set to do so

This patch makes the background jobs (jobs from now on) connect step not
try to connect to the STOMP broker, unless explicitly told to do so.

This is achieved by using a newly introduced system preference
`JobsNotificationMethod` which falls back to STOMP if undefined.

The "about" page now has 3 states for

+ Message broker:  Using SQL polling
+ Message broker:  Using SQL polling (Fallback, Error connecting to RabbitMQ)
+ Message broker:  Using RabbitMQ

The goal for this patch is to stop flooding the logs on very busy sites
when Rabbit is not being used. This shouldn't predate any efforts on
making the STOMP based jobs brokering mechanism solid and usable.

To test:
1. On clean `main`, run:
   $ ktd --shell
2. Open the logs on a separate terminal:
   $ ktd --shell
  k$ tail -f /var/log/koha/kohadev/*.log
3. Stage some MARC for import
=> SUCCESS: No warnings about STOMP
4. Import the staged records
=> SUCCESS: No warnings about STOMP
5. Stop rabbitmq:
  k$ sudo service rabbitmq-server stop
6. Repeat 2-4
=> FAIL: The logs say it couldn't connect to STOMP
7. Apply this patches and run:
  k$ restart_all
8a. See the "about" page, should read:
    Message broker: Using SQL polling (Fallback, Error connecting to RabbitMQ)
8b. Repeat 2-4
    should work with one warning in the
9. Start rabbit:
  k$ sudo service rabbitmq-server start
  k$ restart_all (not really necessary)
10a. See the "about" page, should read:
    Message broker:  Using RabbitMQ
10b. Repeat 2-4
=> SUCCESS: No warnings about STOMP
11. Change the `JobsNotificationMethod` system preference to *polling*
   and stop rabbit:
  k$ sudo service rabbitmq-server stop
  k$ restart_all
12a. See the "about" page, should read:
Message broker:  Using SQL polling
12b. Repeat 2-4
=> SUCCESS: No warnings about STOMP, not even on startup
13. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>