koha-ffzg.git
16 months agoUpdate release notes for 22.05.08 release v22.05.08
Lucas Gass [Thu, 22 Dec 2022 18:17:09 +0000 (18:17 +0000)]
Update release notes for 22.05.08 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoIncrement version for the 22.05.08 release
Lucas Gass [Thu, 22 Dec 2022 17:18:30 +0000 (17:18 +0000)]
Increment version for the 22.05.08 release

16 months agoMerge remote-tracking branch 'translations/22.05.08-translate-20221222' into security...
Lucas Gass [Thu, 22 Dec 2022 17:15:15 +0000 (17:15 +0000)]
Merge remote-tracking branch 'translations/22.05.08-translate-20221222' into security/22.05.x-security

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoTranslation updates for Koha 22.05.08
Koha translators [Thu, 22 Dec 2022 17:11:49 +0000 (14:11 -0300)]
Translation updates for Koha 22.05.08

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32208: Adjust Auth.pm for relogin without perms
Marcel de Rooy [Tue, 15 Nov 2022 13:55:18 +0000 (13:55 +0000)]
Bug 32208: Adjust Auth.pm for relogin without perms

If a second login on top of a current session fails on
permissions, we should not grant access without context.

Test plan:
[1] Run t/db../Auth.t, it should pass now.
[2] Test interface with/without this patch:
    Pick two users: A has perms, B has not.
    Put two staff login forms in two tabs.
    Login as A in tab1. Login as B in tab2.
    Without this patch, B gets in and crashes.
    With this patch, B does not get in ('no perms').
    Bonus: Go to opac if on same domain. You are still
    logged in as B.

NOTE: I added a FIXME here, since you could argue about filling
the session info or otoh deleting the session. We present an
authorization failure; people may not realize that they are
still logged in (see test plan - bonus).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32208: Extend Auth.t
Marcel de Rooy [Tue, 15 Nov 2022 13:53:17 +0000 (13:53 +0000)]
Bug 32208: Extend Auth.t

Test plan:
Without follow-up patch, Auth.t should fail:
    not ok 5 - No permission response
    not ok 6 - checkauth returned failure

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 31908: Add selenium tests
Jonathan Druart [Fri, 11 Nov 2022 12:08:53 +0000 (13:08 +0100)]
Bug 31908: Add selenium tests

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 31908: Resolve second login with another userid
Marcel de Rooy [Tue, 8 Nov 2022 13:40:17 +0000 (13:40 +0000)]
Bug 31908: Resolve second login with another userid

Somewhere the line undef $userid got removed.
We need it to resolve the second login situation.

Test plan:
Login in staff with user missing privileges.
On the login form login again with another staff user.
Note that you do no longer crash.

Run t/db../Auth.t
Run t/db../Koha/Auth/TwoFactorAuth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 31908: Add a test to show issue
Marcel de Rooy [Mon, 14 Nov 2022 11:07:09 +0000 (11:07 +0000)]
Bug 31908: Add a test to show issue

Test plan:
Without next patch, run Auth.t.
Should fail now before next patch resolves problem:
    not ok 2 - Login of patron2 approved
    ok 3 - Did not return previous session ID
    not ok 4 - New session ID not empty

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 31908: Replace an exit by a safe_exit in Auth.pm L1314
Marcel de Rooy [Mon, 14 Nov 2022 11:09:43 +0000 (11:09 +0000)]
Bug 31908: Replace an exit by a safe_exit in Auth.pm L1314

No change in user experience. But since we can mock safe_exit,
we can enhance test results.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 27265: (QA follow-up) Typo on L99 cron script
Marcel de Rooy [Mon, 17 Oct 2022 13:08:33 +0000 (13:08 +0000)]
Bug 27265: (QA follow-up) Typo on L99 cron script

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ae986b992dfc2299ec58f4d1c0079fbac1ec4a03)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 27265: (follow-up) Use existing parameter
Nick Clemens [Fri, 30 Sep 2022 12:32:25 +0000 (12:32 +0000)]
Bug 27265: (follow-up) Use existing parameter

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a39ecfd7f766be77d92d0054364ecda65942d2ec)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 27265: Enable message queue cron to accept multiple codes and types
Kyle M Hall [Fri, 18 Dec 2020 13:45:06 +0000 (08:45 -0500)]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit da7bcc2252666e31c64d7edaecc3fc59ead79a0d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32114: Add missing html_helpers.inc
Owen Leonard [Sat, 5 Nov 2022 16:02:55 +0000 (16:02 +0000)]
Bug 32114: Add missing html_helpers.inc

This patch makes a minor modification to the OPAC
search results RSS template so that an error isn't
triggered. The html_helpers include was missing.

To test, apply the patch and perform a catalog
search in the OPAC which will return results.

At the end of the "Your search results" heading
you should see an orange RSS icon. Clicking on it
should take you to an RSS feed instead of an
error page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2621f28376b0c82205f3faf5e06c1f788e6c9b2a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32242: [22.05] fix selenium tests for 22.05
Lucas Gass [Wed, 21 Dec 2022 16:41:00 +0000 (16:41 +0000)]
Bug 32242: [22.05] fix selenium tests for 22.05

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32242: Add selenium tests
Jonathan Druart [Thu, 17 Nov 2022 13:32:49 +0000 (14:32 +0100)]
Bug 32242: Add selenium tests

This is not testing the thing at the correct level, but at least we test
the whole workflow.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a922c8cc968f41f0cbf5f577adef16312474223a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32242: Resolve encoding issue when sending to Net::Stomp
Marcel de Rooy [Thu, 17 Nov 2022 09:29:42 +0000 (09:29 +0000)]
Bug 32242: Resolve encoding issue when sending to Net::Stomp

This is meant as a quick fix. It should be enhanced later on by
letting Net::Stomp do the UTF8 conversion.

Test plan:
Run batch mod items. Add a Unicode char in the notes.
Check if job runs and results are correct.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 022034a1c7b91adac539c7ed16fc7b48d566912e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32012: runreport.pl should use binmode UTF-8
Fridolin Somers [Thu, 27 Oct 2022 09:15:35 +0000 (23:15 -1000)]
Bug 32012: runreport.pl should use binmode UTF-8

Like Bug 26832 added binmode UTF-8 to script misc/search_tools/export_elasticsearch_mappings.pl, this should be added to misc/cronjobs/runreport.pl.

Test plan :
1) Do not apply patch
2) Create a SQL report with :
   SELECT 'accentué',barcode FROM items limit 3
3) Note the id of this report, for example 1
4) Run : misc/cronjobs/runreport.pl 1 --format csv | tee /tmp/without.csv
=> You see output with unknown character instead of é :
5) Run : file --mime-type /tmp/without.csv
=> You see : /tmp/without.csv: iso-8859-1
6) Apply patch
7) Run : misc/cronjobs/runreport.pl 1 --format csv | tee /tmp/with.csv
=> You see correct output with é
8) Run : file --mime-type /tmp/without.csv
=> You see : /tmp/without.csv: utf-8

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9aa21276b21693bdc60547ec532ec0595337df08)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31976: Incorrect default category selected by authorized values page
Owen Leonard [Wed, 26 Oct 2022 15:52:18 +0000 (15:52 +0000)]
Bug 31976: Incorrect default category selected by authorized values page

This patch removes some obsolete code for selecting a default authorized
value category to be shown when the user first arrives on the authorized
values page. This has not been necessary since we switched to an
interface which lists all categories.

NOTE: This bug will not be reproducible if your first authorized value,
alphabetically, has no values associated with it. For instance, if you
delete all authorized values in the AR_CANCELLATION category.

To test, apply the patch and go to Administration -> Authorized values.

In the breadcrumbs menu you should see "Home -> Administration ->
Authorized values."

