koha.git
4 weeks agoBug 36845: Do not loop over the content attribute
Jonathan Druart [Mon, 20 May 2024 11:34:24 +0000 (13:34 +0200)]
Bug 36845: Do not loop over the content attribute

We skip it.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 68e317bd0f8daf967a8af540056e8637524e5d3b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aed7e0849634a70880fa09029d018cd053cd9fac)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36845: Exclude meta tag from the translations
Jonathan Druart [Tue, 14 May 2024 07:29:02 +0000 (09:29 +0200)]
Bug 36845: Exclude meta tag from the translations

This bug originaly wants to get rid of "noindex" coming from this meta
tag:
  <meta name="robots" content="noindex">

But actually we have other strings from the meta tags that should not be
translated.

Test plan:
0. Do not apply this patch
1. cd misc/translator/po && gulp po:update --lang es-ES (or any other
   lang)
2. git commit -a -m"wip"
3. Apply this patch
4. Repeat 1 and git diff to show the diff
Notice that strings that should not be translated are removed from the
po files (actually commented)

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fbb123b12eab123e62c508944fd2b6261fb24acf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b3dfb82bd030aefb2299fd6e00d31588dbdcffb4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36892: Fix label for 'is_standing' input
Thibaud Guillot [Fri, 17 May 2024 09:13:21 +0000 (11:13 +0200)]
Bug 36892: Fix label for 'is_standing' input

Test plan:

1) Go to acqui/histsearch.pl and look for "search_children_too" with
   dev tools console.
2) On 'is_standing' input, the same label is used
3) Apply this patch and reload it
4) Now it's correct

Sponsored by: BibLibre

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 40900343673c280d092de9c57399a77c113b41ba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dacd7fabbe318ad3c340dd5cc1d35b2e67c040d8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36856: Fix MARC subfield name in new order from existing bibliographic record
Fridolin Somers [Tue, 14 May 2024 09:41:57 +0000 (11:41 +0200)]
Bug 36856: Fix MARC subfield name in new order from existing bibliographic record

In form of the bibliographic details when adding an order 'From an existing record' in a basket, the marc subfield name is not shown.
The template calls [% field.lib | html %] but this comes from Koha::UI::Form::Builder::Biblio generate_subfield_form() which gives 'marc_lib'.

Test plan:
1) Be sure to have an ACQ biblio framework
2) Enable system preference UseACQFrameworkForBiblioRecords
3) Go to an acquisition basket
4) Add a term in 'From an existing record' and submit
5) On first result click on 'Add order'
6) Look at 'Catalog details'
=> Without patch you only see subfield tag and letter : (123a)
=> With patch you also see subfield name : Name (123a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5080eecc2268c2b7b88856800e728041c2fc29ec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 33370ea55b34b234d8d0f05e84dd03dc5d4313aa)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36834: (Bug 29697 follow-up) Koha explodes when trying to open in Labeled MARC...
Janusz Kaczmarek [Sat, 11 May 2024 08:41:04 +0000 (08:41 +0000)]
Bug 36834: (Bug 29697 follow-up) Koha explodes when trying to open in Labeled MARC view a bibliographic record with an invalid biblionumber

After changes made in catalogue/labeledMARCdetail.pl with the bug 29697
when trying to open the Labeled MARC view with
biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes
with a message << Can't call method "metadata" on an undefined value at
/kohadevbox/koha/catalogue/labeledMARCdetail.pl line 59 >>

Test plan:
==========
1. Activate the viewLabeledMARC syspref.
2. Try to open a biblio record in Labeled MARC view, giving as a biblionumber
   (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd
   test data:
   http://your_ktd:8081/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=1234567
   Koha should explode with the message:
   Can't call method "metadata" on an undefined value at
   /kohadevbox/koha/catalogue/labeledMARCdetail.pl line 59
3. Apply the patch; restart_all.
4. Repeat p. 2.  You should get a regular page with the info "The record you
   requested does not exist (1234567)".

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e4e54af0e77a01d8ad1ee6ac84f5b255951f1831)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 944f3ffc8f0f59b2080d0670f4691a2343413e50)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36872: Untranslatable strings in request.tt
Owen Leonard [Thu, 16 May 2024 12:52:04 +0000 (12:52 +0000)]
Bug 36872: Untranslatable strings in request.tt

There are errors in the JavaScript in the holds template in the staff
client which results in strings not being translatable. This patch
corrects the errors.

To test, apply the patch and run through the process of placing a hold
on multiple items in the staff interface.

- At the hold confirmation step, try to submit the form without
  selecting pickup locations for one or more titles.
- You should get an alert, "Please make sure all selected titles have a
  pickup location set".
- Uncheck the checkboxes next to each title you're placing a hold on.
- Submit the form. You should get an error: "Please select at least one
  title".

- Test the translation process with a language, e.g. fr-FR:
- In KTD, run: gulp po:update --lang fr-FR
- Check fr-FR-staff-prog.po for the line referring to
  koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt:1499
- You should see the string "Please make sure all selected titles have a
  pickup location set".

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 537c960777f94cf964c757ed2773f330612ae3c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4a51f8ca4ae772d5b3f9f06605aa72980ef49a19)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36529: manage_additional_fields permission for more than acquisitions and serials
Caroline Cyr La Rose [Fri, 12 Apr 2024 09:53:25 +0000 (05:53 -0400)]
Bug 36529: manage_additional_fields permission for more than acquisitions and serials

This patch renames the manage_additional_fields permission to remove
the specificity of acquisitions orders and serial subscriptions.
Since each additional field requires a corresponding permission, I
wrote each of them next to it. It makes it very long, but right now
there isn't really a way to link permissions other than the permission
description.

To test:
1. Apply patch
2. Go to a patron account
3. Click More > Set permissions
4. Go to the Administration panel permissions and open the
   sub-permissions
5. Check that the manage_additional_fields permission description
   makes sense, check grammar and spelling, try the various
   combinations

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e251212ff5f783ff7d5d9de3821510ba7928d95f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fd982c027ddf247e441f2db278145b54f7dc537c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36793: Fix case of $var in Context->delete_preference
Marcel de Rooy [Mon, 6 May 2024 12:28:45 +0000 (12:28 +0000)]
Bug 36793: Fix case of $var in Context->delete_preference

This only applies to 'local' preferences.

Test plan (first without this patch):
Add a local pref. Delete it. Ask value on commandline with:
* perl -MC4::Context -e"print C4::Context->preference('YOUR_PREF')"
* Did you replace YOUR_PREF :)

Now repeat with this patch. And verify fix (no value now).

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>
(cherry picked from commit 8ea126b1f89e24a2baf8c43f7bf837bf74741088)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6122b60194af5b6939a6bbae6bc3c7973835b309)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36793: Unit test
Marcel de Rooy [Mon, 6 May 2024 12:28:45 +0000 (12:28 +0000)]
Bug 36793: Unit test

This only applies to 'local' preferences.

Test plan:
Run sysprefs.t with/without second patch.

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>
(cherry picked from commit b77cb006f1b1145b0251579e4122b7ad0c1bd0c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d39200e0d631cf5f008cbd8d185319d847a595f7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36619: Restore 'Columns' visibility on the patron search when placing a hold
Jonathan Druart [Wed, 17 Apr 2024 10:18:11 +0000 (12:18 +0200)]
Bug 36619: Restore 'Columns' visibility on the patron search when placing a hold

Test plan:
Go to /cgi-bin/koha/reserve/request.pl?biblionumber=117
Search for "d"
Notice that with this patch applied the "Columns" button is back and
that the "Configure" is working correctly

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 76ebbb4b9b3a39c6e7ffffe8ad1b9b2c603daf5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b485b949f4207ffa7b8651858ba4850557734042)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35961: (follow-up) Pass along the borrowernumber
Lucas Gass [Mon, 13 May 2024 22:15:02 +0000 (22:15 +0000)]
Bug 35961: (follow-up) Pass along the borrowernumber

To test:
1. APPLY PATCH
2. Turn on  OpacCatalogConcerns
3. Find a record and go to the OPAC detail page.
4. Click "Report a concern" in the right navigation menu
5. Make sure it works
6. Repeat the proces from MARC view and ISBD view pages

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>
(cherry picked from commit e412a4387c888816cf478d811a559c5f57f7e9e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dc8fb79cf4438f31cf72942caccf4a7d6c9bd665)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35961: Add missing includes
Martin Renvoize [Mon, 13 May 2024 13:43:53 +0000 (14:43 +0100)]
Bug 35961: Add missing includes

This patch adds the missing includes for the 'Catalog concerns' modal on
opac-MARCdetail and opac-ISBDdetail views.

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>
(cherry picked from commit c2154173af06efaf007e0cdf444f885275d61f1b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e90c544841efed6cf31ec8433f2e79161a07095f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36837: Simplify XSLT and aid translatability
Tomas Cohen Arazi [Mon, 13 May 2024 13:58:48 +0000 (10:58 -0300)]
Bug 36837: Simplify XSLT and aid translatability

This patch makes the XSLT contain HTML tags instead of building them
from scratch with static attribute values. This made it awkward for
translators as CSS classes ended up being extracted for translation
purposes. Plus, there's no need to spend CPU cycles on static content
generation.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 48e39c1e5cea2db2c4e0951a6efcae7e611490fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 22ff328708b377b4599bd072a9b444bae5953fa3)

4 weeks agoBug 33099: Add missing MARC21 Match authority mappings so "Search all headings" searc...
Janusz Kaczmarek [Tue, 18 Apr 2023 19:42:24 +0000 (21:42 +0200)]
Bug 33099: Add missing MARC21 Match authority mappings so "Search all headings" search works