Clicking any of the authorized value categories in the list should take
you to a view of that category's values.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0ec29e5d4ecdf5dd3156b53320eac1250d065e3b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls
Jonathan Druart [Wed, 20 Jul 2022 07:38:57 +0000 (09:38 +0200)]
Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls

We are seeing the following lines several times in the codebase
  $cache->clear_from_cache("default_value_for_mod_marc-");

But values are never set for this key.

Test plan:
Ask you, "Is the above correct?"
Use the correct 'git grep' and 'git log' and confirm the assertion.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 93d44d18759d43a09f6c623ffe4fa81dca4dcaa2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31609: JavaScript error on Additional contents main page
Owen Leonard [Fri, 23 Sep 2022 14:22:37 +0000 (14:22 +0000)]
Bug 31609: JavaScript error on Additional contents main page

This patch makes a minor modification to the JavaScript
on the Additional contents page to prevent an error when
there are no tabs present on the page.

The JS needs an additional check so that it doesn't run
when there are no tabs.

To test you should have more than one language installed.

- Before the patch, you would see a JavaScript error in
  the console: "Uncaught TypeError: can't access property
  "hash", firstTab[0] is undefined."
- Apply the patch and go to Tools -> Additional
  contents.
- With the patch applied there should be no error on the
  additional contents main page.
- Try creating or editing additional contents entries to
  confirm that the interface still works correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 13ad2132737cdfb2ae7c1daeffd733a383610f09)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 19693: (QA follow-up) Replace changed tag test
Marcel de Rooy [Fri, 7 Oct 2022 08:41:20 +0000 (08:41 +0000)]
Bug 19693: (QA follow-up) Replace changed tag test

The test
  $MARCfrom->field('1..', '2..'))[0]->tag ne ($MARCto->field('1..', '2..'))[0]->tag
is not completely consistent with following code in sub merge.
I decided to get the authtype code from the old record that comes
from Koha and should include the type.
Remaining changes refer to indentation/comments.

Test plan:
Run t/db_dependent/Authority/Merge.t
Note: The test actually could be extended a bit for mocking MARC
flavor, but needs some additional framework support to work.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d7d33744ba34ef95aa3845ca4160abdece4d0f7a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 19693: Update of an authority record creates inconsistency when the heading tag...
Janusz Kaczmarek [Mon, 25 Jul 2022 20:46:58 +0000 (22:46 +0200)]
Bug 19693: Update of an authority record creates inconsistency when the heading tag is changed

In those rare cases when authorities are updated by an external agency (or
even internally, by reviewing and correcting an exported authority file)
when the heading tag will be changed (seems odd but happens:

111 Congress ==> 110 Corporate body.Congress ;
100 Person ==> 110 Corporate body (a company named with person's name ;
151 City--object ==> 150 Object (city) etc.)

and then the authority record in Koha database will be updated with
bulkmarcimport or by calling directly ModAuthority from a custom script,
the merge function "doesn't know" that the change to the authority type
has been made and, consequently, doesn't adequately change the tag in
related fields in biblio records (as it would if two different records
with different authtypecode were merged with Koha interface).

This is because at the moment when merge function is being called
by ModAuthority:
Koha::Authority::Types->find($autfrom->authtypecode)
Koha::Authority::Types->find($authto->authtypecode)
both have the same value (because $mergefrom == $mergeto).

Therefore in case when $mergefrom == $mergeto and the heading tag changes,
$authtypefrom and $authfrom calculated in merge in the ordinar way are
misleading and should not be taken unto consideration.

Test plan:
==========

1. run t/db_dependent/Authority/Merge.t
2. you should see problems in "Test update A with modified heading tag
   (changing authtype)"
3. apply the patch
4. run t/db_dependent/Authority/Merge.t again
5. the test should pass

Alternatively:

1. have an authority record used in biblio;
   export it to file;
   change 1XX heading tag to a different (but reasonable) value
   and possibly change also the content of the heading
   (one can delete also 942 but it doesn't matter);
   make bulkmarcimport.pl -a -update -file <modified_auth_file> and
   see that the tag in biblio record has not been changed (whereas
   the type of authority record did change);

2. make orders in database (so that the authority type and the tag of
   the field in biblio record correspond); apply the patch;

3. repeat the test from 1.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 03da66ce20ea6b8dd9e46841c3c8df427efbe4e4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 19693: Add test sub to Merge.t
Janusz Kaczmarek [Mon, 25 Jul 2022 20:27:32 +0000 (22:27 +0200)]
Bug 19693: Add test sub to Merge.t

In those rare cases when authorities are updated by an external agency (or
even internally, by reviewing and correcting an exported authority file)
when the heading tag will be changed (seems odd but happens:

111 Congress ==> 110 Corporate body.Congress ;
100 Person ==> 110 Corporate body (a company named with person's name ;
151 City--object ==> 150 Object (city) etc.)

and then the authority record in Koha database will be updated with
bulkmarcimport or by calling directly ModAuthority from a custom script,
the merge function "doesn't know" that the change to the authority type
has been made and, consequently, doesn't adequately change the tag in
related fields in biblio records (as it would if two different records
with different authtypecode were merged with Koha interface).

This is because at the moment when merge function is being called
by ModAuthority:
Koha::Authority::Types->find($autfrom->authtypecode)
Koha::Authority::Types->find($authto->authtypecode)
both have the same value (because $mergefrom == $mergeto).

Therefore in case when $mergefrom == $mergeto and the heading tag changes,
$authtypefrom and $authfrom calculated in merge in the ordinar way are
misleading and should not be taken unto consideration.

Test plan:
==========

1. run t/db_dependent/Authority/Merge.t
2. you should see problems in "Test update A with modified heading tag
   (changing authtype)"
3. apply the patch
4. run t/db_dependent/Authority/Merge.t again
5. the test should pass

Alternatively:

1. have an authority record used in biblio;
   export it to file;
   change 1XX heading tag to a different (but reasonable) value
   and possibly change also the content of the heading
   (one can delete also 942 but it doesn't matter);
   make bulkmarcimport.pl -a -update -file <modified_auth_file> and
   see that the tag in biblio record has not been changed (whereas
   the type of authority record did change);

2. make orders in database (so that the authority type and the tag of
   the field in biblio record correspond); apply the patch;

3. repeat the test from 1.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4d75a9b3b786d75e1afb5f66e51f48e9e503d454)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31459: (QA follow-up) Add missing TT filters
Katrin Fischer [Mon, 17 Oct 2022 19:24:32 +0000 (19:24 +0000)]
Bug 31459: (QA follow-up) Add missing TT filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=31559
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6cc3a85eb13042c49a9ba1742fce0f0741949fa5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31459: (follow-up) Return 'Keep current' option
Nick Clemens [Mon, 17 Oct 2022 11:56:57 +0000 (11:56 +0000)]
Bug 31459: (follow-up) Return 'Keep current' option

This patch restores the option to keep current budget, in the case that receiver can receive, but cannot order on current budget

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=31559
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b86e5b542378c19ec8675a9beeb8d856c9b057c8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31459: (follow-up) Preserve budget period display
Nick Clemens [Wed, 12 Oct 2022 14:55:55 +0000 (14:55 +0000)]
Bug 31459: (follow-up) Preserve budget period display

This patch adds a level to the budget_loops and displays the budgets
as optgroups for the funds

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=31559
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2a22c13cf38b45c145fc3ece7d044fefb1dd78e5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31459: Use the same dropdown as when adding orders to a basket
Nick Clemens [Thu, 25 Aug 2022 11:26:33 +0000 (11:26 +0000)]
Bug 31459: Use the same dropdown as when adding orders to a basket

Current order receive code loops over each budget period and gets the hierarchy, this
is slow when systems have many budgets. Additionally, the list includes inactive items
by default

We can switch to a single call, and add consistency by adopting the same dropdown as used
when placing an order

To test:
1 - Add some budgets with funds - ensure you have at least one inactive budget and fund
2 - Place an order, observe the fund selection menu
3 - Close basket, receive order, observe the fund menu
4 - Apply patch
5 - Cancel receipt
6 - Receive again
7 - Observe fund menu, confirm it matches the order placing menu
8 - Confirm inactive are not displayed by default, but are when button is checked

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=31559
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24e7703aef42b2e9e7900dc36eb5c8f1d3f73e4f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 15048: Index all possible searched subfields for index-term-genre
Nick Clemens [Thu, 23 Jun 2022 11:40:44 +0000 (11:40 +0000)]
Bug 15048: Index all possible searched subfields for index-term-genre

Currently we only index a - but we can setup the system such that avxyz are searched

To test:
 1 - define both a 655$a *and* 655$x value in a bib, save, reindex
 2 - Set system preferences:
      TraceSubjectSubdivisions: Include
      TraceCompleteSubfields: Force
 3 - View the record edited above in the opac
 4 - Click on the subject heading
 5 - No results found
 6 - Copy zebra files:
  sudo cp ./etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml \
  /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
  sudo cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \
  /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
 7 - restart all and reindex
 8 - Click on the subject heading in OPAC
 9 - Sucess!
10 - Repeat with other fields (vyz)
11 - Repeat under ES, reindexing and resetting mappings

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 57ea65e725f4208274023c4cdc63fd90ab6014ed)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31739: Password recovery from staff fails if previous expired reset-entry exists.
Björn Nylén [Wed, 12 Oct 2022 11:54:11 +0000 (11:54 +0000)]
Bug 31739: Password recovery from staff fails if previous expired reset-entry exists.

SendPasswordRecoveryEmail relies on the calling script to tell if there is an
existing valid recovery already. If there's an expired recovery-entry the
members/notices.pl script will try to create a new entry resulting in a duplicate
key error.

This patch fixes the bug by removing the need for the calling script to do the check as
since SendPasswordRecoveryEmail does the same thing anyway.
SendPasswordRecoveryEmail will now use DBIx ->update_or_create instead of looking at
the $update param to determine if it should update an existing entry or create a new.

The update param is removed from all calling scripts and test are updated.

To test:
1. Generate a password recovery mail for a patron
2. Let it expire.
3. Generate a new password recovery from staff to the same patron - Fail!
4: Apply patch
5. Generate a new password recovery from staff to the same patron - Success!
6. Opac password recovery flow should also work.
7. Tests pass.

Sponsored-by: Lund University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 043017af13a80ad432c597699f35e50260ed21ca)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31532: Add preprocessor to Zebra indexing pipeline to index 880 as linked field
David Cook [Thu, 8 Sep 2022 05:06:38 +0000 (05:06 +0000)]
Bug 31532: Add preprocessor to Zebra indexing pipeline to index 880 as linked field

This patch adds a preprocessor XSLT to the Zebra indexing pipeline,
so that 880 fields get indexed as the fields they're linked to. For example,
a "880 $6 245" field would be indexed as a "245" field.

However, because the preprocessor only occurs in the indexing part of the pipeline,
it does not affect the retrieval of MARCXML from Zebra. That MARCXML will be
the same MARCXML that was sent to Zebra from Koha.

Test plan:

0. Revert bug 15187, and apply patch for 31532
1. cp ./etc/zebradb/biblios/etc/dom-config.xml /etc/koha/zebradb/biblios/etc/dom-config.xml
2a. cp etc/zebradb/marc_defs/marc21/biblios/preprocess_marcxml.xsl /etc/koha/zebradb/marc_defs/marc21/biblios/.
2b. cp etc/zebradb/marc_defs/normarc/biblios/preprocess_marcxml.xsl /etc/koha/zebradb/marc_defs/normarc/biblios/.
2c. cp etc/zebradb/marc_defs/unimarc/biblios/preprocess_marcxml.xsl /etc/koha/zebradb/marc_defs/unimarc/biblios/.
3. koha-rebuild-zebra -b -f -v kohadev
4. Note that in search results the 880$6245$a data appears before the 245$a data
5. Note that you can do a title index search on the 880$6245$a data

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c673944ba8a5f2b785836dab562acdbb026ccee)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31903: Fix missing Edit URL link
Marcel de Rooy [Fri, 21 Oct 2022 09:26:08 +0000 (09:26 +0000)]
Bug 31903: Fix missing Edit URL link