The main entry form of corporate names (110), uniform titles (130), topical
terms (150), geographical names (151), and genre/form (155) are not indexed
with 'Match' search field in Elasticsearch standard mapping.  As a result,
the respective records are not present on the result list when performing
an 'All headings' search for the authority records with the main heading form
(MARC 21).

Test plan
=========
0. Have a test installation with Elasticsearch.
1. In Authorities, make an 'All headings' search for a main entry
   form from the corporate names, uniform titles, topical terms,
   geographical names, or genre/form
   --> e.g., in ktd: UK Archiving.  You will get no results.
2. Apply the patch, reindex with:
   sudo koha-elasticsearch --rebuild -r -a kohadev
3. Repeat the test. You should see 'UK Archiving' on the result list.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d4c70f7d07dcc0fe1319b6e0380abcd1b7400b95)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5e405a29a8b5af3daf8c51f814844086d828e63a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36378: Cannot stay logged in if AutoLocation is enabled but branch ip is not...
Kyle M Hall [Wed, 20 Mar 2024 19:32:50 +0000 (15:32 -0400)]
Bug 36378: Cannot stay logged in if AutoLocation is enabled but branch ip is not set correctly

We can get into a scenario what a user cannot stay logged in for more than a single page load.
If AutoLocation is enabled with branch IP addresses being set to a space, you will be logged out with every page load.

Test Plan:
1) Set your branch ip to a space
2) Enable AutoLocation
3) Restart all the things!
4) Log out
5) Log in
6) Browse to another page
7) You are logged out
8) Apply patch
9) Repeat 1-6
10) You are not logged out!

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7291a312332e4fac7ac61288f33a001d4a7b306c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d3dd7d20f1eae2bed24bb6833d08b4c80b4a250f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36723: Add musical presentation to Elasticsearch index mappings
danyonsewell [Fri, 10 May 2024 02:40:45 +0000 (02:40 +0000)]
Bug 36723: Add musical presentation to Elasticsearch index mappings

Testing plan:

1. Start up KTD with Elasticsearch: ktd --es8 up
2. Apply the patch and restart everything (restart_all).
3. Reset the mappings: Administration > Catalog > Search engine configuration (Elasticsearch) > Reset mappings (at the bottom of the page)
4. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev
5. Alternative to steps 3 and 4: reset_all
6. Update the visibility for 254$a in the default framework so that it is visible in the Editor (OPAC, Staff interface should already be selected).
7. Add a new record using the default framework and put a term in 254$a, such as 'Full score'.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fffb3665eadec04792b055e9ba04152b3b36d6dd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 58052b46f4365b0d5c6729b80a84b7f13ebe6b34)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 34823: Do not show Item group dropdown if there are no item groups
Lucas Gass [Wed, 6 Mar 2024 18:41:04 +0000 (18:41 +0000)]
Bug 34823: Do not show Item group dropdown if there are no item groups

To test:
1. Enable EnableItemGroups and EnableItemGroupHolds
2. Go to the OPAC and log in as a patron
3. Go to any record that doesn't have grouped items and try to place a hold
4. Click on "Show more options"
5. See "Request specific item group:" and dropdown
6. APPLY PATCH
7. Try again, this time if the record has no item groups you should not see the dropdown at all.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit be98d633be1fb34f52ccc8b57b18280856cf1d1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 58c25f1c78091c714e24710ca65b8989f02c80b4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36794: Illegitimate modification of biblionumber subfield content (999 $c)
Janusz Kaczmarek [Mon, 6 May 2024 13:24:10 +0000 (13:24 +0000)]
Bug 36794: Illegitimate modification of biblionumber subfield content (999 $c)

It happens that librarians, by mistake, open a biblio editor putting in the
URL, by hand, the biblionumber prefixed with a blank (e.g.
.../addbiblio.pl?biblionumber= 123 -- mind the space before 123).
In such a case the editor opens with the right biblio record (i.e. 123)
but, after saving the record, the content of the biblionumber MARC
field (999 $c for a standard MARC 21 installation) results modified and
contains additional initial blanks.

Moreover, while using ES and making a search for the record (with title,
author etc.) we get two records on the result list (instead of one).

This is because in the addbiblio.pl script $biblionumber is taken (and
continuously used) directly from CGI parameter, without any
validation and/or correction.

Test plan:
==========
0. Have a test installation with ES.
1. Open a biblio record in the editor with an added space before
   biblionumber value, e.g.:
   http://ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber= 123
   Save the record.
2. From the Normal view choose Save -> MARCXML.  Open the saved file in
   your favourite editor.  You should see, at the end, something like:
   <datafield tag="999" ind1=" " ind2=" ">
     <subfield code="c"> 123</subfield>
   (mind the space before 123).
   This is not right.
3. Make a search with the title or author's name from the record (e.g.
   Henning Mankell for the record 123 from the default ktd data set).
   You should get two records instead of one (while using ES).
4. Apply the patch, restart_all.  Repeat p. 1 and 2 with a different
   biblionumber.  Notice the unchanged (i.e. without spaces) value
   of 999 $c subfield in the exported record and only one record
   as a result of a search.

WNC amended patch - rebased, added conditional in case no bib, moved comments to their own lines

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: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c74169ba27c2e12473239b15358e428bc05da9f5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 076b82d52036a4779ff762319586dcba24e72cbf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36799: Illegitimate modification of MARC authid field content (001)
Janusz Kaczmarek [Tue, 7 May 2024 09:13:54 +0000 (09:13 +0000)]
Bug 36799: Illegitimate modification of MARC authid field content (001)

It happens that librarians to save time open an authority editor by putting
in the URL, by hand, the authid prefixed, by mistake, with a blank (e.g.
.../authorities.pl?authid= 100 -- mind the space before 100).  In
such a case the editor opens with the right auth record (i.e. 100) but,
after saving the record, the content of the authid MARC field (001 for
a standard MARC 21 installation) results modified and contains
additional initial blanks.

Moreover, if the heading (1XX field) was modified in the authority record
during such an edit, the changes will not propagate to the linked
bibliographic records.  And won't in the future.

This is because in the authorities.pl script $authid is taken (and
continuously used) directly from CGI parameter, without any
validation and/or correction (line 540 in the current main branch).

Test plan:
==========
1. Open an auth record in the editor with an added space before
   authid value, e.g.:
   http://ktd:8081/cgi-bin/koha/authorities/detail.pl?authid= 100
   Modify the heading field -- in the ktd data set:
       150 Computerized typesetting
   Save the record.
2. a) Open the record for editing again--see the space added before
   the authid in field 001.  Close the editor (with Cancel).
   b) Try to go to the linked biblio records with Used in X records.
   Note no results, if using ES.
   c) Remove the space before authid (after an:) in the URL.
   Go to the linked biblio records.  See that the content of
   the field controlled by the modified auth record did not
   update.
3. Apply the patch; restart_all.
4. Repeat p. 1 and 2 with a different authid.  Everything should
   be OK now.

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: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4b66fbc4ebc0fe706f9a9b9057a19ee0c1b13aa3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 65e1816bbaa83ff88800d9dd9a3eddb208eb31a7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 33849: Do not reset new patrons home library when error occurs
Emmi Takkinen [Thu, 4 Apr 2024 06:04:47 +0000 (09:04 +0300)]
Bug 33849: Do not reset new patrons home library when error occurs

While adding new patron, if patron is flagged as duplicate
or another error occurs and their home library differs from
library user is logged in, patrons home library resets as
logged in users library. This happens with all patrons
expect those with category type C. This patch removes checking
if patrons category type is C from code so that all category
types use previously chosen home library even if error occurs.

To test:
1. Add new patron and set their library to a different
library than the one you're logged in.
2. Cause an error (wrong age, duplicate etc) while saving.
3. Attempt to save.
=> Note that patrons home library is set as one you're
logged in.
4. Apply this patch.
5. Repeat steps 1 to 3.
=> Note that patrons home library hasn't changed.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d2f41df188c3d8e8d8705c6a5ceb583e3e29e629)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3c52b89167018f79456a3308cdd5f7266856ef5f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35927: Selecting MARC framework again doesn't work when adding to basket from...
Fridolin Somers [Mon, 29 Jan 2024 09:08:00 +0000 (10:08 +0100)]
Bug 35927: Selecting MARC framework again doesn't work when adding to basket from an external source

Like Bug 19372, selecting MARC framework currently doesn't work when adding to basket from an external source.
Strangly I can reproduce on koha-testing-docker, but we have this issue with a Ubuntu Focal install.
Looks like it comes from a bad syntaxe than needs to be replaced in any case.

Test plan:
1) Add an order to a basket from an external source
2) Select another framework than the default one on the search result
   view. Before doing 'add order' on choosen search result line.
3) Chek the framework code you will pick will be used in the created biblio record

Signed-off-by: David Nind <david@davidnind.com>
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>
(cherry picked from commit b7a5cc5beeb4af7cd23a414519c038f007f5b959)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 71b9421451dce017c12b82f34240431d4069a288)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36335: Fix ILS-DI GetRecords bad encoding for UNIMARC
Fridolin Somers [Fri, 15 Mar 2024 15:02:11 +0000 (16:02 +0100)]
Bug 36335: Fix ILS-DI GetRecords bad encoding for UNIMARC

ILS-DI GetRecords generates bad encoding of MARCXML for UNIMARC, like OAI in Bug 34467

Enable ILS-DI and display a record with :
<opac url>/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=<biblionumber>