We need to pass format too for New tab (see Pending/Processing).

Test plan:
* Include SCAN format in ArticleRequestSupportedFormats system preferences.
* Check circ rules to allow article requests.
* Add a new request for digital copy and another for photocopy.
* Check Circulation - Article requests - New tab.
* Verify that the Actions menu for a single row for the digital copy
  does contain the "Edit URL(s)" option now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Amended test plan.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4e6b4b4ae7d4cce7405f9811218f8d8116152d95)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31644: Add copy test and clarify some functions
Nick Clemens [Thu, 29 Sep 2022 16:13:10 +0000 (16:13 +0000)]
Bug 31644: Add copy test and clarify some functions

This patch adds a tst for copy without subfields. I also clarify what eachstep does
so the next user/coder understands current behaviour

Update existing or add new: In the case where the field/subfield exists
we update, if we have two fields - one with the subfield, and one without, we
add the subfield to the one without

Copy field:
 - If given a subfield - we will add to existing fields in the record
 - If not given a subfield - we create an entirely new field

The logic of all of this is tricky, makes sense in a certain light, any complaints
are for a new bug :-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 74742f52768b22c9e49ba0a8407fdb0ea95f3251)

17 months agoBug 31644: Check if subfield defined, not for truth
Nick Clemens [Wed, 28 Sep 2022 18:53:28 +0000 (18:53 +0000)]
Bug 31644: Check if subfield defined, not for truth

To test:
1 - Define a new MARC Modification template with actions:
        Copy field 600$a to 942$0
2 - Define a new record like:
    LDR 00334nam a22001217a 4500
    003 ff
    005 20201102111604.0
    008 201102b        xxu||||| |||| 00| 0 eng d
    040 _ _ ‡cvsd
    100 1 _ ‡012345‡aKnuth, Donal Ervin‡d1938
    245 _ _ ‡012345‡aThe aty of computer programming‡cDonald E. Knuth
    600 _ 0 ‡042‡aComputer programming‡9462
3 - Modify this record using the template above
4 - Note that entire  field is copied to 942
5 - Apply patch
6 - Now only subfield 0 is copied

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2f61afa9c502874ed98e9cc67f6b99d6365bbf95)

17 months agoBug 31644: Unit test
Nick Clemens [Thu, 29 Sep 2022 12:36:11 +0000 (12:36 +0000)]
Bug 31644: Unit test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4ab009cc9a9a1d872e55759e4c976b0dff93bc99)

17 months agoBug 31869: Unable to save thesaurus value to frameworks subfields
Nick Clemens [Wed, 19 Oct 2022 11:17:37 +0000 (11:17 +0000)]
Bug 31869: Unable to save thesaurus value to frameworks subfields

This patch correct a typo authtypecodes for authtypecode

To test:
1. Edit e.g. default frameworks subfield 100$a
2. Add or change fields thesaurus value
3. Save your changes
   => note that on subfield listing there is no mention that 100$a is linked to any thesaurus
   => if you edit 100$a thesaurus input is empty
4. Apply patch
5. Edit subfield 100$a and set a thesaurus value
6. Confirm it saves and displays correctly

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 56ca0324ad8e4a21cb1ac5ad2325088f246281c0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 18556: Clarify lost and gonenoaddress messages
Nick Clemens [Wed, 14 Sep 2022 12:21:44 +0000 (12:21 +0000)]
Bug 18556: Clarify lost and gonenoaddress messages

This patch alters the message for the patron flasg slightly, and adds
a title to provide explicit info when hoevered