Well-known issue, fixed
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5406aaedfa86aa97ed06019f4862bff285a4aad2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6568275bc9abec733ca6c914992b705da7bc3934)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 34041: (follow-up) escape double dashes to prevent issues
Tomas Cohen Arazi [Fri, 10 May 2024 12:30:53 +0000 (09:30 -0300)]
Bug 34041: (follow-up) escape double dashes to prevent issues

Having double dashes inside a commmented block is not valid XML. This
patch restores it, with an added message explaining it

To test:
1. Run:
   $ xmllint etc/z3950/config.xml
=> FAIL: You get:
etc/z3950/config.xml:5: parser error : Double hyphen within comment: <!--
  <config>
      <z3950_responder_options>
      <z3950_responder_options>--add-item-status k -t 5</z3950_responder_options
2. Apply this patch
3. Repeat 1
=> SUCCESS: All good!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 11c69496bcd216ad264acd87409e5160c73995bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit afb9cd8e1ccf941ae8cf6e1070dd41a285dcb86b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 34041: z3950 responder additional options not coming through properly
Liz Rea [Fri, 16 Jun 2023 17:50:35 +0000 (12:50 -0500)]
Bug 34041: z3950 responder additional options not coming through properly

This patch adds the <config> node that the z3950 responder starter script is looking for in the z3950/config.xml to the example code.

To test:
 - verify that the <config> </config> is around the commented z3950_additional_options suggestion in the etc/z3950/config.xml file
 - copy the config stanza to the live file: /etc/koha/sites/kohadev/z3950/config.xml
 - restart_all
 - ps aux | grep z3950
 - confirm the script has restarted
 - confirm the options: --add-item-status k -t 5 have been passed through

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3878dbe9994186d70b3eb94e5096d4d1c6cf5452)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7773b92a0c1cf86f1e17b2dc519db49abcf3b46f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36676: SIP2 drops connection on unknown patron id in fee paid message
Jan Kissig [Tue, 23 Apr 2024 18:19:05 +0000 (20:19 +0200)]
Bug 36676: SIP2 drops connection on unknown patron id in fee paid message

When sending a fee paid message to SIP2 with an unknown patron id it will respond with an empty response followed by dropping the connection to a client.

Test plan:
a) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1   -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01
Output:
Trying 'fee_paid'
SEND: 3720240423    124447FT00USDBV0.01|AO|AA2352900100046|ACterm1|
Use of uninitialized value $data in concatenation (.) or string at /usr/share/koha/bin/sip_cli_emulator.pl line 355, <GEN0> chunk 1.
READ:

b) apply patch
c) perl /usr/share/koha/bin/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1   -l CPL --patron 2352900100046 -m fee_paid --fee-type FT --fee-amount 0.01
Output:
Trying 'fee_paid'
SEND: 3720240423    125602FT00USDBV0.01|AO|AA2352900100046|ACterm1|
READ: 38N20240423    125602AO|AA2352900100046|AFInvalid patron barcode.|

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>
(cherry picked from commit d59e148879c0495f5071998d4521875e9c9022ed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d2ee1abc2cc219551b54e494bbdf75c2c4e3849f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36567: (Rmaint follow-up) fix failing test
Lucas Gass [Wed, 29 May 2024 13:09:33 +0000 (13:09 +0000)]
Bug 36567: (Rmaint follow-up) fix failing test

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 27363: Restore temporary selection of Z39.50 targets throughout multiple searches
Phil Ringnalda [Thu, 2 May 2024 23:19:17 +0000 (16:19 -0700)]
Bug 27363: Restore temporary selection of Z39.50 targets throughout multiple searches

The advanced editor currently saves which Z39.50 servers are selected
in local storage using the index in the sorted array of servers, and
then misreads them back as though they were server_ids. We want them to
be server_ids, since that's immutable and the index can change with
changes in rank or server name.

We use the data-server-id property in the HTML more often as a server_id
than as the index that's currently stored there, so this patches
switches it back to be the server_id, and in the one place we would use
the index, instead uses Array.find to just get the server object instead
of referencing it by index.

Test plan:
 1. Set the preference EnableAdvancedCatalogingEditor to enable
 2. Administration - Z39.50 Servers, for NATIONAL LIBRARY OF FRANCE
    uncheck "Preselected"
 3. To be sure you don't have confusing saved preferences, open
    Firefox's Developer Tools, in the Storage tab open Local Storage and
    select your URL
 4. In the row for cateditor_preferences_{your Koha user id}, if there
    are any values for selected_search_targets, delete them so you
    have "selected_search_targets":{}
 5. Open the advanced editor, and click "Advanced »" in the search box
 6. You should have Local catalog unchecked, LIBRARY OF CONGRESS checked
    because it is preselected, and NATIONAL LIBRARY OF FRANCE unchecked
 7. Toggle each checkbox so Local catalog and France are selected, and
    LoC is unselected.
 8. In a new broser tab, open the advanced editor, and click "Advanced »"
 9. You will see Local catalog unchecked, LoC checked, and France
    unchecked.
    That's the bug.
10. Apply patch, open the advanced editor in a new tab, click "Advanced »"
11. Toggle the checkboxes so Local catalog and France are selected, and
    LoC is not selected.
12. Open the advanced editor in another new tab, click "Advanced »"
13. You should see what you just set, Local catalog and France checked,
    and LoC unchecked, That's the correct behavior.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a8f4fe946cbafd46621a7a94812580ce0104fe7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 268e6bf0ff717e18ccb79b1d3a5fe2c38a300b88)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36804: Fix clear filter
Pedro Amorim [Tue, 7 May 2024 15:46:23 +0000 (15:46 +0000)]
Bug 36804: Fix clear filter

1) Visit serials and click "New subscription":
http://localhost:8081/cgi-bin/koha/serials/serials-home.pl
2) Enter '112' on the record input and '1' on the vendor input. Click "Next"
3) 'First issue publication date' -> Enter some date in the past
4) 'Frequency' -> Enter '2/day'
5) 'Subscription start date' Same as step 3)
6) 'Subscription end date' Some date in the future
7) 'Numbering pattern' -> Enter 'Number'
8) Click 'Test prediction pattern'. Click 'Save subscription'
9) On the left side menu -> Click "Serial collection". Click the yellow button 'Edit serials'
10) On the first serial, edit the status to 'Late'. Save.
11) Visit serials claims:
http://localhost:8081/cgi-bin/koha/serials/claims.pl?supplierid=1
12) Input some dates in "From" and "To"
13) Click 'Clear filter'. Notice it doesn't work.
14) Apply patch. Repeat.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e6b778b5d49cffcb33ccfa30542c4271d35e60e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f69ea4e87c0468016296ab6eed3e67fb26eb28e2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36774: Add cypress tests
Pedro Amorim [Wed, 8 May 2024 15:26:52 +0000 (15:26 +0000)]
Bug 36774: Add cypress tests

Inside k-t-d, run:
cypress run --spec t/cypress/integration/flatpickr_spec.ts

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 46c5a51d58565f2773a9438c195711c0156b866c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit df53cb4e24890baac30270c45d8b4ec7601127ac)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36774: Remove wrapper if already exists
Pedro Amorim [Fri, 3 May 2024 14:07:25 +0000 (14:07 +0000)]
Bug 36774: Remove wrapper if already exists

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c6e2995d278df289065a32f19af7ca9b9226d3ea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4eee85709c4f215c2bc72bc480291b2d1c08007b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 34360: Get distinct biblionumber
Nick Clemens [Thu, 11 Jan 2024 11:53:42 +0000 (11:53 +0000)]
Bug 34360: Get distinct biblionumber

This fixes the problem noted in the bug:
[WARN] DBIx::Class::ResultSetColumn::new(): Attempting to retrieve non-unique column 'biblionumber' on a resultset containing one-to-many joins will return duplicate results. at /usr/share/koha/Koha/Objects.pm line 421

We are taking a list of items, assuming the scenario is that these are from a single biblio and possibly some host_items, then searching and ordering conditionally on whether the biblio is a serial.

Current code gets the first biblio from the list - this patch adds a 'DISTINCT' to the results ebfore fetching the column

To test:
1 - Find a biblio in the staff interface
2 - Transfer one of the items a few times
3 - Recreate the issue on the command line:
    export DBIC_TRACE=1
    perl -e 'use Koha::Items; my $items = Koha::Items->search({biblionumber=>9})->search_ordered(undef,{ prefetch => ['issue','current_branchtransfers'] }); $items->next'
4 - Note warning:
    DBIx::Class::ResultSetColumn::new(): Attempting to retrieve non-unique column 'biblionumber' on a resultset containing one-to-many joins will return duplicate results. at /kohadevbox/koha/Koha/Objects.pm line 426
5 - Apply patch
6 - Repeat 3
7 - Error is gone

Signed-off-by: baptiste <baptiste.bayche@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b5388933b64b78ce22b058dd1e5b96e1c0ec78a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 465a41d7c1866fc7bfbb643419927aae747fe524)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36534: Batch operations when using limit in report
Katariina Pohto [Thu, 2 May 2024 11:27:06 +0000 (14:27 +0300)]
Bug 36534: Batch operations when using limit in report

When report results number exceeds the result per page limit, batch
operations link reads "Batch operations with (page limit) records" even
if there are more or less shown records (more when using limit in SQL or
less in the last page of result). This patch fixes the link text to
actual shown records.

To test:
1) Create a report of items with a limit of e.g., 26.
2) Run report.
3) See that number of results shown exceeds 20 but the link says "Batch
   operations with 20 visible records".
4) See that the second page shows 6 results but the link is still for 20
   records.
5) Apply patch.
6) Run report again.
7) See that the link texts will show correctly 26 records on the first
   page and 6 records on the second.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e9356afd9f7e8ee16165341b8009282ff9ab3ff3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e6beba64bc95219df8e07c1d9f635e6c41b576ff)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36787: staticfines.pl add use Koha::DateUtils::output_pref
Fridolin Somers [Mon, 6 May 2024 10:08:02 +0000 (12:08 +0200)]
Bug 36787: staticfines.pl add use Koha::DateUtils::output_pref

misc/cronjobs/staticfines.pl is calling output_pref() but it is missing from module import :
use Koha::DateUtils qw( dt_from_string );

Test but running staticfines.pl

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 18ac387e6a706019bc5a6c9fadf266eb2b4bf05d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 76d5c1373240764fc80777beb053465d9687cc04)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36730: (Bug 35428 follow-up) po files (sometimes) fail to update
Janusz Kaczmarek [Tue, 30 Apr 2024 10:18:12 +0000 (10:18 +0000)]
Bug 36730: (Bug 35428 follow-up) po files (sometimes) fail to update

Under some circumstances (e.g. non-standard disk latency) po files fail
to be generated.  The output from the gulp po:update --lang xx-XX task
is than like this:

[10:01:39] 'po_update_staff' errored after 6.41 s
[10:01:39] Error: ENOENT: no such file or directory, open '/tmp/koha-5WCc9s/Koha-staff-prog.pot'

This is due to the time dependencies inside the function flush (callback)
(in the function xgettext) in gulpfile.js.  It happens that the
/tmp/koha-NNNNNN folder gets deleted before the asynchronous callback
function called by fs.readFile is completed.  The callback should copy
the content of the .pot file from /tmp/koha- to its final destination,
while, in parallel in fact, the folder inside /tmp is being removed.
This creates a race condition.

Test plan:
==========
Hard to reproduce.  But the race condition found in the code should
be obvious.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 67b3cbd438f0cee378cfa5236f2673ab6ea32f33)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5291e6b6b5118e08c6bcd38e559029c8b800003e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36554: Document languages from field 041 should be present in 'ln' search field...
Janusz Kaczmarek [Tue, 14 Mar 2023 13:22:27 +0000 (14:22 +0100)]
Bug 36554: Document languages from field 041 should be present in 'ln' search field and Languages facet (MARC 21)

In Elasticsearch, the field 041 (subfields: a, d, e, i, j)
is not indexed with 'ln' search field.  As a result, records cannot
be found when searching with languages present in 041 (but only
with the one from 008/35-37), and the languages are also missing
from the facet.

Subfields content (only relevant subfields):
$a - Language code of text/sound track or separate title
$d - Language code of sung or spoken text
$e - Language code of librettos
$i - Language code of intertitles
$j - Language code of subtitles

Test plan
=========
0. Have a test installation with Elasticsearch.
1. In ktd with its test data, make a biblio search for a language present
   in 041 a/d/e/i/j but not in 008/35-37, e.g. for Japanese (with ln:jpn
   or from Advance search).  You will get no results.
2. Apply the patch, reindex with:
   sudo koha-elasticsearch --rebuild -r -b kohadev
3. Repeat the test. You should get some records and also you should see
   the Japanese language in the Languages facet.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d90c2a44e7506ec47a4f9481a1b8693b99244ecb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9b1f7dfa320fc1ba1e176cb18d75c6c51c20bf23)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36390: Two minor OPAC CSS fixes
Owen Leonard [Thu, 29 Feb 2024 16:36:34 +0000 (16:36 +0000)]
Bug 36390: Two minor OPAC CSS fixes

This patch makes corrections to OPAC CSS to address two small issues.

To test, apply the patch and rebuild the OPAC CSS.

- Perform a catalog search which will return multiple results..
- In the table of search results, check the icon and text for the
  controls under each title: "Place hold", "Add tag", "Add to cart" etc.
  - The colors should be consistent, with a slightly darker blue for the
    icons.
- Scroll down until the table header "sticks" to the top of the
  viewport.
- There should be no gap between the header row with the pagination
  links and the row with the "Select all", "Clear all", etc. controls.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 09119cf9c51e098db891002035213f250f635077)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eee4ebf0e78cc3dfe13c9f4e736f3107fb42bd02)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36393: Renewal with a specific date does not take the new date due that we pick
Hammat Wele [Thu, 21 Mar 2024 22:53:26 +0000 (22:53 +0000)]
Bug 36393: Renewal with a specific date does not take the new date due that we pick

When we renew a notice with a specific date and we have to override the limit, the new date due is not the date that we picked

To reproduce

1- Log in to the staff interface
     1-1. Make sure you have a ciculation rule that allows you to renew
     1-2. set the AllowRenewalLimitOverride system preference to Allow and SpecifyDueDate to Allow
2. Check out the item to a Borrower
5. Access the borrower's account and renew it until the limit is reached and note the due date.
6. Go to Circulation, click Renew
7. Enter the item barcode and choose a due date further than the due date from step 5 and submit
8. Click on Override limit and renew button
     ---> Note that the new date due is not the date that we picked in step 7
9. Apply the patch
10. Repeat step 6, 7 snd 8
     ---> Note that the new date due is the date that we picked

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c29e4ef1f1cda011867ba69207e4a0a0a74c829d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ebab11e2b0b05aa0a1e91c456d15f02c4483f414)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36137: Make update_totalissues cron always skip the holds queue
Lucas Gass [Wed, 10 Apr 2024 11:56:01 +0000 (11:56 +0000)]
Bug 36137: Make update_totalissues cron always skip the holds queue

To test:
1. Run the update_totalissues cron, the holds queue is updated.
2. APPLY PATCH, restart services
3. Run update_totalissues cron again, this time the holds queue should always be skipped.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 307acdf96b28c722a0027c1eeadb4c98ab38eeef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bc8788cf93c452d1b94715af4e84341c072fc704)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36574: Canceled/invalid ISBN not indexed by ES for MARC 21
Janusz Kaczmarek [Thu, 11 Apr 2024 09:21:42 +0000 (09:21 +0000)]
Bug 36574: Canceled/invalid ISBN not indexed by ES for MARC 21

For MARC 21, canceled/invalid ISBNs (subfield 020 $z) are not being
indexed in Elasticsearch (search fields identifier-standard and isbn),
but it is for UNIMARC (subfield 010 $z).  As a result, a user searching
for such an ISBN (e.g. with wrong checksum--and therefor put in 020 $z)
will not find the record in the catalogue.

A new isbn-all Elasticsearch search field 'isbn-all' has been created with
020az (MARC 21, and 010az for UNIMARC), 010z has been removed from isbn
search field for UNIMARC, and 020z has been added to identifier-standard
search field.

Test plan
=========
0. Have a test installation with Elasticsearch.
1. In ktd with its test data, make a biblio search for a cancelled ISBN
   e.g. 9780007269854.  You will get no results.
2. Apply the patch, reindex with:
   sudo koha-elasticsearch --rebuild -r -b kohadev
3. Repeat the test. You should get "The ice princess / Camilla Läckberg".

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 915d585b50868c878e492b2ce7d60f92fd3e8e87)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f382f4a271abffd012cc3df1dda947c99dd0a0b5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36567: Get rid of Datetime warning in Circulation.t and dateexpiry.t
Emmi Takkinen [Wed, 10 Apr 2024 11:50:04 +0000 (14:50 +0300)]
Bug 36567: Get rid of Datetime warning in Circulation.t and dateexpiry.t

Running either t/db_dependent/Circulation.t or t/db_dependent/Circulation/dateexpiry.t
cause following error to be dispalyed:

You are creating a DateTime object with a far future year (9999) and a time
zone (Europe/Helsinki). If the time zone you specified has future DST changes
this will be very slow.

Smallest allowed value is 4999, so we need to use that rather than 9999 in tests.

To test prove t/db_dependent/Circulation.t and t/db_dependent/Circulation/dateexpiry.t.

Sponsored-by: Koha-Suomi Oy
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>
(cherry picked from commit f5e9f9634fd0d3ea1d06ca24141cb10660a2cf66)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6302ec6200fb26f38edbc1a5e127431108dc54a9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36122: Update unit test
Matthias Le Gac [Fri, 5 Apr 2024 14:12:37 +0000 (10:12 -0400)]
Bug 36122: Update unit test

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 24abc7c9973ce4b2b91a4b53375ef233faf59304)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bdb4f0c1bbc4b76910f64a687a40dfef00584b99)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36122: Add unit test
Matthias Le Gac [Fri, 8 Mar 2024 21:44:51 +0000 (16:44 -0500)]
Bug 36122: Add unit test

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 69d87031514bb108fb33c4791d6f5a1ff0c0d544)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 47950495491658d6b4ae5cbe388787067fd1c32d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36122: NEW_SUGGESTION is sent for every modification to the suggestion
Matthias Le Gac [Thu, 7 Mar 2024 21:55:37 +0000 (16:55 -0500)]
Bug 36122: NEW_SUGGESTION is sent for every modification to the suggestion

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4ab5e6d29d6a67320a2931e4b9f667879aaadb3d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 866e1269b27f1e28e26f8be1eec0e18279f12e8f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36678: Index fields with non-filing characters in both versions
Nick Clemens [Tue, 23 Apr 2024 18:57:54 +0000 (18:57 +0000)]
Bug 36678: Index fields with non-filing characters in both versions

Currently we only remove non-filing characters for sort fields, however, this can make searching difficult.
This patch adds the filing form to the index as well to aid in searching.