To test:
1 - Edit a patron and set gonenoaddress and lost flags
2 - Note new info in the flags section
3 - Go to 'Checkout' or 'Details' tab for patron
4 - Confirm the messages make sense
5 - Confirm you see a tool tip when hovering on messages

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ae5d1f98acd84cd397cd29319525a3674dc9f107)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31920: Add transaction to subtest in t/db_dependent/Holds.t
Kyle Hall [Fri, 21 Oct 2022 15:31:09 +0000 (11:31 -0400)]
Bug 31920: Add transaction to subtest in t/db_dependent/Holds.t

A subest in t/db_dependent/Holds.t leaves behind database cruft.

Test Plan:
Using koha-testing-docker:
1) SELECT branchcode FROM branches
2) prove t/db_dependent/Holds.t
3) SELECT branchcode FROM branches
   Note cruft
4) reset_all
2) prove t/db_dependent/Holds.t
3) SELECT branchcode FROM branches
   No cruft!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2b8b02a5870e6d5941077106eae8d13c8b29d05a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31588 - Update cpanfile for new OpenAPI versions (22.05)
Mason James [Tue, 20 Sep 2022 16:25:38 +0000 (04:25 +1200)]
Bug 31588 - Update cpanfile for new OpenAPI versions (22.05)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29987: (QA follow-up) Remove unused cnt attribute missing a filter
Kyle M Hall [Fri, 21 Oct 2022 10:49:32 +0000 (10:49 +0000)]
Bug 29987: (QA follow-up) Remove unused cnt attribute missing a filter

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 489676e1185b87b8039a2e1e2a81fe5087a34081)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29987: Improve validation
Martin Renvoize [Fri, 30 Sep 2022 15:06:45 +0000 (16:06 +0100)]
Bug 29987: Improve validation

This patch adds hinting to display the required state of the cash
register fields.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bce51debc65acfb89232a8603abb3e37c4f3b101)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29987: Display credit without offsets in transactions
Martin Renvoize [Wed, 24 Aug 2022 10:06:57 +0000 (11:06 +0100)]
Bug 29987: Display credit without offsets in transactions

This patch adds a row to the transactions table for credits without
corresponding offsets

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d6262c0f302fb6140a3d0c311305502d667f2022)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29987: (follow-up) Fix missing payment type
Martin Renvoize [Wed, 24 Aug 2022 10:23:25 +0000 (11:23 +0100)]
Bug 29987: (follow-up) Fix missing payment type

The payment type include has changed since the patch was first written,
we now require a 'type' is passed to properly set the field name.

This should fix the 'bankable' issue raised.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a0593924906b74f41c8b347469a3eaa558e400a1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29987: Add register support to manual credits
Martin Renvoize [Wed, 29 Jun 2022 16:19:05 +0000 (17:19 +0100)]
Bug 29987: Add register support to manual credits

This patch adds the register and transaction type selection options to
the manual credit page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 529341c78bfaf7b8ece43e18cc30a13b64478639)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31684: Set Koha::Plugin::Test version to 'v1.01'
Kyle M Hall [Wed, 5 Oct 2022 12:47:16 +0000 (12:47 +0000)]
Bug 31684: Set Koha::Plugin::Test version to 'v1.01'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a26cc8a29bb86185a5131a21e4e25166c503323e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31684: Plugin versions starting with a "v" cause unnecessary warnings
Kyle M Hall [Wed, 17 Mar 2021 14:44:31 +0000 (10:44 -0400)]
Bug 31684: Plugin versions starting with a "v" cause unnecessary warnings

Our code assumes that plugin version will be purely numeric ( e.g. 1.2.3 ) but many plugin authors ( including myself ) use the format "v1.2.3".
This causes warnings as we use a numeric comparison on the version numbers.
It could make sense to check for and strip any v's from the beginning of the version.

Test Plan:
1) Apply the first patch to set the test plugin's version to v1.01
2) prove t/db_dependent/Koha/Plugins/Plugins.t
3) Note the warnings and test failures
4) Apply this patch
5) prove t/db_dependent/Koha/Plugins/Plugins.t
6) All tests pass!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd51a238c84b8e9ce5b0f276c4e35e287eb059da)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31738: Fix untranslatable string for recalls
Katrin Fischer [Sat, 15 Oct 2022 22:04:11 +0000 (00:04 +0200)]
Bug 31738: Fix untranslatable string for recalls

To test translation:
1. Apply patch and update your po files using:
   https://wiki.koha-community.org/wiki/Translating_Koha#Updating_the_po_files_in_your_installation
2. Verify the string appears in po files now and translate it
3. Install the language

To test functionality:
1. Turn on recalls
   1.1. In Administration > Global system preferences, enable UseRecalls
   1.2. Add recalls permissions in your circulation rules
2. In the OPAC, log in as a patron
3. Find a record with checked out items and place a recall
4. In the intranet, go to the patron file of the patron who currently has that item checked out
--> In the Checkouts table at the bottom of the page, there is a red message next to the recalled title

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0e34f555f95580dfe65f76787badbaf148b3377e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31883: Filter trim causes false warnings
Mason James [Thu, 20 Oct 2022 00:26:17 +0000 (13:26 +1300)]
Bug 31883: Filter trim causes false warnings

Test plan:
Run xt/find-missing-filters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 246efd2e9b843f3a2920fcf0a0414280e6f1a1c2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 27315: use the namespace-aware docbook stylesheet
Andreas Roussos [Tue, 11 Oct 2022 06:41:15 +0000 (08:41 +0200)]
Bug 27315: use the namespace-aware docbook stylesheet

When viewing the man page for the `koha-list` command, the output does
not appear correctly: there appears to be a "staircase"-like effect on
the text. The same is true for all other man pages.

The source XML files for our man pages have the following namespace
declaration at the top: xmlns='http://docbook.org/ns/docbook', which
means they are DocBook V5.0 documents and should be processed by
namespace-aware DocBook XSL stylesheets.

This patch fixes that by using the DocBook-to-man-page transformation
stylesheet from the docbook-xsl-ns package (note the "-ns" suffix).

Test plan:
1) Apply the patch
2) Build and install new package
3) Confirm the man pages display correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 43ecb3c86c8770ae2606dc0f64aa316a35bc8adf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31776: Fix a typo in cleanup_database.pl cronjob's help/usage
Petro Vashchuk [Thu, 13 Oct 2022 14:37:24 +0000 (17:37 +0300)]
Bug 31776: Fix a typo in cleanup_database.pl cronjob's help/usage

cleanup_database.pl cronjob has a typo in it's usage/help:
"preserve-logs" option should be "preserve-log" as it is everywhere
in the code.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b04e8185a3e76004b152b877d7109f6534ef7371)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 28967: Patrons with no checkouts report shows patrons from other libraries with...
The Minh Luong [Wed, 26 Jan 2022 21:22:19 +0000 (16:22 -0500)]
Bug 28967: Patrons with no checkouts report shows patrons from other libraries with IndependentBranches

When IndependentBranches is activated and a non-superlibrarian user looks at the "Patrons with no checkouts" report, it shows patrons from other libraries.

To recreate:
1) Activate IndependentBranches, IndependentBranchesPatronModifications and IndependentBranchesTransfers
2) Create a staff user with limited permissions (NOT a superlibrarian), including reports permissions. Here are mine as an example
  - circulate (all)
  - catalogue
  - borrowers
    - delete_borrowers
    - edit_borrowers
  - reserveforothers (all)
  - reports (all)
3) Create (or make sure you already have) a patron in another branch (if using an existing patron, make sure they have no checkouts or checkout history)
4) Log in as your limited staff patron
5) Go to Reports > Inactive > Patrons who haven't checked out
6) Don't put in any limitations and click Submit
-- The patron from the other library appears in the list
7) Try to search for that other patron in the patron module
-- The patron from the other library is inaccessible
8) Apply the patch
9) Notice that the limited patron can only see patrons from his own
library

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ae9536b61fe8381eb92956bfb3cc698d03bb08c1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31595: Don't process extended attributes if none are inlcuded in the file
Nick Clemens [Wed, 21 Sep 2022 16:10:34 +0000 (16:10 +0000)]
Bug 31595: Don't process extended attributes if none are inlcuded in the file