To test:
 0 - Setup Koha with Elasticsearch
 1 - Import the sample record on this report: "L'amour de l'art"
 2 - Search for "amour de l'art" - no results
 3 - Apply patch
 4 - Reindex
 5 - Search for "amour de l'art" - result!
 6 - Search for "title:amour de l'art" - result!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c20263fd0930997a8da70b8798e0ada623ac2bc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 953ad1871cbafc79c25ef6423efef8392bccc21a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36678: Adjust unit tests
Nick Clemens [Tue, 23 Apr 2024 18:57:45 +0000 (18:57 +0000)]
Bug 36678: Adjust unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 93a647fa90b13bfc0bc13eb71c445b37498647e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d3b223c903d59055556fcf7a7bd104026096672d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 32565: (follow-up) Tidy
Nick Clemens [Fri, 19 Apr 2024 11:25:58 +0000 (11:25 +0000)]
Bug 32565: (follow-up) Tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4da2e1444be2f80f9a9a87a73af55bec1fe52f98)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fcc65787aaf100c0684a53226b30b1c70fda4a52)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 32565: (QA follow-up) Fix tests
Pedro Amorim [Mon, 19 Feb 2024 10:45:50 +0000 (10:45 +0000)]
Bug 32565: (QA follow-up) Fix tests

Apply original tests patch + this follow-up. Run:
prove t/db_dependent/HoldsQueue.t
Notice tests fail.
Apply fix patch, run the above prove command again.
Notice tests pass.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c3eac3c8898759291011e9d5a3f2d25cd1112c1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c23b90e11bf2d8ea563a5269c64b4b73be81e0c9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 32565: Unit tests
Nick Clemens [Thu, 25 Jan 2024 12:31:46 +0000 (12:31 +0000)]
Bug 32565: Unit tests

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 379481541f63cbdbadc3884052ef1d6b82be99e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c2a62e57c92a521c624ff25b92938e43169f9b23)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 32565: Add unallocated option to holds queue
Nick Clemens [Thu, 2 Mar 2023 17:01:07 +0000 (17:01 +0000)]
Bug 32565: Add unallocated option to holds queue

Add an unallocated option to CreateQueue and pass through as needed
Avoid deletion of the tmp_holdsqueue, and only check holds
and items that are not currently matched

A future hold with a higher priority will still fail here - because the
item may already be assigned, but on next change to the biblio it would
be corrected

To test:
1) Apply both patches
2) Enable RealTimeHoldsQueue and set HoldsQueueSkipClosed to "open"
3) Add a holiday to the calendar for all libraries for today, visit:
/cgi-bin/koha/tools/holidays.pl
-- Click today's day on the calendar and pick "Holiday repeated every same day of the week"
-- Click "Copy to all libraries". Hit "Save.
4) Place a biblio-level hold on a biblio record and set the pickup location to a library that has available copies, visit:
-- /cgi-bin/koha/reserve/request.pl?biblionumber=76&borrowernumber=51
-- Click the first "Place hold" button to place the biblio-level hold.
5) Verify that that hold got added to the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
6) Place a biblio-level hold on a biblio record where there are no other holds and copies are available at another location, but not the pickup location, visit:
-- /cgi-bin/koha/reserve/request.pl?biblionumber=437&borrowernumber=51
-- On the "pickup at" dropdown, pick something else other than "Centerville", e.g. "Fairfield".
-- Click the first "Place hold" button to place the biblio-level hold.
7) Check the holds queue again, notice that this 2nd hold was not added to the queue:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
8) Run the updated cronscript:
perl misc/cronjobs/holds/build_holds_queue.pl --force --unallocated
9) Notice nothing changed in the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
10) Remove the holiday we created previously, visit:
/cgi-bin/koha/tools/holidays.pl
-- Click today's day on the calendar and pick "Delete this holiday"
-- Click "Copy to all libraries". Hit "Save.
11) Run the updated cronscript:
perl misc/cronjobs/holds/build_holds_queue.pl --force --unallocated
12) Confirm the second hold is added to the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 939f1f389b848e06b7adcd7121ff7629a0ba4adf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 75a6e3c3c478633ced797da843a772c2ace86cad)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 31345: Add ability to exit process_message_queue.pl early if any plugin before_se...
Kyle M Hall [Thu, 11 Aug 2022 19:43:15 +0000 (15:43 -0400)]
Bug 31345: Add ability to exit process_message_queue.pl early if any plugin before_send_messages hook fails

Sometimes it would be better for process_message_queue.pl to stop if a plugin hook fails rather than continue processing. It would be nice if that was a command line option.

Test Plan:
1) Install any plugin with a before_send_messages hook
2) Modify the plugin, add a 'die;' statement at the start of the
   before_send_messages method of the plugin.
3) Run process_message_queue.pl as usual
4) Note the exit code is 0
5) Run it again with the new -e setting
6) Note the exit code is 1

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 83f9535fabc37be46ab8154d940a7ff614617eb2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ff2cce52c56e0cbfb7c8f760618b4b1e8db44d36)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35582: Supress possible warning
Kyle M Hall [Fri, 26 Apr 2024 18:41:42 +0000 (14:41 -0400)]
Bug 35582: Supress possible warning

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 615c7c5eafd207fdb1adc9a07a063ce83da668c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f63dbed44ace3c041f7bcec3cc84bc211a5a86f0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35582: Show advanced search languages with selected intranet language description...
lmstrand [Fri, 26 Jan 2024 08:36:00 +0000 (10:36 +0200)]
Bug 35582: Show advanced search languages with selected intranet language descriptions first

To test:

1. Check language dropdowns in advanced search, notice localized
   names of the languages are shown first in the menus, then the
selected ui language translations if available or the english translation
2. Apply patch
3. Check language dropdowns, notice the selected ui language's
   translations are shown first for the languages (if missing, english
translation), then the localized
language's name.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9c445218deb8daa8704ae48433783e723d8e8649)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2df2fbc309e06f6bb39e430349fb37a2efca3323)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 30598: remove all the console.log redundancies
Phan Tung Bui [Thu, 18 Apr 2024 13:49:59 +0000 (09:49 -0400)]
Bug 30598: remove all the console.log redundancies

Please test the patch. Thank you!

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e0d38c77e6c9fff2d7c39cf523c1517b322ca9c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9e49fab3ac86bada15ada49e551cf46288651fa7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 30598: Replacement cost is not copied from retail price when ordering from file
Phan Tung Bui [Fri, 12 Apr 2024 20:53:24 +0000 (16:53 -0400)]
Bug 30598: Replacement cost is not copied from retail price when ordering from file

Test plan :
To test :
1- In Acquisitions, create a basket
2- Add an order from a new (empty) record
 --> Note that when you enter the "vendor price", it is copied in the "replacement cost" field
3- Add an order from a new file
 --> Note that when you enter the "price", the "replacement price" field stays empty
4- Apply the batch
5- Redo step 3 and notice that when you change the 'price', the
'replacement price' syncs with it

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bed0563e568c4ee13a851d22025d66f36651beec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cf64df296cd1c97016ae245da847a3ce4ba4ba9d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36605: [23.05.x] Add update_lastseen to handle_patron_status for SIP
Nick Clemens [Tue, 30 Apr 2024 16:24:16 +0000 (16:24 +0000)]
Bug 36605: [23.05.x] Add update_lastseen to handle_patron_status for SIP

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35689: Add id and classes to each MARC note in OPAC bibliographic details
Owen Leonard [Wed, 3 Jan 2024 16:01:56 +0000 (16:01 +0000)]
Bug 35689: Add id and classes to each MARC note in OPAC bibliographic details

Building on Bug 14156, this patch updates the OPAC bibliographic
detail page's display of MARC notes to add the tag number in both a
class (for consistent styling across the same tag number) and id (for
unique styling for each repeated tag).

To test:

- As a quick test for custom CSS, go to Administration -> System
  preferences and locate the OPACUserCSS preference.
  - Add this testing CSS:

   .marcnote { font-size:140%; font-family: serif; }
   .marcnote-500 { background-color: #66FFCC; }
   .marcnote-511 { background-color: #99FFFF; }
   .marcnote-520 { background-color: #CCFF00; }
   .marcnote-521 { background-color: #CCFFFF; }
   .marcnote-538 { background-color: #FFCCCC; }
   .marcnote-546 { background-color: #FFFFCC; }

- Locate a record with multiple notes fields. In the sample data, record
  46, "Viridiana" is a good example which works well with the above CSS.
- On the bibliographic detail page for the record, click the
  "Descriptions" tab.
  - Each MARC note should be colored according to the tag it comes from.
  - Inspect the HTML to confirm that each paragraph also has its own
    unique ID.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dfd4894acbab3af5355b72c859a0a17deef70af5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0a5dbec79759cba07da5f062f2ac2e242228d1cf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36295: Space out content blocks in batch record modification
Brendan Lawlor [Fri, 12 Apr 2024 16:40:41 +0000 (16:40 +0000)]
Bug 36295: Space out content blocks in batch record modification

This patch adds a float clearing class to a line break in the batch record modification template to fix a spacing issue in Chrome.

To test apply the patch and go to Cataloging -> Batch record modification

There should be space between the two sections.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 566894f058759c05922ec3399ba4ca96d27978f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 813d06de274ed243ba38220e2b9e9f03372baddf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36295: Space out content blocks in batch record deletion
Owen Leonard [Tue, 9 Apr 2024 12:02:40 +0000 (12:02 +0000)]
Bug 36295: Space out content blocks in batch record deletion

This patch adds a float-clearing line break to the batch record deletion
template so that the "Record type" section has visual separation from
the record number submission tabs.

To test, apply the patch and go to Cataloging -> Batch record deletion.

There should be padding between the two sections.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 55fbfffa0efe2efc09baa3a5e4d01595152165e7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8b11a0f8eacc3deff912a0ec6fd4c70e4e59d59e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35977: (follow-up) Cleaner working approach
Martin Renvoize [Tue, 30 Apr 2024 15:13:25 +0000 (16:13 +0100)]
Bug 35977: (follow-up) Cleaner working approach

This patch removes the Date_from_syspref recently added and replaces it
with the correct parseDate call as per bug 35559. We also clean up the
code around setting the input value in the first place and use iso which
is what the rest of flatpickr expects and now is handled correctly in
futuredate pickers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1ff3d65c7073e5d93502d329b917d886a3665e0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3880307a9f47433fed1e91dbeaf3fb743c0cd355)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35977: Nuke value if setting required
Martin Renvoize [Thu, 25 Apr 2024 12:39:40 +0000 (13:39 +0100)]
Bug 35977: Nuke value if setting required

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 47400c327394a449b6bcb0998eba0e7840a9e6d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 87d6a13172a32c5051844cf4597b47ae490e26dd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35977: Set holddatefrom default to today
Martin Renvoize [Wed, 7 Feb 2024 15:21:04 +0000 (15:21 +0000)]
Bug 35977: Set holddatefrom default to today

This patch sets the holddatefrom date to today by default on the opac.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c341b2d37584aca52fcac7243f7ab68f324d002c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 648feb2594ea9454ec7de4996cd6f39deb8450e7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 16567: Correct RSS feed validity errors
Owen Leonard [Mon, 15 Apr 2024 14:21:03 +0000 (14:21 +0000)]
Bug 16567: Correct RSS feed validity errors

This patch corrects a few markup errors in the XML feeds to make the
feeds validate correctly. The template has been largely re-indented to
improve readability and eliminate tab characters.

To test, apply the patch and perform a search in the OPAC.

- Open the RSS link appearing after the "Your search returned..."
  header.
- Depending on how your browser handles XML documents you may need to
  view source on the page to see the actual XML markup.
- Copy the source and paste it into the W3C feed validator:
  https://validator.w3.org/feed/#validate_by_input
- The feed should be found to be valid.
  - In my tests you'll get a "Recommendation" about "Self reference
    doesn't match document location." I think this recommendation
    doesn't apply.

Perform the same test with the other two available formats: Atom and
OpenSearch:

- Change the end of the RSS feed url from '&format=rss' to
  '&format=atom' and validate the result.
   - The same "self reference" recommendation will come up, and again I
     think we can ignore it.
   - There is another recommendation about "Two entries with the same
     value for atom:updated." The updated time is set to the same time
     as the feed itself (the time when the feed was generated. Maybe
     this is incorrect. If so we need a follow-up that exposes a
     different value to the template. biblio.datecreated maybe?
- Change the end of the feed url from '&format=atom' to
  '&format=OpenSearchDescription' and validate that result.

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>
(cherry picked from commit ee960bd45f7535aec058d3984891e21b255ace12)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1557d835a886229209fa887ca315b3766b2037df)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35979: (follow-up) Add check in ->enqueue
Marcel de Rooy [Tue, 23 Apr 2024 12:47:11 +0000 (12:47 +0000)]
Bug 35979: (follow-up) Add check in ->enqueue

Foundation for removing same check elsewhere (later on).

Test plan:
Run t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
PA amended: Fix bug # in commit message

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c317bb34c0bb59fd0f52b4e7c5c0d3326b0030ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f09739fcec4dbefd487c12d169db6c76ccb903ce)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35979: Check pref before inserting holds_queue background jobs
Marcel de Rooy [Tue, 23 Apr 2024 11:42:50 +0000 (13:42 +0200)]
Bug 35979: Check pref before inserting holds_queue background jobs

Test plan:
Confirm that modrequest does no longer insert when pref is off :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 310ba95efa7e83559134c7660f7739a6d1314524)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 042df55f46f6067280560d8ea3bbdddeb26ec501)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 32695: Fix search strings for 775, 780, 785 and 787
Nick Clemens [Fri, 26 May 2023 19:00:13 +0000 (19:00 +0000)]
Bug 32695: Fix search strings for 775, 780, 785 and 787

In the past due to some misunderstanding of the MARC standard
we built the search links for these fields using $a and $t with
the title index. But we actually need to search $t as title
and $a as author.
This patch fixes the templates for the MARC 7xx fields:
* 775
* 780
* 785
* 787

To test:
* Ensure systme preference 'UseControlNumber' is set to don't
* Create a record with the linking fields above
* Look at the OPAC and staff interface detail views
* Verify the content of your fields shows and the links combine a+t as a title search
* Apply patch
* Verify you have nicely formatted links now

Example:
775 _ _ ‡asomeone‡ttitle775
780 0 2 ‡asomeone‡ttitle780
785 0 2 ‡asomeone‡ttitle785
787 _ _ ‡ilabel:‡ttitle787‡asomeone

Signed-off-by: Sabrina Kiehl <kiehl@mpis.mpg.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b2b3d88b7335c542035fbdf11637fa2a31ea22bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 69d8b560d9753a5d1192afc267b19602465190f6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 30318: Don't reset messaging preferences when form is empty
Nick Clemens [Fri, 19 Apr 2024 12:29:31 +0000 (12:29 +0000)]
Bug 30318: Don't reset messaging preferences when form is empty

In testing, the messaging preferences are set in the form when EnhancedMessagingPreferences is enabled.
Switching categories silently updates the preferences unless you have made changes, in which case the
user is warned and can confirm if they want to reset or not. The code only applies to patron creatoin, and
does not seem to be taken into account during OPAC self-registration.

It seems the silent defaulting when saving can be removed in favor of the current updates/warns in the actual
form.

To test:
 1 - Set some messaging preferences for at least two categories
 2 - Enter a new patron
 3 - Confirm switching categories correctly defaults the messaging preferences
 4 - Edit the preferences and switch to another category with defaults
 5 - Confirm the warning appears, and preferences are set if confirmed and ignored if not
 6 - Set to a category with defaults, uncheck all, and save
 7 - Ooof, patron is defaulted
 8 - Apply patch
 9 - Repeat 1-5 and confirm nothing has changed
10 - Set to a category with defaults, uncheck all, save
11 - Confirm patron is saved with no preferences

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 70fde44d4f6eef25e177012318e7acaa0ce740c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 86cc4b4d245f704a306ee10cc0ebde89cc40273a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36282: Chomp whitespace around opac i18n strings
Pedro Amorim [Fri, 8 Mar 2024 11:49:26 +0000 (11:49 +0000)]
Bug 36282: Chomp whitespace around opac i18n strings

Same logic as bug 26816 but to OPAC

Test plan:
1) Apply test plan patch only
2) Visit opac home:
<opac_url>/cgi-bin/koha/opac-main.pl
3) Notice there's a space between 'Translated string' and ':', even though the markup does not contain a whitespace
4) Apply 2nd patch
5) Notice the white space is gone

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b9f97ec015e4f101546e308754db4ed532987fde)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5559ebc3bf8a6d3a3462e1367ce3901084cc7501)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 34963: Restore the ability to blank fields when editing a suggestion
Jonathan Druart [Wed, 17 Apr 2024 09:48:16 +0000 (11:48 +0200)]
Bug 34963: Restore the ability to blank fields when editing a suggestion

Regression introduced by bug 23991.
We don't want to remove the fields from the edition if they are empty.

Ideally we should have separate parameters for edition and search, but
this is the low-effort fix, and hopefully won't introduce side-effects.

Test plan:
Try to edit a suggestion and blank some fields
Try to search for suggestions using the search form on the left of the
screen

Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cd1f4145fe091314895a4f8a4f73a5b3a5f8bb87)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e6a2b1afde992359d0a0ad860701838438a9ebaf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36386: Pass user and group to Net::Server
Marcel de Rooy [Thu, 21 Mar 2024 14:17:35 +0000 (14:17 +0000)]
Bug 36386: Pass user and group to Net::Server

This prevents the User/Group Not Defined warns in syslog.

Test plan:
Restart sip and check your syslog.

KTD Test Plan:
1) Stop your SIP server
2) Run "perl C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/koha-conf.xml"
   We need valid XML without any valid SIP settings to the output goes
   to the command line
3) Note the warnings
4) Apply this patch
5) Repeat step 2
6) No warnings!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2973a4e81a2878b8d2654477b2556ad1b1fb4e46)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 89ce196ea77e0e46d6d66b1710325673b753bbd3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36420: Allow Basic authentication using `cardnumber`
Tomas Cohen Arazi [Wed, 27 Mar 2024 12:01:32 +0000 (12:01 +0000)]
Bug 36420: Allow Basic authentication using `cardnumber`

This patch makes the API Basic authentication work with cardnumbers.
The used `checkpw_internal` method already does the fallback check.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/auth_basic.t
=> FAIL: Tests explode! [1]
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

[1] This highlights an underlying bug! Instead of getting 403, etc we get a 500. This is because of the internal fallback mechanism allowing the cardnumber+password combination, but then the Koha::Patron->find... not finding :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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>
(cherry picked from commit 154a2ea9ad5b6e911a504b8798f5ffe6df1c2297)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dd58ce2a036e9b762f3e5418b7b670532de5dd05)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36420: Unit tests
Tomas Cohen Arazi [Wed, 27 Mar 2024 12:00:48 +0000 (12:00 +0000)]
Bug 36420: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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>
(cherry picked from commit 5c3ad38157f483aeb4ff26048a838b3ba6ad34fc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fa768d5ed4a1b273d049679017c2ef0c4c7bdc20)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 30987: Fix relationship fields for patron full and quick add forms
Lucas Gass [Mon, 26 Feb 2024 15:59:29 +0000 (15:59 +0000)]
Bug 30987: Fix relationship fields for patron full and quick add forms