This patch simply adds a check to the import process to only process attrbutes if
they have been found in the data

To test:
1 - Import some patrons without extended attributes
2 - Import patrons including extended attributes
3 - Confirm both work unchanged

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 40cff1a774a3a9deea2effb375b3e7272003444c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31785: (follow-up) Fix modify operation too
Marcel de Rooy [Fri, 14 Oct 2022 09:07:14 +0000 (09:07 +0000)]
Bug 31785: (follow-up) Fix modify operation too

Test plan:
Enable SQL strict mode (koha-conf).
Modify branch, set Public to No.
Check.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0d974073db9311336ddb6bcdf82eb980953983a8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31785: Fix for adding non-public library
Marcel de Rooy [Fri, 14 Oct 2022 07:42:26 +0000 (07:42 +0000)]
Bug 31785: Fix for adding non-public library

The code in admin/branches.pl changed a 0 to undef which is not
desirable for booleans.
A similar fix was already present for pickup_location.
This may need a bit more thought (somewhere else!).

Test plan:
Add a new branch with pickup location No, public No.
Check.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9c4a557c970705cad8f209f05b1f615940fde0ca)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29554: Do not hide display of itemtypes on neworderempty
Marcel de Rooy [Mon, 22 Nov 2021 13:00:57 +0000 (13:00 +0000)]
Bug 29554: Do not hide display of itemtypes on neworderempty

Hiding the list may lead to biblioitems.itemtype being NULL.
We do not want that, since 942$c is mandatory.

Test plan:
Create basket and set 'create items when' to receiving or
cataloging.
Create order from new empty record.
Check biblioitems.itemtype of created biblio.
Without this patch, it would have been NULL like this:
    select biblionumber,title from biblio;
    |            7 | Test 3                |
    select biblionumber,itemtype from biblioitems;
    |            7 | NULL     |

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2e650fdd0cb48c8120b66a4c5c6318f674d2801b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31469: log4perl.conf: Add %n to conversionpattern for Plack
Marcel de Rooy [Thu, 29 Sep 2022 07:51:33 +0000 (07:51 +0000)]
Bug 31469: log4perl.conf: Add %n to conversionpattern for Plack

The PLACKOPAC, PLACKAPI and PLACKINTRANET appenders still need %n
(i.e. a newline). Note that this patch does not add %l since it
is a bit confusing because it adds a lot of Plack internal noise like:
    [2022/09/29 08:51:34] [WARN] Test mainpage CGI::Compile::ROOT::usr_share_koha_mainpage_2epl::__ANON__ /usr/share/koha/mainpage.pl (49)

The patch is a result of:
    git grep -l "log4perl.appender.PLACK" | xargs sed -i -e"/ConversionPattern/ s/%m$/%m%n/"

Test plan:
First run: sed -i -e"/ConversionPattern/ s/%m$/%m%n/" /etc/koha/sites/[YOUR_CLONE]/log4perl.conf
Edit that file, change PLACKOPAC to debug level like:
    log4perl.logger.plack-opac = DEBUG, PLACKOPAC
Restart.
Hit an OPAC page twice.
Check plack-opac logfile and verify that it contains a newline between last two messages like:
    [2022/09/29 08:04:30] [DEBUG] kohaversion : 22.0600054
    [2022/09/29 08:04:42] [DEBUG] kohaversion : 22.0600054

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ef81785d76115d1591075ed1d04a1dfe4430c5eb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31552: SIP2 option format_due_date not honored for AH field in item information...
Kyle Hall [Mon, 12 Sep 2022 17:52:23 +0000 (13:52 -0400)]
Bug 31552: SIP2 option format_due_date not honored for AH field in item information response

Bug 28730 added the ability to format due dates based on Koha's date format, but missed formatting the due date field in the item information response.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Message.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 93e418c0b3e6b41aae99e3bd66664bc0ac94b24f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 26648: Prevent explosion in notices on missing item
Martin Renvoize [Fri, 9 Oct 2020 15:13:00 +0000 (16:13 +0100)]
Bug 26648: Prevent explosion in notices on missing item

The item accessor in Koha::Old::Checkouts could explode given a checkout
where the item had been deleted.

To test
1/ Edit the issueslip notice to output some item details from the
borrowers old checkouts

[% FOREACH old_checkout IN borrower.old_checkouts %]
  [% IF old_checkout.item %]
    [% old_checkout.item.price %]
  [% END %]
[% END %]

2/ Delete the item associated with an old checkout for a test patron
3/ Print the issueslip for the patron
4/ Note a server side error is triggered
5/ Apply the patch
6/ Print the slip again and note the price details for old checkouts are
now displayed
7/ Signoff

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 971ad5538c3026e126081376520ccb3b13c12d1c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 26648: Add tests
Lucas Gass [Mon, 3 Oct 2022 18:27:21 +0000 (18:27 +0000)]
Bug 26648: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Cab Vinton <director@plaistowlibrary.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c6fc76f4783391713c69a32c217d51c641f2cc1a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31677: Convert basic MARC editor tabs to Bootstrap
Owen Leonard [Thu, 6 Oct 2022 13:38:54 +0000 (13:38 +0000)]
Bug 31677: Convert basic MARC editor tabs to Bootstrap

This patch modifies the basic MARC editor template to replace jQueryUI
tabs with Bootstrap tabs. The changes should have no visible effect,
with all previous functionality still intact.

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

- When the page first displays, the "0" tab should be active.
- Test that each of the numbered tabs works correctly to activate the
  correct tab content.
- Confirm that the numbered tag anchors still work correctly.
- Append a specific tab anchor to the URL, e.g. "#tab4XX" and refresh
  the page (you may need to shift-refresh). When the page reloads the
  correct tab should be active by default.
- Try appending a query string to the URL, e.g. "?tab=tab4XX" This
  should reload the page and make the correct tab active.
- Confirm that sortable subfields can still be re-ordered by dragging
  and dropping them via the "stacked lines" icons.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6017a91c8d59426f443245c8671eea8eabd4de44)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31678: Convert authority editor tabs to Bootstrap
Owen Leonard [Wed, 5 Oct 2022 19:08:24 +0000 (19:08 +0000)]
Bug 31678: Convert authority editor tabs to Bootstrap

This patch modifies the authorities editor template to replace jQueryUI
tabs with Bootstrap tabs. The changes should have no visible effect,
with all previous functionality still intact.

To test, apply the patch and go to Authorities -> New authority.

- When the page first displays, the "0" tab should be active.
- Test that each of the numbered tabs works correctly to activate the
  correct tab content.
- Confirm that the numbered tag anchors still work correctly.
- Append a specific tab anchor to the URL, e.g. "#tab4XX" and refresh
  the page (you may need to shift-refresh). When the page reloads the
  correct tab should be active by default.
- Confirm that sortable subfields can still be re-ordered by dragging
  and dropping them via the "stacked lines" icons.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit acea770e18c575384f74e0592ebc22ac242bcebc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29048: Fix link to linked records from authority search results in OPAC
Katrin Fischer [Sun, 27 Feb 2022 00:09:20 +0000 (01:09 +0100)]
Bug 29048: Fix link to linked records from authority search results in OPAC

Without this patch the constructed search link would give wrong
results with Elasticsearch. If you searched for records linked
to authority id 3 it would also turn up all other records linked
to an authority where the id started with 3...

This just copies the more specific link using an,phr used in the
staff interface and the OPAC detail page to make things consistent

To test:
- Turn on Elasticsearch
- Search for authorities in the OPAC
- Locate a authority with a low ID in your result list
- Note the number of linked records
- Click on the link
- It will give you more results than it said before
- Verify results don't match your search
- Apply patch
- Try again - now it should all match up

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 047489ece0c990bbd6259dd9a59cf3613dd67b5d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29561: (follow-up) Don't remove facet '0'
Nick Clemens [Thu, 22 Sep 2022 19:54:07 +0000 (19:54 +0000)]
Bug 29561: (follow-up) Don't remove facet '0'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c4161b703e36c21e769e4abb5edc99cfc33af6c2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29561: Remove blank facets
Nick Clemens [Tue, 23 Nov 2021 14:42:54 +0000 (14:42 +0000)]
Bug 29561: Remove blank facets

This patch strips the blank facets from the ES aggregations, this seems
to only affect language fields currently, but could affect any facetable field
that can contain blank values

To test:
1 - Have Koha running Elasticsearch with standard test data,
    or add some records with blank values in the 008/35-37
2 - Search for 'a'
3 - Look at the language facets, they should appear normal
4 - Browse to:
    http://localhost:8081/cgi-bin/koha/catalogue/search.pl?idx=&q=a&sort_by=relevance_dsc&count=20&limit=ln:
5 - Note there is now an 'x' under the Languages facet - to remove a limit you cannot see
6 - Apply patch
7 - Reload
8 - Note the x is not there
9 - Inspect HTML, confirm no blank link under language facets

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.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eeb12f8a521ccc470d2363fb6529a8c3e0cf78d5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29561: Unit test
Nick Clemens [Thu, 22 Sep 2022 19:51:46 +0000 (19:51 +0000)]
Bug 29561: Unit test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c473480d4e93d0506f7057db1eef34e66b8ddc73)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31682: Silence automatic linker warn
Aleisha Amohia [Tue, 4 Oct 2022 21:23:57 +0000 (21:23 +0000)]
Bug 31682: Silence automatic linker warn

To test:
1. Open the plack-intranet-error.log in your terminal
2. When editing or adding a bibliographic record, click the button to
link authorities automatically.
3. Notice the warn in the log
4. Apply the patch, restart services and refresh the page
5. Click the button again. There should be no warn

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 38c4837c2414d7479009ff28e86fbdbe40901ef1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31420: Managing funds: Labels of statistic fields overlap with pull downs
Owen Leonard [Tue, 4 Oct 2022 12:31:48 +0000 (12:31 +0000)]
Bug 31420: Managing funds: Labels of statistic fields overlap with pull downs

This patch removes some very old inline style attributes from the fund
edit form. The "white-space" attribute prevented label text from
naturally wrapping.

To test, apply the patch and go to Administration -> Funds.

- In the list of funds, click Actions -> Edit.
- The the form, confirm that the text of the "Statistic" 1 and 2 labels
  wraps, not getting hidden by the associated select tags.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3ffd2cc02166f3264376ace1038df4f83bf8118)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31587: Basket not accessible from ACQORDER notice
Kyle Hall [Tue, 20 Sep 2022 14:21:19 +0000 (10:21 -0400)]
Bug 31587: Basket not accessible from ACQORDER notice

The parameter "aqbasket" is passed to GetPreparedLetter, but is always undefined for the notice ACQORDER.

Test Plan:
1) Set your ACQORDER notice content to:
   ***[% basket %]***
2) Set up a vendor with an email, set contact for email so the "E-mail
   order" button shows on a basket for that vendor
3) E-mail the basket
4) Note the email contents are "******"
5) Apply this patch
6) Restart all the things!
7) Email the basket again
8) Note the content looks something like:
   ***Koha::Acquisition::Basket=HASH(0x55870acd96e0)***

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c89e886b6d99d92347b0da36d190429771a5ab97)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31587: Regression tests
Tomas Cohen Arazi [Tue, 20 Sep 2022 14:46:23 +0000 (11:46 -0300)]
Bug 31587: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fc7cc1467d5115de07e0c3f8a8229f3bdaf81739)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31575: Missing warning for holds where AllowHoldPolicyOverride can be used to...
Kyle Hall [Fri, 16 Sep 2022 14:47:48 +0000 (10:47 -0400)]
Bug 31575: Missing warning for holds where AllowHoldPolicyOverride can be used to force a hold to be placed

If some holds are overridable, and AllowHoldPolicyOverride is enabled, Koha
used to "flag" each holdable item to let librarians know the hold could not
normally be placed. In 22.05 up to current master as of this writing, no
warning is displayed.

Test Plan:
1) Set one circ rule to allow 0 holds
2) For Library A, set "Hold pickup library match" to "item's hold group"
3) Enable AllowHoldPolicyOverride
4) Set ReservesControlBranch to "item's home branch"
5) Create a record with an item for Library A, one for Library B, and one for Library C
   This should create a scenario where A's item cannot be held, and B and C's items must be overridden
6) Note you get the "Cannot place hold" but can place those holds anyway without a "warning" sign
7) Apply this patch
8) Restart all the things!
9) Reload the page, you should now see the warning icons!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 30eb30b3c1b3d71aed4e63f9f230cfb36f52abe2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31619: add title back to list of OPACSuggestionMandatoryFields options
Galen Charlton [Fri, 23 Sep 2022 18:49:48 +0000 (14:49 -0400)]
Bug 31619: add title back to list of OPACSuggestionMandatoryFields options

This patch fixes a regression introduced by bug 29695 that prevented
setting the title as a required field when setting the
OPACSuggestionMandatoryFields to a non-default value.

To test:

[1] Set OPACSuggestionMandatoryFields in the system preferences
    editor and note that 'title' is not listed in the modal
    that is displayed.
[2] Apply the patch.
[3] Revist the system preference editor and note that 'title'
    is now displayed as an option.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7af9c1c109fd191cc638614e32e5aecd5cbb525a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31649: Fix acquisition basket group CSV export if biblio does not exist
Fridolin Somers [Thu, 29 Sep 2022 06:42:57 +0000 (20:42 -1000)]
Bug 31649: Fix acquisition basket group CSV export if biblio does not exist

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8d933d482ab30efdacb239dfd0af8944f1b6db9f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31649: Fix acquisition basket CSV export if biblio does not exist
Fridolin Somers [Thu, 29 Sep 2022 06:33:26 +0000 (20:33 -1000)]
Bug 31649: Fix acquisition basket CSV export if biblio does not exist

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 28b56098b548b9b198f5a1527714040eef337297)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31649: Add unit tests
Fridolin Somers [Thu, 29 Sep 2022 06:32:58 +0000 (20:32 -1000)]
Bug 31649: Add unit tests

Creates new test file GetBasketGroupAsCSV.t

Test with :
prove t/db_dependent/Acquisition/GetBasketAsCSV.t
prove t/db_dependent/Acquisition/GetBasketGroupAsCSV.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 193d6c48a45316cce9b5d12fa0708f051917cb76)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31685: Replace current_article_requests_count in opac-user
Marcel de Rooy [Wed, 5 Oct 2022 13:45:09 +0000 (13:45 +0000)]
Bug 31685: Replace current_article_requests_count in opac-user

Fixing the "( total)" in the caption of the table.

The tt var should be replaced now by current_article_requests.size.
Note that current_article_requests is an array now (from as_list).
We cannot use .count since it is no Koha object.

Test plan:
Submit a few article requests.
Check OPAC account page, and verify that both totals are fine now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5db216385708d9420a8f8d32bfc35c81cf194d75)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31660: MARC preview for authority search results has hidden contents
Kevin Carnes [Fri, 30 Sep 2022 07:21:25 +0000 (09:21 +0200)]
Bug 31660: MARC preview for authority search results has hidden contents

This patch makes the contents of the MARC preview for authority search
results visible.