To test:
1. APPLY PATACH and restart services.
2. Find the borrowerRelationship system preference. The description should no longer include the words "Leave empty to deactivate."
3. Populate the system preference with at least 1 choice.
4. Find a patron category with can_be_guarantee set to 'Yes'.
5. Quick add a patron of that type, making sure the relationship field shows in the Patron guarantor section. ( You have to +Add gaurantor before this field will show )
6. The values in the dropdown should refelct the borrowerRelationship values.
7. With BorrowerMandatoryField make relationship mandatory.
8. Try step 5 again, this time the Relationship field should be mandatory.
9. Remove the field from  BorrowerMandatoryField and add it to BorrowerUnwantedField.
10. Do step 5 again, the relationship field should not show on the quick add form.

Signed-off-by: Myka Kennedy Stephens <mkstephens@fosgail.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fccbd327d9f93925917e7a4f478ab72c1d1f2363)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7083a9dfbeff7a69a681e275a83c97239654b764)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 33205: (bug 28268 follow-up) Method call $row->authid inside quotes - produces...
Janusz Kaczmarek [Sat, 11 Mar 2023 10:45:32 +0000 (11:45 +0100)]
Bug 33205: (bug 28268 follow-up) Method call $row->authid inside quotes - produces meaningless warning

Bug 28268, in
Koha::MetadataRecord::Authority::get_all_authorities_iterator,
introduced a warning:

warn "Something went wrong reading record for authority $row->authid: $@\n";

But a method cannot be called from within quotes in Perl - extrapolation
does not work for functions/methods.  So, if something really goes
wrong, this line of code produces a warning like:

Something went wrong reading record for authority
Koha::Schema::Result::AuthHeader=HASH(0x55cf7e0d0958)->authid: Empty
String at /usr/share/perl5/MARC/File/XML.pm line 450.

which is not very informative -- authid is missing.

Test plan
=========
Hard to reproduce.  This problem occurs only in rare cases of some weird problem
in stores authority data or if a auth record had been deleted after a ES reindex
action has been initiated.  But the problem in the code and the fix seem obvious.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9c2510ea2ef1db46bf42cf948b6c599250d6dd9e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fb3473dfe3abe71b9545f19035d47e84f59c69d6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36552: (QA follow-up) Add a theoretical check on $record
Marcel de Rooy [Fri, 12 Apr 2024 08:10:18 +0000 (08:10 +0000)]
Bug 36552: (QA follow-up) Add a theoretical check on $record

Theoretically, it might be empty? Note the check too in the
other script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit cc834ba187b7d4a4b817d73f5c4be0eb0ebdaaf4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7c4ea8ee7f6e214c7c22da4ab1a1c84e6b73e4ba)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36552: (QA follow-up) Add POSIX module
Marcel de Rooy [Fri, 12 Apr 2024 08:07:40 +0000 (08:07 +0000)]
Bug 36552: (QA follow-up) Add POSIX module

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 34746f5706fb49377e5d610a9fe6e2c4792b9b26)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6b490b2e947dfc5894e51329e0c114a06e665ae6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36552: Update record 'date entered on file' when duplicating a record
Janusz Kaczmarek [Wed, 26 Apr 2023 23:04:48 +0000 (01:04 +0200)]
Bug 36552: Update record 'date entered on file' when duplicating a record

The 'date entered on file' (MARC21: 008/0-5, UNIMARC: 100a/0=7) of a record created
by duplication of an existing record should be set to the current date instead of
having the value of the original record.

Test plan
=========
1. Check the 'date entered on file' of an existing biblio / authotiry record
   (MARC21: 008/0-5, UNIMARC: 100a/0=7).
2. Duplicate the record by Edit > Edit as new (duplicate)
3. Control the 'date entered on file' value - it will equal to that of the
   original record.
4. Apply the patch (restart plack).
5. Repeat step 2.
6. Check the date - it should be the current date.

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>
(cherry picked from commit dd8f9e1266f2b93b0d57f1f1289d49f61129391e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0cd9d2f1842a93beb4dfb5cba26c64602bdf2d68)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 34621: Tidy import_patrons.pl
Kyle M Hall [Mon, 18 Mar 2024 11:04:23 +0000 (07:04 -0400)]
Bug 34621: Tidy import_patrons.pl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c6641ef24f389e65a0dd90d3fd788f110f21158a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aabe54000ae8292fa4cc7003491bb9c3a041a704)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 34621: Tidy Import.t
Kyle M Hall [Mon, 18 Mar 2024 11:00:37 +0000 (07:00 -0400)]
Bug 34621: Tidy Import.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6a4c2dd03a99741129bd94e261d7681bd3e634de)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f065c42a7ad67a79e2a13ccca363ad0a19152d05)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 34621: implement Patron import option to 'Renew existing patrons' 'from the curre...
Kyle M Hall [Fri, 25 Aug 2023 17:37:46 +0000 (17:37 +0000)]
Bug 34621: implement Patron import option to 'Renew existing patrons' 'from the current membership expiry date'

Test Plan:
1) Test importing a patron with the "from the current membership expiry date" option,
   note it does not work
2) Apply this patch
3) Restart all the things!
4) Re-test, note the expiration was renewed from the patron's current
   expiration date!

Signed-off-by: David Nind <david@davidnind.com>
Rebased-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>
(cherry picked from commit b89d744e868cd93632d6b84f5f39116a475d342e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3a99bc8bb1cc95c7d1abcff3ffa7bccd72f68b1d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36473: (follow-up) Additionally warn the stringified exception
Nick Clemens [Thu, 18 Apr 2024 11:17:33 +0000 (11:17 +0000)]
Bug 36473: (follow-up) Additionally warn the stringified exception

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 903a8685c661ddde61335a08e126506120345abc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bc7842c649088ed94aeea13d59b683b25c720de9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36473: (follow-up) Add biblionumber to warning
Nick Clemens [Thu, 18 Apr 2024 10:35:52 +0000 (10:35 +0000)]
Bug 36473: (follow-up) Add biblionumber to warning

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1b99de33f9e553f80507ef7da5e711b98e979e39)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bab05efd815d48ef0266454ec283bf7a8e19db45)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36473: (follow-up) Correct biblio to bibliographic
Nick Clemens [Thu, 18 Apr 2024 10:33:40 +0000 (10:33 +0000)]
Bug 36473: (follow-up) Correct biblio to bibliographic

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0191500149433313aa73a6c43255a19d659acad0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 75372edaa0dfc5acae5432d5af7a14ea7e8b4966)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36473: Handle Invalid Metadata Exceptions in totalissues.pl
Nick Clemens [Mon, 1 Apr 2024 14:32:08 +0000 (14:32 +0000)]
Bug 36473: Handle Invalid Metadata Exceptions in totalissues.pl

This patch wraps the call for record in an eval, and catches any invalid metadata
exceptions, letting the warning show, but allowing the script to continue
To test:
1 - In default KTD record 369 has problems, otherwise you need to break a record
2 - Run : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v
3 - It dies at record 369 (or the one you broke)
4 - Apply patch
5 - Run again
6 - It succeeds, but skips the bad record

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f3d2f34d7a6aeead30b40a30b239f15c6c94a7f2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d397da65c02ee40243aacdc3382e68b84e040921)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36473: Unit tests
Laura Escamilla [Tue, 2 Apr 2024 13:43:00 +0000 (13:43 +0000)]
Bug 36473: Unit tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Tidied.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9e9cc822cbd7836827a9596f71c50d5ad37f6802)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d80334a1087bc4e0dc50174a3d3d30217dfe8831)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 23102: No mock in selenium
Nick Clemens [Fri, 12 Apr 2024 09:46:20 +0000 (09:46 +0000)]
Bug 23102: No mock in selenium

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9aa811c33481dddded624829dfd24643f31fc04d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 86e78b5511686b33068f92317f3a9e3b690594da)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 23102: 404 errors on page causes SCI user to be logged out
Nick Clemens [Wed, 12 Jun 2019 11:43:48 +0000 (11:43 +0000)]
Bug 23102: 404 errors on page causes SCI user to be logged out

To test:
 1 - Have something on the SCO page that won't load
     Add to SCOUserJS:
        </script>
        <img src="http://localhost:8080/silk/famfamfam.png"/>
        <script>
 2 - Enable the SCO and SCI system preferences:
     WebBasedSelfCheck: Enable
     SelfCheckInModuke: Enable
     AutoSelfCheckAllowed: Allow
     AutoSelfCheckID / AutoSelfCheckPass to a valid user with permissions
 3 - Add the self_checkin_module and self_checkout_module permissions to the AutoSelfCheck user
 4 - Access the selfcheckout module https://yoursite.org/cgi-bin/koha/sco/sco-main.pl
 5 - Sign in using a patron
 6 - Enter an unkown barcode, I used "DONTMATTER"
 7 - If not logged out, click to 'Return to account summary'
 8 - You are asked to sign in again
 9 - Repeat with the SCI module
10 - Apply patch
11 - Repeat, but this time you can return to account

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5bab87f76b05bbf8627cf6786975e9e30a5f2f6c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 240f526d06a2070a492799bb9045d4965fcced4b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 23102: Selenium test
Nick Clemens [Fri, 14 Feb 2020 15:15:10 +0000 (15:15 +0000)]
Bug 23102: Selenium test

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fee56e8d85e4cd897293d9d8b0b48b66071fbde0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d21a2da67cac9e8be1ff39109692fd79b168795)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35969: (follow-up) Improve wording
Marcel de Rooy [Wed, 7 Feb 2024 13:53:20 +0000 (13:53 +0000)]
Bug 35969: (follow-up) Improve wording