To test:
1)  Go to the Authorities page in the staff interface
2)  Click Submit to do a search
3)  Click on Actions to the right of an authority
4)  Select MARC preview
5)  Observe that the modal appears empty
6)  Apply patch
7)  Hold down the shift key when you reload the page, clear the cache,
    or use another web browser
8)  Do another authority search and look at a MARC preview
9)  Observe that the MARC preview contains the MARC record

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6123c2767d4ad2f1e56e667551a8fbcdcd494249)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 20457: Overdue and pre-overdue cronjobs not skipping phone notices
Kyle M Hall [Mon, 25 Mar 2019 18:03:16 +0000 (14:03 -0400)]
Bug 20457: Overdue and pre-overdue cronjobs not skipping phone notices

The overdue and pre-overdue cron scripts are not skipping the generation of phone notices. This causes many phone notices to be created that will always be left at 'pending' as the Talking Tech outbound script creates its own phone notices and puts them in the message queue.

Test Plan:
1) Enable Talking Tech
2) Enable predue and overdue notice phone transports for a patron
3) Generate overdues and predues, notice phone notices are generated
4) Apply the patch
5) Repeat steps 2-3
6) Note phone notices are not generated

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bf6bbc29a0c84581a59624b070cb5747f195ea43)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29671: Dropbox mode is unchecked after check in confirm on item with Materials...
Christophe Torin [Fri, 23 Sep 2022 19:55:37 +0000 (15:55 -0400)]
Bug 29671: Dropbox mode is unchecked after check in confirm on item with Materials specified

Suggested patch

steps to reproduce :

1) Enable System preference CirConfirmItemParts
2) Go to Circulation > Check in
3) Enable Dropbox mode (Book drop mode) in the Checkin settings
4) Enter a barcode of an item having the 'Materials specified' field
   not empty
5) A Popup is shown, click the confirm button
6) The Dropbox mode (Book drop mode) is now unchecked, but should stay
   checked.

In the template, the modal window lacks the dropboxmode input, so that
it stays on the next page. I attached a patch with my suggested correction.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Géraud <geraud.frappier@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e024b6fb5282f057aca3e901162fced3715e7724)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31643: Require only edit_catalogue, not full cataloging
Nick Clemens [Wed, 28 Sep 2022 18:59:41 +0000 (18:59 +0000)]
Bug 31643: Require only edit_catalogue, not full cataloging

To test:
1 - Grant a patron: catalogue, edit_catalogue, and editauthorities permissions
2 - Log in to staff client
3 - Browse to: http://localhost:8081/cgi-bin/koha/svc/cataloguing/automatic_linker.pl
4 - UNAUTHORIZED
5 - Apply patch, restart all
6 - Log in and go to link again
7 - status "OK"

Signed-off-by: Catrina <catrina@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fb1ca3311001b0a7c5b93a54330a9206ff5b41d9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 30944: DBIC
Lucas Gass [Mon, 5 Dec 2022 16:32:47 +0000 (16:32 +0000)]
Bug 30944: DBIC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 30944: DBRev 22.05.07.001
Lucas Gass [Mon, 5 Dec 2022 16:29:38 +0000 (16:29 +0000)]
Bug 30944: DBRev 22.05.07.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 30944: Undo change to ILS-DI documentation
Katrin Fischer [Sun, 2 Oct 2022 10:08:55 +0000 (10:08 +0000)]
Bug 30944: Undo change to ILS-DI documentation

The service not implemented by Koha is CancelRecall
as specified in:
https://old.diglib.org/architectures/ilsdi/DLF_ILS_Discovery_1.0.pdf

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8abc8c4950ae9452242a1b86a22b86748208014b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 30944: Fix cancel recalls actions
Aleisha Amohia [Thu, 11 Aug 2022 05:29:04 +0000 (17:29 +1200)]
Bug 30944: Fix cancel recalls actions

This patch fixes the 'cancel selected recalls' button on the biblio
details Recalls page, and ensures a correct cancellation reason is
logged when cancelling a recall in transit.

To test:
1) Ensure UseRecalls is enabled and relevant recalls circulation rules
are set
2) Check out Item A to Patron B
3) Log into OPAC as Patron A
4) Search for Item A and place a recall
5) Go back to the staff interface and search for Item A. When viewing
the biblio record, go to the recalls tab.
6) Check the checkbox for your recall, and click the button to cancel
selected recalls.
7) Confirm your recall is successfully removed and you're redirected to
the correct recalls page for this biblio.
8) Go back to the OPAC and place a recall again. This time set the
pickup location to a different library, one that you're not logged in at
9) Back in the staff interface, check in Item A and confirm the recall
and transfer
10) Go to Circulation -> Recalls to pull. Your recall should show here.
Click the button to cancel the recall and revert the transfer
11) Confirm the recall has been cancelled
12) Go to Reports and create a new SQL report with the following SQL:
select * from branchtransfers b join items i on
b.itemnumber=i.itemnumber where i.barcode = <<barcode>>
13) Run the report and paste the barcode of Item A in the field
14) Confirm there are two rows returned - the transfer triggered when
the recall was confirmed, with a reason of 'Recall' and a cancellation
reason of 'RecallCancellation, and the transfer sending the item back
home when the recall was cancelled, with a reason of
'RecallCancellation'.

Sponsored-by: Catalyst IT
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ccb4180339544d6700de80b2d9879fdf175b51b9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31559: Compiled CSS
Lucas Gass [Mon, 5 Dec 2022 16:15:48 +0000 (16:15 +0000)]
Bug 31559: Compiled CSS

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31559: Staff results page doesn't always use up full available screen width
Owen Leonard [Mon, 26 Sep 2022 14:07:06 +0000 (14:07 +0000)]
Bug 31559: Staff results page doesn't always use up full available screen width

This patch adds an explicit "width: 100%" to tables which are contained
within a #searchresults <div>. The change affects staff interface
catalog search results and these other pages with the same markup:

- Advanced MARC editor search results
- Holds to pull
- Patron search results

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- Test the catalog search results and other affected pages to confirm
  that the tables affected take up the full width of the page.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cfb6ea48b8240ca3e526fba840c1b40701911329)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 30517: Translation breaks editing parent type circulation rule fix
Shi Yao Wang [Tue, 19 Apr 2022 15:52:42 +0000 (11:52 -0400)]
Bug 30517: Translation breaks editing parent type circulation rule fix

Test plan:
1. Install another language in the staff interface
   1. in commandline: `cd misc/translator/; ./translate install xx-XX`
   2. Check the box of the language in the 'language' system preference
and save
   3. Refresh and you should be able to choose languages
2. Create an item type with a parent
   1. Go to Administration > Item types
   2. Create a new item type or modify an existing one, assigning a parent type (I created a 'Children's books' type and assigned 'Books' as its parent)
3. Create a circulation rule for the parent type (I created All/Books, with 10 checkouts allowed)
4. Create a circulation rule for All/All (I created All/All with 30 checkouts allowed)
5. In English, click on "Edit" next to the parent type rule (All/Books)
--> Note that the item type in the bottom row (the modifiable row) is changed to 'Books (All)'
6. Modify the number of checkouts allowed (e.g. 99)
--> The All/Books rule is modified
7. Switch the interface to the other language
8. Click on "Edit" next to the parent type rule (All/Books)
--> Note that the item type in the bottom row stays on 'All'
9. Modify the number of checkouts allowed (e.g. 88)
--> The All/All rule is modified
10. Apply the patch, translate again and refresh the page
11. Do step 8-9 again and notice it now behaves as it should

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2eccae54eee0316e6eb6f2edc54edce2cd269ebe)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31593: Remove Test::DBIx::Class from Context.t
Marcel de Rooy [Wed, 21 Sep 2022 13:54:54 +0000 (13:54 +0000)]
Bug 31593: Remove Test::DBIx::Class from Context.t

No need to keep it.
Fixing a test description too.