As suggested by David Nind. Thanks!

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b4ce5051c1ac080ac68d44b464141507e5eca602)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c46d122fc10026cdcd61049cae036e08acfea886)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 35969: Add error code in opac-sendbasket.pl
Marcel de Rooy [Thu, 1 Feb 2024 07:55:55 +0000 (07:55 +0000)]
Bug 35969: Add error code in opac-sendbasket.pl

No need to carp about empty basket or no reply address.
Just add a simple explanation on the form.

Note that it makes no sense to show the form if the patron
has no email address. We need it as reply-to.

Test plan:
Try opac-sendbasket.pl?bib_list=null
Remove email address from your account, try again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 35293612a8d0efa932bf376b7855b17cc29d6d5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3266b9d5bc80d4aabf47488fff4221d9af516a5e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36517: Fix output from install_plugins.pl
Magnus Enger [Fri, 5 Apr 2024 13:41:08 +0000 (13:41 +0000)]
Bug 36517: Fix output from install_plugins.pl

When misc/devel/install_plugins.pl does not find any plugins, it prints
the list of pluginsdir, but with a literal \n separating the dirs, and
no newline at the end.

To test:
- Edit koha-conf.xml and add a second entry for <pluginsdir>, so there
  are two entries. The second one could just be a copy of the original.
- Run "perl misc/devel/install_plugins.pl"
- Note the output looks something like this:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins\n/var/lib/koha/kohadev/pluginsroot@kohadevbox:koha(master)$

- Apply the patch and run the script again. Output should be:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins
/var/lib/koha/kohadev/plugins
root@kohadevbox:koha(master)$

- Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4848def5e2a336e01bf0dd0ff61a75a30b35f137)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f2a05fadd06f40ad385ed8f7792ac7b68c16e7d7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36493: Make cashups test more robust
Tomas Cohen Arazi [Tue, 2 Apr 2024 15:39:02 +0000 (12:39 -0300)]
Bug 36493: Make cashups test more robust

This patch makes the test independent from existing cash registers in
the system.

To test:
1. Enable UseCashRegisters on a fresh KTD
2. Add a cash register
3. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/cashups.t
=> FAIL: Tests fail!
4. Apply this patch
5. Repeat 3
=> SUCCESS: Tests pass!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4436a7d41a74bf002fdd80ec97f0be38d40eee22)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 19b543a51b59c7a13e5a901c2c31413eee2f2692)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36438: Check object for calling metadata
Marcel de Rooy [Wed, 27 Mar 2024 12:19:34 +0000 (12:19 +0000)]
Bug 36438: Check object for calling metadata

Resolve: Can't call method "metadata" on an undefined value at catalogue/MARCdetail.pl line 93

The proceeding lines check for $record and respond appropriately.

Test plan:
Call catalogue/MARCdetail.pl with an unexisting biblionumber.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a37ebc77b7f3513b2775ebb8819a710e5a2eb416)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d45bf88a97ad22f529203c5dbd426ab13d812d4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36531: Serve text/javascript compressed, like application/javascript is
Phil Ringnalda [Fri, 5 Apr 2024 01:59:34 +0000 (18:59 -0700)]
Bug 36531: Serve text/javascript compressed, like application/javascript is

Koha serves static .js files as application/javascript (if /etc/mime.types
says to) and serves them compressed, but output_with_http_headers uses the
currently-correct text/javascript mimetype, and Koha doesn't compress that.

Test plan:
1. Set the preference EnableAdvancedCatalogingEditor to Enable.
2. Open the browser Web Developer Tools to the Network tab
3. Load Cataloging - Advanced editor
4. Click on the line for the framework?frameworkcode=&callback=define load
5. Note the content-type text/javascript, no Content-Encoding line, and
   the size of 1.9MB
6. Apply the patches from bug 36463 if they haven't been pushed, then this
   patch, and reset_all
7. Repeat steps 1-4, and note a Content-Encoding: gzip header and a
   Transferred size around 160KB

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>
(cherry picked from commit c52af2cef0d79f20d74ebf170d4d5514b139ea65)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e0c3032b6f397f2b83073a6d274cdcfd370415e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36463: (follow-up) Adjust other occurence (intranet)
Nick Clemens [Fri, 29 Mar 2024 16:12:01 +0000 (16:12 +0000)]
Bug 36463: (follow-up) Adjust other occurence (intranet)

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 69ad327379fe0bc46926fb51276f81849a4a6f49)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 30b0b8a3200b1adbedd093b07ca2ce1129aa14ed)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36463: Compress application/json
Nick Clemens [Fri, 29 Mar 2024 12:54:30 +0000 (12:54 +0000)]
Bug 36463: Compress application/json

This patch simply adds application/json to the mod_deflate configuration

To test:
1 - Open the netowrk tab in firefox
2 - Load http://localhost:8081/api/v1/libraries
3 - Not the transferred size, and note no 'Content-Encoding: gzip" header
4 - Apply patch, reset_all (or edit /etc/koha/apache-shared.conf)
5 - Reload
6 - Note smaller size, note gzip header

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bccf7764c0e3eea22713edb7d76f90c8d8bf8c2b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d8afbbf6615d56ac13a45e3ce658623d159c5a68)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36353: Update relationship value so that it is blank and consistent with other...
Laura Escamilla [Mon, 18 Mar 2024 19:42:01 +0000 (19:42 +0000)]
Bug 36353: Update relationship value so that it is blank and consistent with other forms

To Test:

1. Choose a User Eligible for a Guarantor:
   1. Modify the user profile to include a new guarantor.
   2. Upon selecting a guarantor, ensure that the empty option in the 'Relationship' dropdown appears as a blank box.

2. Select a User Eligible for a Guarantee:
   1. Navigate to "Add Guarantee" in the top menu.
   2. Verify that the guarantor field is automatically populated with the selected user.
   3. Confirm that the 'Relationship' dropdown displays the empty option as 'Empty record.'

3. Apply Patch and Refresh the Page for Step 2:
   1. After applying the patch, refresh the page for step 2.
   2. Ensure that the empty option value for 'Relationship' is now displayed as blank.

4. Sign Off and Have a Great Day! 😊🎉#

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9de44f00f7744b1ad09ffc0d619344872f81305b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 75c3ff228e3f5145caec125fcf5a114396e3aaca)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36142: recallsview template param for opac-recall.tt
Pedro Amorim [Wed, 21 Feb 2024 13:03:13 +0000 (13:03 +0000)]
Bug 36142: recallsview template param for opac-recall.tt

Test plan:
1) Enable UseRecalls
2) Visit OPAC confirm recall page:
<opac_url>/cgi-bin/koha/opac-recall.pl?biblionumber=76
3) Notice left-side menu 'Recalls history' is not active
4) Apply patch. Repeat.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 44d2303ef7397e352c889ce2405b4d01e9f11fbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3f731be49000f71ef020c21f02663d12153c62d2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36452: correct display of patron message
Philip Orr [Thu, 28 Mar 2024 10:34:32 +0000 (10:34 +0000)]
Bug 36452: correct display of patron message

To test:
1. Before applying the patch:
2. In the staff interface, navigate to a patron
3. Add a new staff message that contains multiple lines (e.g. using
   enter for the next line)
4. Save the message and check the display.
   It will be a single line.
5. Apply the patch and navigate back to the
   patron
6. The message should now be displayed as multiple lines.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5e8059a6f83493149ecefc03b9a47c42288a26ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 54bb9ffe16aba5fb91aa743f7e2f5b8d176a78dc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36462: remove extra Home breadcrumb item
Andreas Roussos [Fri, 29 Mar 2024 06:59:41 +0000 (07:59 +0100)]
Bug 36462: remove extra Home breadcrumb item

In the Staff interface, when viewing (or editing) the authority MARC
subfield structure for a particular field, the Home button breadcrumb
on the top left of the screen appears twice.

This patch fixes that.

Test plan:
1) Try to view (or edit) the authority MARC subfield structure for
   a particular field. Notice the 'Home' breadcrumb button/icon is
   appearing twice.
2) Apply this patch.
3) Refresh the page, the 'Home' breadcrumb icon should now appear
   only once.

Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f7df7819cd4f9135c1eb4e389eee1ef2a144e2b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6f7d4ca168e5dd2bad6f4c994ca1c07b59332c86)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
4 weeks agoBug 36516: Fix useless warning from translation script
Jonathan Druart [Thu, 4 Apr 2024 09:13:04 +0000 (11:13 +0200)]
Bug 36516: Fix useless warning from translation script

I lost too much time trying to know what the translation script outputs
  sh: 1: Syntax error: end of file unexpected

To recreate:
touch 'koha-tmpl/intranet-tmpl/prog/en/modules/<' (yes, don't ask!)
koha-translate -i de-DE --dev kohadev
or
koha-translate -u de-DE --dev kohadev

And you get the shell error without any ideas what's happening!

With this patch applied you will not get any errors because the quote
will actually copy the file (what is expected).

But without the quote the cp command will fail and the explanation will be
displayed
sh: 1: Syntax error: end of file unexpected
Cannot copy /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/< to /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/de-DE/modules/< at /kohadevbox/koha/misc/translator/tmpl_process3.pl line 385.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0026ee3e971b6556f2fdd97f6173d12337bb7c0f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2001b853f4028c807bf986cdd42c687961f9c67a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>