Test plan:
Run t/db_dependent/Context.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 499562f0b80ca705e94581ccef0eebadce1ed6f9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31594: Use count of results for displaying number shown
Nick Clemens [Wed, 21 Sep 2022 14:14:32 +0000 (14:14 +0000)]
Bug 31594: Use count of results for displaying number shown

To test:
1 - Create a report with a number of results that is not a multiple of 20
    SELECT barcode FROM items
2 - Run the report
3 - Go to the final page
4 - Note report says 20 shown, but there are less
5 - Apply patch
6 - Reload and confirm correct number of shown is shown :-)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 926568a4e25628b2138aafaf62c9f4c3b8d4a8c2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31441: Fix Koha::Item::as_marc_field when kohafield = ''
Julian Maurice [Tue, 23 Aug 2022 11:47:56 +0000 (13:47 +0200)]
Bug 31441: Fix Koha::Item::as_marc_field when kohafield = ''

marc_subfield_structure.kohafield can be NULL, but it can also be an
empty string. But in that case, Koha::Item::as_marc_field ignores them,
which means the resulting MARC::Field object has missing data.
This can produce a bug in OPAC ISBD view (and probably other places
where this method is used)

Test plan:
1. Edit the default biblio MARC framework for the item field: find or
   create a subfield that is not linked to a DB column.
   Save even if you made no changes to make sure that
   marc_subfield_structure.kohafield is set to an empty string.
   I'll use 995$Z as an example for the following steps.
2. Add the following to syspref OPACISBD:
    #995|<br>Item:|{995Z}|
3. Create a biblio with an item and put a value into 995$Z
4. Go to the ISBD detail page for this record at OPAC. Confirm that the
   value you entered in 995$Z is not visible
5. Apply patch and restart koha
6. Refresh the ISBD detail page. Confirm that the 995$Z is now visible.
7. Run `prove t/db_dependent/Koha/Item.t`

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 389b9dfaf43e889612990401ab83cc1f75972333)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31540: Exclude expired holds from the reminder job
Nick Clemens [Mon, 12 Sep 2022 14:35:24 +0000 (14:35 +0000)]
Bug 31540: Exclude expired holds from the reminder job

Some libraries don't want to auto-cancel holds, but we should not remind
a patron about a hold which has expired.

To test:
1 - Place a hold for a patron
2 - Set it waiting
3 - Run the holds reminder script in the future
    perl misc/cronjobs/holds/holds_reminder.pl -day 1 --date '2023-09-12' -v
4 - Note the holds would be reminded
5 - Set expirationdate for the hold less than today
    UPDATE reserves SET expirationdate = DATE_SUB(CURDATE(), INTERVAL 1 DAY);
6 - Run the remidner cron again
7 - No holds trigger!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4c3d18091d821af2d9ac7a6178547cc9c478f9de)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31653: Correct event names passed to jQuery on() function
Owen Leonard [Thu, 29 Sep 2022 12:20:30 +0000 (12:20 +0000)]
Bug 31653: Correct event names passed to jQuery on() function

This patch replaces the obsolete .on("hover") with .on("mouseenter
mouseleave"). This will allow the code to work again following the last
jQuery upgrade.

See Bug 20217 for discussion of the original implementation:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20217#c14

To test, apply the patch and go to the staff interface. Hover your mouse
over the "Search" link in the header menu. The adjacent dropdown menu
button should have its hover state triggered.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6a3bded6d3597128bcad3477dbf152abe189eb44)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31412: Add focus to 'name' on SMTP Servers
Isobel Graham [Mon, 12 Sep 2022 16:33:57 +0000 (17:33 +0100)]
Bug 31412: Add focus to 'name' on SMTP Servers

This patch adds the focus class to ensure focus is given to the first form element on the SMTP server entry page.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 44537c58d1ea689c974bdba216b2ae69eac79e5c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoUpdate release notes for the 22.05.07 release v22.05.07
Lucas Gass [Wed, 23 Nov 2022 17:05:45 +0000 (17:05 +0000)]
Update release notes for the 22.05.07 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoIncrement version for 22.05.07 release
Lucas Gass [Wed, 23 Nov 2022 16:56:04 +0000 (16:56 +0000)]
Increment version for 22.05.07 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoTranslation updates for Koha 22.05.07
Koha translators [Wed, 23 Nov 2022 16:40:24 +0000 (13:40 -0300)]
Translation updates for Koha 22.05.07

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32167: [22.05.x] (bug 14860 follow-up) Populate price fields even if no discount...
Nick Clemens [Thu, 10 Nov 2022 19:24:25 +0000 (19:24 +0000)]
Bug 32167: [22.05.x] (bug 14860 follow-up) Populate price fields even if no discount on vendor

On bug 14860 an 'else' was removed, assuming the price fields were set before discount,
this was incorrect. This patch renames the variable and always set the price, only discounting
ecost if a discount, but setting the values even if not

To test:
 0 - Have a vendor with a discount of 0% specified (no discount)
 1 - Export a record from your Koha
 2 - Stage the record for import and match on biblionumber
 3 - Add to a basket in acq from the staged file
 4 - Select the title, and set order price to $10 and do not fill the discount field
 5 - Add the order - note $0 order line
 6 - Repeat with another vendor with a 10% discount and confirm that is correct
 7 - Apply patch
 8 - Repeat 2-4
 9 - Add the order and confirm $10 price
10 - Repeat with discounted vendor, confirm prices are set discounted correctly

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31995: build_holds_queue.pl should check to see if the RealTimeHoldsQueue syspref...
Kyle Hall [Thu, 27 Oct 2022 17:44:59 +0000 (13:44 -0400)]
Bug 31995: build_holds_queue.pl should check to see if the RealTimeHoldsQueue syspref is on [v22.05]

The real time hold queue and the build_holds_queue.pl jobs are not 100% compatible in that we should not be running the cron if the real time queue is enabled, this could lead to double server work. It would be good to have a check in build_holds_queue for the RealTimeHoldsQueue syspref and not run the job if the preference is enabled.

There might be times when we'd want to force a run of this job without changing the syspref. To that end we would also want a flag for this job so that system administrators could force the job from the command line if required, overriding this limitation.

Test Plan:
1) Apply this patch
2) Try run misc/cronjobs/holds/build_holds_queue.pl with the -h/--help and -m/--man options
3) Disable RealTimeHoldsQueue
4) Run with no options, should succeed
5) Enable RealTimeHoldsQueue
6) Run with no options, should display a message and not rebuild the
   holds queue
7) Run again with the -f/--force option, should succeed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 31995: (QA follow-up) Add 'system preference' to help text

We often get asked where something can be found in setting,
adding the hint that RealTimeHoldsQueue is a system preference
is hopefully helpful here.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31296: (QA follow-up) Fix trivial spelling errors
Tomas Cohen Arazi [Mon, 8 Aug 2022 16:15:29 +0000 (13:15 -0300)]
Bug 31296: (QA follow-up) Fix trivial spelling errors

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d673d7efdcdffe425722962336f8dc7f9f8940f0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31296: (QA follow-up) Add to debian templates
Martin Renvoize [Fri, 5 Aug 2022 12:52:46 +0000 (13:52 +0100)]
Bug 31296: (QA follow-up) Add to debian templates

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5a6bd96d4c08a7b566fdc315c3c69e3838f491c4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31296: Add ability to disable demagnetizing items via SIP2 based on itemtypes
Kyle Hall [Fri, 5 Aug 2022 11:14:14 +0000 (07:14 -0400)]
Bug 31296: Add ability to disable demagnetizing items via SIP2 based on itemtypes

Some libraries have certain item types that can only do in house checkouts via SIP self check machines. In these cases, the items should not be demagnetized since the items cannot leave the library.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Message.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 00f489de6d05fd8a5d4c8b4599a72d55e1ee8005)

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