]> git.koha-community.org Git - koha.git/log
koha.git
6 days agoBug 35721: Replace newly introduced ModItemTransfer calls
Martin Renvoize [Mon, 21 Oct 2024 11:42:06 +0000 (12:42 +0100)]
Bug 35721: Replace newly introduced ModItemTransfer calls

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 35721: ModItemTransfer -> Koha::Item->request_transfer - returns.pl
Martin Renvoize [Mon, 8 Jan 2024 12:55:01 +0000 (12:55 +0000)]
Bug 35721: ModItemTransfer -> Koha::Item->request_transfer - returns.pl

This patch replaces the call to ModItemTransfer in circ/returns.pl with
a call to Koha::Item->request_transfer and
Koha::Item::Transfer->transit.

Test plan
1) Set 'AutomaticItemReturn' to "Don't"
2) Check an item in at a location other than it's 'home' or 'holding'
   branch
3) Note you should be asked a about returning the item to another branch
4) Opting to not proceed should NOT result in a row in the
   branchtransfers table
5) Option to proceed (either with a print slip or just 'OK') should
   result in a branchtransfer from the current checkin branch to the
home or holding branch depending on the circulation rules.
5a) The item should be marked as immediately in transit in, i.e. the
   'datesent' set to today.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 38257: Do not use js_includes.inc in two different files
Emmi Takkinen [Mon, 28 Oct 2024 10:03:26 +0000 (12:03 +0200)]
Bug 38257: Do not use js_includes.inc in two different files

Downloading cart didn't work because js_includes.inc file
was included both in basket.tt and intranet-bottom.inc.
This patch removes related codeline from basket.tt.

To test:
1. Search for items and add one or more search results to your cart.
2. Open cart.
3. Attempt to download items from your cart.
=> Either nothing happens.
4. Apply this patch, restart services if needed.
5. Again attempt to download.
=> Download menu should now work as expected.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 38257: Fix cart pop up functionalities
Emmi Takkinen [Thu, 24 Oct 2024 11:57:46 +0000 (14:57 +0300)]
Bug 38257: Fix cart pop up functionalities

Almost all functionalities in cart pop up were broken
due changes made in bug 37033. Also following errors
were displayed in browsers console:

> Uncaught TypeError: antiClickjack is null
> Uncaught TypeError: $(...).dataTable is not a function

This happens because when 'intranet-bottom.inc' is loaded
after other .inc files in page.

To test:
1. Search for items and add one or more search results to your cart.
2. Open cart.
3. Attempt to use one or more functionalities (download, remove item etc.).
=> Either nothing happens or table is loaded again with no items in
table. However items are still displayed in cart when it's opened again.
4. Apply this patch, restart services if needed.
5. Again attempt to download, remove items, print etc. from cart
=> Everything should now work as expected.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 31224: (follow-up) Update instances of metadata->record
Jonathan Druart [Tue, 29 Oct 2024 13:03:25 +0000 (14:03 +0100)]
Bug 31224: (follow-up) Update instances of metadata->record

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 31224: Adapt GET /public/biblios/:biblio_id controller
Tomas Cohen Arazi [Mon, 28 Oct 2024 19:42:08 +0000 (16:42 -0300)]
Bug 31224: Adapt GET /public/biblios/:biblio_id controller

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 31224: Expand coded values using metadata_record in Server.pm
Tomas Cohen Arazi [Mon, 28 Oct 2024 19:26:15 +0000 (16:26 -0300)]
Bug 31224: Expand coded values using metadata_record in Server.pm

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 31224: EmbedItems takes an arrayref
Tomas Cohen Arazi [Mon, 28 Oct 2024 12:53:08 +0000 (09:53 -0300)]
Bug 31224: EmbedItems takes an arrayref

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 31224: Update instances of metadata->record
Martin Renvoize [Tue, 18 Oct 2022 15:46:08 +0000 (16:46 +0100)]
Bug 31224: Update instances of metadata->record

We can now call metadata_record directly on the Koha::Biblio object.

This aptch updates all modules and controllers to use
Koha::Biblio->metadata_record directly where appropriate.  The
exceptions are where we don't require any filtering or the filtering
makes sense to do after the initial fetch.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 31224: Support 'interface' on metadata_record
Martin Renvoize [Tue, 18 Oct 2022 15:44:39 +0000 (16:44 +0100)]
Bug 31224: Support 'interface' on metadata_record

We replace the 'opac' boolean with an 'interface' param here to allow
for ViewPolicy filtering depending on 'opac', 'intranet' or 'nothing'
being passed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 31224: Convert C4::Record::marcrecord2csv
Martin Renvoize [Tue, 18 Oct 2022 15:25:35 +0000 (16:25 +0100)]
Bug 31224: Convert C4::Record::marcrecord2csv

Update marcrecord2csv to user RecordProcessor directly for embedding
listed items.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 31224: Use metadata_record in opac-MARCdetail.pl
Tomas Cohen Arazi [Fri, 22 Jul 2022 20:59:34 +0000 (17:59 -0300)]
Bug 31224: Use metadata_record in opac-MARCdetail.pl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 31224: Add Koha::Biblio->metadata_record
Tomas Cohen Arazi [Fri, 22 Jul 2022 20:42:35 +0000 (17:42 -0300)]
Bug 31224: Add Koha::Biblio->metadata_record

This patch introduces a higher-level method for retrieving a 'prepared'
record for using in specific contexts. In particular, I only focused on
embedding item information and OPAC view filtering. But we could add a
way to get the record through the ViewPolicy also for staff.

The virtue of this patch is that it explains better than my words why I
think having the *embed_items* and *opac* parameters in
Koha::Biblio::Metadata->record is not ideal. And makes the other
implementation feel like is done at the wrong level.

I know it's been done like that to act as a drop-in replacement fro GetMarcBiblio,
which was a good first step. But we need to revisit how it is used, in general, to come
up with a more refined and useful design. So we do not port the same
design problems from C4::* into Koha::*.

Try to think how it would be used in contexts like opac-MARCdetail.pl or
any other OPAC controller script.

Thanks!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 38394: Remove 3 'done'
Jonathan Druart [Thu, 7 Nov 2024 14:28:42 +0000 (15:28 +0100)]
Bug 38394: Remove 3 'done'

We don't want that, and it's not consistent with the other outputs.
If we don't have anything useful to say, don't say anything.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 38394: Remove existing try/catch and say_failure from DB revs
Jonathan Druart [Thu, 7 Nov 2024 14:10:01 +0000 (15:10 +0100)]
Bug 38394: Remove existing try/catch and say_failure from DB revs

On bug 37895 we have failed to propose a solution to encapsulate exceptions and rethrow them.

Until this is ready we should not try/catch and so use say_failure from our DB revs.

We want to stop the DB update process when something is wrong. In those
try/catch we are actually continuing even if something bad happens.

As RaiseError is set on the dbh, say_failure statements will never be
reached.

Test plan:
checkout origin/24.05.0
reset_all
checkout main + this patch
updatedatabase

Everything should run fine.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 22223: t::lib::QA::TemplateFilters missing built-in TT filter "safe_url" causes...
David Cook [Thu, 7 Nov 2024 01:37:14 +0000 (01:37 +0000)]
Bug 22223: t::lib::QA::TemplateFilters missing built-in TT filter "safe_url" causes false warnings

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 22223: Add filter to make item URLs safe in template output
David Cook [Tue, 20 Aug 2024 00:12:21 +0000 (00:12 +0000)]
Bug 22223: Add filter to make item URLs safe in template output

This change adds a "safe_url" filter which takes a text input and
returns a Perl URL object which stringifies to a safe URL.

This change is only needed in the OPAC as the staff interface
handles the item URL display using Javascript not Template Toolkit.

0. Apply patch and koha-plack --restart kohadev
1. Create an item for a record using the following URL
https://koha-community.org?url=https%3A%2F%2Fkoha-community.org
2. Go to the OPAC for that record and verify that the URL is
not double-escaped
3. Create a malicious payload (talk to QA/security team for this if necessary)
4. Note that the malicious payload is escaped
5. prove t/Koha/Plugins/SafeURL.t
6. Celebrate!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 33484: Redraw columns filters when column visibility is modified - Vue
Jonathan Druart [Thu, 7 Nov 2024 13:33:20 +0000 (14:33 +0100)]
Bug 33484: Redraw columns filters when column visibility is modified - Vue

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 36822: DBRev 26.04.00.056
Katrin Fischer [Thu, 7 Nov 2024 14:27:36 +0000 (14:27 +0000)]
Bug 36822: DBRev 26.04.00.056

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 36822: (QA follow-up): Fix now time in tests
Pedro Amorim [Mon, 4 Nov 2024 11:32:34 +0000 (11:32 +0000)]
Bug 36822: (QA follow-up): Fix now time in tests

This is to prevent the scenario of tests failing if they take long to run, e.g.:

    #   Failed test 'updated_on correctly saved on newly created user'
    #   at t/db_dependent/Auth_with_shibboleth.t line 317.
    #     Structures begin differing at:
    #          ->[0] = '2024-11-04 11:20:13'
    #     ->[0] = '2024-11-04 11:20:14

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 36822: atomicupdate
Pedro Amorim [Tue, 29 Oct 2024 13:14:54 +0000 (13:14 +0000)]
Bug 36822: atomicupdate

Fix any existing updated_on issues

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 36822: LDAP - Add discard_changes
Pedro Amorim [Fri, 25 Oct 2024 14:41:56 +0000 (14:41 +0000)]
Bug 36822: LDAP - Add discard_changes

Test plan:
1) Apply only LDAP rearrangement patch
2) Run that test file (to prove the rearrangement does not break tests):
$ prove t/db_dependent/Auth_with_ldap.t
3) Verify tests pass
4) Apply LDAP test patch on top
5) Run the test file. Notice it fails.
6) Apply this patch. Run LDAP tests again. Verify tests pass.

Co-authored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 36822: LDAP - Add test
Pedro Amorim [Fri, 25 Oct 2024 14:41:38 +0000 (14:41 +0000)]
Bug 36822: LDAP - Add test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 36822: LDAP - Rearrange Auth_with_ldap.pm so it picks up on mock config from...
Pedro Amorim [Fri, 25 Oct 2024 14:38:09 +0000 (14:38 +0000)]
Bug 36822: LDAP - Rearrange Auth_with_ldap.pm so it picks up on mock config from test file

Without this rearrangement, C4::Context->config('useldapserver') is always 0.
It seems that because its inside a BEGIN block, the mock coming from .t file does not get picked up

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 36822: Shibboleth - Add discard_changes
Pedro Amorim [Fri, 25 Oct 2024 14:36:23 +0000 (14:36 +0000)]
Bug 36822: Shibboleth - Add discard_changes

Test plan:
1) Apply only Shibboleth tests patch
2) Run that test file:
$ prove t/db_dependent/Auth_with_shibboleth.t
3) Verify tests fail with the updated_on error message.
4) Apply this patch. Repeat 2) Verify tests now pass.

Co-authored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 36822: Shibboleth - Add tests
Pedro Amorim [Fri, 25 Oct 2024 14:35:39 +0000 (14:35 +0000)]
Bug 36822: Shibboleth - Add tests

prove t/db_dependent/Auth_with_shibboleth.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
6 days agoBug 37872: Consider enable_plugins = 0 when fetching plugin backends
Pedro Amorim [Tue, 29 Oct 2024 11:12:04 +0000 (11:12 +0000)]
Bug 37872: Consider enable_plugins = 0 when fetching plugin backends

This patch builds on top of Andreas patch checking for Koha::Plugins->new() instead as the enable_plugins is already done there.
It also adds a check in reply to Joubu's observation, which is indeed an additional bug.

Test plan:
1) Apply tests patch. Run the tests. Notice it fails
2) Apply the remaining patches. Run the tests. Notice they pass.

Additional (and better) tests can be written, but for now I think this is good enough.
Additional tests should be written on top of bug 36197 (which adds a dummy ILL backend plugin for testing), at:
https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=36197&attachment=171371

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
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>
6 days agoBug 37872: Add guards for enable_plugins
Andreas Jonsson [Mon, 9 Sep 2024 16:51:10 +0000 (16:51 +0000)]
Bug 37872: Add guards for enable_plugins

There are ILL-backends that are not implemented as
Koha plugins and does not require plugins to be enabled.

The 'new' method in Koha::Plugins returns undefined if
plugins are disabled.  Therefore, calls to this method
must be guarded by a check that plugins actually are enabled.

Testplan for koha-testing-docker:

- Edit /etc/koha/sites/kohadev/koha-conf.xml and disable plugins by
  setting <enable_plugins>0</enable_plugins>
- sudo koha-mysql kohadev -e "UPDATE systempreferences SET value='1' WHERE variable='ILLModule';"
- Run restart_all.
- In staff interface, go to About koha -> System information. The page
  should load normally (as opposed to returning 500 internal server
  error).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
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>
6 days agoBug 37872: Add tests
Pedro Amorim [Tue, 29 Oct 2024 11:12:25 +0000 (11:12 +0000)]
Bug 37872: Add tests

$ prove t/db_dependent/Koha/ILL/Request.t
$ prove t/db_dependent/Koha/ILL/Request/Config.t

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
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>
6 days agoBug 38128: Fix cypress test
Jonathan Druart [Thu, 7 Nov 2024 10:58:40 +0000 (11:58 +0100)]
Bug 38128: Fix cypress test

We were mocking the wrong route.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
8 days agoBug 33484: (follow-up) checkouts - Move visibility handling to table_setting
Jonathan Druart [Tue, 5 Nov 2024 15:20:15 +0000 (16:20 +0100)]
Bug 33484: (follow-up) checkouts - Move visibility handling to table_setting

table_settings_issues_table must be defined before we include
checkouts.js

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
9 days agoBug 38305: Can't delete or archive suggestions
Owen Leonard [Wed, 30 Oct 2024 17:41:45 +0000 (17:41 +0000)]
Bug 38305: Can't delete or archive suggestions

This patch corrects JS on the suggestions page so that the delete,
archive, and unarchive controls work.

The patch also modifies the markup of the "Delete" button so that it is
consisten with other pages.

To test, apply the patch and go to the suggestions page in the staff
interface.

- Log in to the staff interface as a user with "suggestions_manage"
  permission.
- If necessary, create a few suggestions to test with.
- From the table of suggestions, click the secondary menu on the "Edit"
  button for one of the suggestions.
  - Choose "Delete." You should get a confirmation dialog. Both the "OK"
    and "Cancel" options should work as expected.
  - Choose "Archive." There won't be a confirmation, and the title
    should disappear from the list.
    - To test whether the suggestion was archived, search for it using
      the sidebar form, checking the "Include archived" checkbox. The
      suggestion should show up in the list with an "Archived" label.
    - Clicking the "Edit" secondary menu on the archived suggestion
      should trigger a menu with an "Unarchive" option. Click that
      and confirm that the suggestion is no longer archived.
- Now log in as a user with only "suggestions_delete" permission but not
  "suggestions_manage"
  - In the list of suggestions each title should have a "delete" button.
    - Clicking the delete button should trigger a confirmation dialog.
      Both the "OK" and "Cancel" options should work as expected.

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
9 days agoBug 38175: (follow-up) Quiet warnings in tests
Martin Renvoize [Mon, 4 Nov 2024 13:08:06 +0000 (13:08 +0000)]
Bug 38175: (follow-up) Quiet warnings in tests

We weren't passing the required data into the FKConstraint exception,
this patch passes biblio_id and value as required.

12 days agoBug 35659: Use TableExists
Tomas Cohen Arazi [Fri, 1 Nov 2024 21:11:42 +0000 (18:11 -0300)]
Bug 35659: Use TableExists

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 days agoBug 35906: (QA follow-up) Remove use of IF NOT EXISTS
Tomas Cohen Arazi [Fri, 1 Nov 2024 21:06:08 +0000 (18:06 -0300)]
Bug 35906: (QA follow-up) Remove use of IF NOT EXISTS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 days agoBug 37392: Fix API helpers testsa
Tomas Cohen Arazi [Fri, 1 Nov 2024 19:25:58 +0000 (16:25 -0300)]
Bug 37392: Fix API helpers testsa

This patch acknowledges the fact this patchset changed the called method
`libraries_where_can_see_patrons` for `libraries_where_can_see_things`.
And as such the mock was not working.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 days agoBug 37392: (follow-up) Limit a borrower not in a group and fix tests
Nick Clemens [Fri, 1 Nov 2024 11:35:04 +0000 (11:35 +0000)]
Bug 37392: (follow-up) Limit a borrower not in a group and fix tests

The previous patches took into account all the groups for a patron, but missed the case where a patron
didn't have permission to see outside their library, and their library is not in a group.

Code updated and a test added.

Other tests adjusted to ensure the feature to limit patrons was set in those groups.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 days agoBug 33462: Add new system preference to sysprefs.sql
Tomas Cohen Arazi [Fri, 1 Nov 2024 11:36:29 +0000 (08:36 -0300)]
Bug 33462: Add new system preference to sysprefs.sql

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 days agoBug 33462: (QA follow-up) Adapt API spec
Tomas Cohen Arazi [Fri, 1 Nov 2024 11:13:49 +0000 (08:13 -0300)]
Bug 33462: (QA follow-up) Adapt API spec

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 days agoBug 33462: (QA follow-up) Fix sequence of columns for categories table in kohastructu...
Katrin Fischer [Thu, 31 Oct 2024 12:19:15 +0000 (12:19 +0000)]
Bug 33462: (QA follow-up) Fix sequence of columns for categories table in kohastructure.sql

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 33462: (QA follow-up) Adjust number of tests
Katrin Fischer [Thu, 31 Oct 2024 11:52:13 +0000 (11:52 +0000)]
Bug 33462: (QA follow-up) Adjust number of tests

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 33462: DBRev 24.06.00.055
Katrin Fischer [Thu, 31 Oct 2024 11:47:44 +0000 (11:47 +0000)]
Bug 33462: DBRev 24.06.00.055

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 33462: (QA follow-up) Tidy code
Kyle M Hall [Thu, 26 Sep 2024 20:08:07 +0000 (16:08 -0400)]
Bug 33462: (QA follow-up) Tidy code

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 33462: DBIC schema update
Lucas Gass [Tue, 17 Sep 2024 17:35:46 +0000 (17:35 +0000)]
Bug 33462: DBIC schema update

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 33462: (Follow up) Fix Perl Tidy
Sam Lau [Fri, 7 Jun 2024 19:26:51 +0000 (19:26 +0000)]
Bug 33462: (Follow up) Fix Perl Tidy

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 33462: Unit Tests
Sam Lau [Fri, 7 Jun 2024 19:01:03 +0000 (19:01 +0000)]
Bug 33462: Unit Tests

prove t/db_dependent/Koha/Patron/Category.t
prove t/db_dependent/Koha/Patron.t

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 33462: Add ability to force password change for new patrons entered by staff
Sam Lau [Fri, 7 Jun 2024 18:44:54 +0000 (18:44 +0000)]
Bug 33462: Add ability to force password change for new patrons entered by staff

This patch attempts to force a password change for new staff created patrons.
This is done by setting the password_expiration_date to an expired date when
adding a new patron. This patch adds a new system preference
'ForcePasswordResetWhenSetByStaff' and a new column to the categories table
'force_password_reset_when_set_by_staff.

To test:
1) Apply patch, restart_all, updatedatabase, and also be sure to update schema.
2) Visit Administration->Sytem Preferences and search for 'EnableExpiredPasswordReset'.
   Make sure this is set to enable. Now search for  'ForcePasswordResetWhenSetByStaff'.
   This should be defaulted to 'Don't force'.
3) Keep that tab open and visit Administration->Patron categories. Click on edit
   on the Board category. Noitce that there is a now a 'Force new patron password reset'
   section. Notice that the by default, this is set to follow the
   ForcePasswordResetWhenSetByStaff system preference (currently set to don't force).
   Click on the dropdown and change it to 'Force'. Save changes
4) Click on the Patrons tab to visit members-home.pl and then click 'New Patron'.
   Select on Patron. Fill in the required information and also enter a password.
5) Submit this form and notice that the patron's password expiration date is set
   to never. This should be the case because the default for 'Force new patron
   password reset' follows the sys. pref. which is still set to 'Don't force' (You
   could have some expiry date in this step, but it should at least be set to a
   date that is not expired. this depends on whether or not you have a defalut
   password expiration date set in patron categories )
6) Log into the OPAC with this patron and notice it works as expected and log in
   was successful.
7) Go back to the patron home page and click to add a new patron. This time select
   'Board'. Once again fill out the required info, enter a password, and then save
   the form.
8) Notice that for this patron, the password expiration date is set for today's
   date. This is because we changed the setting for the 'Board' patron category to
   force.
9) Log into the OPAC with this patron. You should be redirected to a page with an
   error that says: "It's your first login! You need to reset your password." Click
   on the reset password link below this message.
10) You should be sent to a page where you can reset your password. Fill in the
    form and click 'Update password'. Attempt to sign into the OPAC with this new
    password. Everything works as expected.
11) Go back to the staff interface and view this patron's detail page. Notice the
    password expiration date is now set to what the default is in the patron
    category.
12) Edit this patrons information and set their password expiration date to
    yesterday. Go back to the OPAC and try to sign in with this patron again. Note
    that this time, you are also redirected but the message says "Error: Your
    password has expired!"
13) Go back to the staff interface and visit the sys. pref tab we left open. Set
    it to the 'Force' option and save changes.
14) Visit the patron home page and click add patron, now select the patron
    category again. Fill in required info and enter password. Submit form and note
    that the patron's password expiration date is set to today. Try to login to
    the OPAC with this patron, you should be redirected to the page with the error
    that says "Error: It's your first login! You need to reset your password."
15) Sign-off :)

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 33462: Manual Schema Changes (define as boolean)
Sam Lau [Fri, 21 Jun 2024 17:51:56 +0000 (17:51 +0000)]
Bug 33462: Manual Schema Changes (define as boolean)

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 33462: DB Updates
Sam Lau [Thu, 6 Jun 2024 18:52:13 +0000 (18:52 +0000)]
Bug 33462: DB Updates

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: (QA follow-up) Remove unused variable definitions
Katrin Fischer [Thu, 31 Oct 2024 10:32:02 +0000 (10:32 +0000)]
Bug 35570: (QA follow-up) Remove unused variable definitions

 FAIL Koha/ILL/Backend/Standard.pm
   FAIL   critic

"$marc_isbn" is declared but not used at line 1179, column 5. Unused variables clutter code and make it harder to read.
"$marc_author" is declared but not used at line 1180, column 5. Unused variables clutter code and make it harder to read.
"$marc_title" is declared but not used at line 1181, column 5. Unused variables clutter code and make it harder to read.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 29079: Add author and publication details columns to holds queue
Lucas Gass [Mon, 17 Jun 2024 16:41:37 +0000 (16:41 +0000)]
Bug 29079: Add author and publication details columns to holds queue

To test:
1. Apply patch, restart_all
2. Add some holds and run the holds queue builder.
3. Go to the holds queue.
4. You should see less information in the 'Title' field.
5. You should see an 'Author' column, make sure it is sortable and the data is correct.
6. You should see a 'Publication details' column, that should also be sortable. Make sure the data is correct.
7. Each column, and all other in the holds queue table, should be column configurable via Table Settings.
8. Make sure you hide/show columns via Table settings.
9. Make sure the data can be exported correctly via tha Export button.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 38288: Fallback to Standard if FreeForm
Pedro Amorim [Tue, 29 Oct 2024 14:37:52 +0000 (14:37 +0000)]
Bug 38288: Fallback to Standard if FreeForm

A regular openURL works fine:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?backend=Standard&title=Koha%20is%20cool&method=create&genre=article&openurl=1

Problem is existing third-party systems may be linking to Koha using FreeForm, not Standard

Test plan:
1) Access the OPAC URL from above.
2) Notice it works.
3) Replace the word 'Standard' with 'FreeForm'. It no longer works.
4) Apply patch. Repeat.

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>
13 days agoBug 38276: Add DOI to openURL
Pedro Amorim [Fri, 25 Oct 2024 15:54:49 +0000 (15:54 +0000)]
Bug 38276: Add DOI to openURL

Test plan:
1) Enable ILLModule
2) Login on OPAC (if you haven't already)
3) Access the following openURL link:
localhost:8080/cgi-bin/koha/opac-illrequests.pl?atitle=Music%20in%20an%20Emergent%20History%20of%20Psychology.&aulast=Klempe%20SH&backend=Standard&cardnumber=kohaadmin&custom_field=example1&date=2024&doi=10.1007%2Fs12124-023-09778-9&genre=article&issn=19363567&issue=1&custom_field2=example2&method=create&opac=1&openurl=1&pages=1-11&spage=1&title=Integrative%20psychological%20%26%20behavioral%20science&volume=58
4) Notice the DOI is considered a custom field, and the actual DOI native field is not populated.
5) Apply patch. Repeat 4. Notice the native field is populated and is no longer a custom field entry.

Original patch:
https://github.com/PTFS-Europe/koha-ill-freeform/commit/6f00282af427aae632c274e647ef0d61a78fd819

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>
13 days agoBug 35725: Fix 'Create' button enabled/disabled
Pedro Amorim [Mon, 8 Jan 2024 16:56:06 +0000 (16:56 +0000)]
Bug 35725: Fix 'Create' button enabled/disabled

The previous patch fixed what it stated, but uncovered a new issue:
If you input a cardnumber + a branchcode and then change type, the 'Create' button becomes disabled
This happens because the trigger for it is on change only, the current patch updates this to also happen
on DOMContentLoaded.

Test plan:
1) Apply previous patch
2) Do steps from previous patch plan up to and including step 5)
3) Click 'Create'. Notice it doesn't submit (nothing happens).
4) Apply this patch and do a hard reload (clearing browser js cache)
5) Repeat steps 1) to 3). Notice it now submits correctly.

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>
13 days agoBug 35725: Keep cardnumber and library data when changing request type
Pedro Amorim [Mon, 8 Jan 2024 14:43:43 +0000 (14:43 +0000)]
Bug 35725: Keep cardnumber and library data when changing request type

Test plan:
1) Apply 35570
2) Enable ILLModule sys pref through UI, or run:
   echo "update systempreferences set value = 1 where variable = \"ILLModule\";" | koha-mysql kohadev
3) Create a new Standard request, visit:
   http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
4) Input a cardnumber and/or set a library at the bottom under "Patron options".
5) Change the type (top of the form). Notice the data from step 4) is gone.
6) Apply patch. Repeat test plan and notice data is kept when changing request type.

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>
13 days agoBug 38020: (QA follow-up) Decapitilise 'list'
Aleisha Amohia [Thu, 31 Oct 2024 05:01:42 +0000 (05:01 +0000)]
Bug 38020: (QA follow-up) Decapitilise 'list'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 38020: (follow-up) Remove unused delete confirmation code
Yanjun Li [Wed, 30 Oct 2024 16:21:06 +0000 (16:21 +0000)]
Bug 38020: (follow-up) Remove unused delete confirmation code

This follow-up patch removes the unused delete list confirmation dialog in virtualshelves/shelves.tt

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 38020: Change form to submit link
Yanjun Li [Thu, 24 Oct 2024 20:51:12 +0000 (20:51 +0000)]
Bug 38020: Change form to submit link

To test:

1. Create a list in the staff interface
2. Go to lists
3. View the list
4. Click the Edit dropdown
5. Notice the two dropdown options for Edit list and Delete list have different formatting and look different
6. Apply patch
7. Try steps 1 through 4 again
8. The delete list button form looks right, and delete function works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 38132: Add data-isbn to shelfbrowser
Matt Blenkinsop [Wed, 9 Oct 2024 15:00:33 +0000 (15:00 +0000)]
Bug 38132: Add data-isbn to shelfbrowser

This patch adds a data-isbn attribute to the shelfbrowser_cover container for use in plugins

Test plan
1) View the patch diff and confirm that the attribute has been correctly added

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>
13 days agoBug 38297: Add a permissions check to the New vendor button
Matt Blenkinsop [Wed, 30 Oct 2024 11:46:05 +0000 (11:46 +0000)]
Bug 38297: Add a permissions check to the New vendor button

Test plan:
1) Choose a staff patron and make sure they have permissions to log
   into the staff interface
2) Ensure that the patron does not have the vendors_manage permission
   but give them one other acquisitions permission so that they can see
   the link on the homepage (e.g. budget_manage)
3) In an incognito browser, log in with that patron and go to the
   acquisitions homepage
4) The New vendor button will be visible
5) Click on it and fill in the required fields. Submit the form and it
   will error for lack of permissions
6) Apply patch
7) Return to the acquisitions page and the New vendor button should no
   longer be visible
8) Back in your main browser, give the patron the vendors_manage
   permission and then refresh the incognito window - the button should
   be visible

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 38303: Set item's replacement price to defaultreplacecost if 0.00
Jonathan Druart [Wed, 30 Oct 2024 15:37:36 +0000 (16:37 +0100)]
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00

No idea if this is a real bug. This code is fixing the following test
failure:
t/db_dependent/Circulation/CalcFine.t .. 1/7
    #   Failed test 'Amount is calculated correctly'
    #   at t/db_dependent/Circulation/CalcFine.t line 271.
    #          got: '0'
    #     expected: '6'
    # Looks like you failed 1 test of 2.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 38304: Remove SaveState options for OPAC tables
Jonathan Druart [Wed, 30 Oct 2024 15:55:34 +0000 (16:55 +0100)]
Bug 38304: Remove SaveState options for OPAC tables

On /admin/columns_settings.pl you can select the two options related to SaveState for the OPAC tables, but those tables do not show the filters and column filters. Also the work on bug 33484 is not implemented at the OPAC

  Save configuration state on page change:
  Save search state on page change:

We could remove those options for those tables to remove ambiguity.

Test plan:
Go the the table settings and open the "OPAC" tab.
Notice that the options are no longer displayed (but they are still for
the other tabs)
Modify some settings
Save and confirm the settings have been correctly saved.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 38293: (alternate) Fix setting branch-level JS and CSS
David Cook [Tue, 29 Oct 2024 23:10:22 +0000 (23:10 +0000)]
Bug 38293: (alternate) Fix setting branch-level JS and CSS

Test plan:
1. Apply the patch
2. Go to http://localhost:8081/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=CPL
3. Scroll to bottom of the page and click "Edit" then "Collapse" next
   to Specific OPAC JS and Specific OPAC CSS

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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>
13 days agoBug 33188: Remove warning from Koha::Item->hidden_in_opac
Jonathan Druart [Tue, 29 Oct 2024 13:41:19 +0000 (14:41 +0100)]
Bug 33188: Remove warning from Koha::Item->hidden_in_opac

"Use of uninitialized value in string eq"

Test plan:
  prove t/db_dependent/Koha/Item.t
should return green

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: tidied the tests (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: Fix version on about page
Katrin Fischer [Thu, 31 Oct 2024 06:47:06 +0000 (06:47 +0000)]
Bug 35570: Fix version on about page

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: DBRev 24.06.00.054
Katrin Fischer [Thu, 31 Oct 2024 06:45:23 +0000 (06:45 +0000)]
Bug 35570: DBRev 24.06.00.054

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: (QA follow-up): Update UNIMARC author to 200$f
Pedro Amorim [Wed, 16 Oct 2024 10:45:51 +0000 (10:45 +0000)]
Bug 35570: (QA follow-up): Update UNIMARC author to 200$f

Reworked the logic here a bit to ensure the following scenario for UNIMARC:
If both title and author exist, the result is:
200$aTitle$fAuthor

In the previous logic, it would become:
200$aTitle
200$fAuthor

I'm assuming the desired result is the former and not the latter.
Test following the same test plan, but try having only author, or only title, and verify that the resulted MARC data is as expected.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: (QA follow-up): Fix DVD type
Pedro Amorim [Wed, 16 Oct 2024 09:56:20 +0000 (09:56 +0000)]
Bug 35570: (QA follow-up): Fix DVD type

I've added some DVD specific fields: language, format, genre, studio.
Happy to have this discussed and/or updated but hoping this is good enough for now.
To test:
1) Create an ILL request of 'DVD' type on both OPAC and Staff
2) Verify the form is shown without issues
3) Fill all fields and verify all fields are stored and shown correctly on both OPAC and STaff

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: Revert some strings translatability
Tomas Cohen Arazi [Tue, 15 Oct 2024 14:36:32 +0000 (11:36 -0300)]
Bug 35570: Revert some strings translatability

This patch reverts making core field descriptions translatable. It was
an obvious move and a needed one. But it turns out our core templates
are using those keys ('Author' and 'Title' in particular) and as such
translating them would break display (at least in the OPAC). Without
this patch, the ILL requests table in the OPAC doesn't display the title
and author columns values (i.e. displays 'N/A' instead)

Added a FIXME in the code, and will file a bug soo we fix this properly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: Do not unbless iterator
Tomas Cohen Arazi [Mon, 14 Oct 2024 14:36:22 +0000 (11:36 -0300)]
Bug 35570: Do not unbless iterator

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: Use ->extended_attributes()
Tomas Cohen Arazi [Mon, 14 Oct 2024 14:30:53 +0000 (11:30 -0300)]
Bug 35570: Use ->extended_attributes()

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: Make strings in Standard.pm translatable
Tomas Cohen Arazi [Mon, 14 Oct 2024 14:23:15 +0000 (11:23 -0300)]
Bug 35570: Make strings in Standard.pm translatable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: (QA follow-up) Tidy
Tomas Cohen Arazi [Mon, 14 Oct 2024 13:51:27 +0000 (10:51 -0300)]
Bug 35570: (QA follow-up) Tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: (QA follow-up): Standard backend: Biblio creation: Add UNIMARC support
Pedro Amorim [Mon, 30 Sep 2024 10:08:44 +0000 (10:08 +0000)]
Bug 35570: (QA follow-up): Standard backend: Biblio creation: Add UNIMARC support

Add FreeForm UNIMARC enhancement from https://github.com/PTFS-Europe/koha-ill-freeform/commit/5d07c68f8058a9a1f35e3193699605240741ff0c into this work.
This is to keep this work up to date with latest FreeForm's work.

To test, k-t-d:
1) (Skip if using sandboxes) Start off by ensuring this is a UNIMARC installation, run:
$ reset_all_unimarc
2) (Skip if using sandboxes) Apply this bug 35570
3) Create a new Standard ILL request:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) Select type: book, input different values for title+author+isbn (the remaining fields are optional
   for this test)
5) Put in a cardnumber ('42' is kohaadmin if k-t-d/sandboxes). Select any library.
   Click 'Create'.
6) You should now see the ILL request details page. Click on the
   'Bibliographic record ID' link.
7) Ensure the newly created biblio record has the title+author+isbn from
   the metadata originally submitted.

Raised by Sonia Bouis at KohaCon's 2024 ILL workshop

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: (QA follow-up): Rebase on final state of bug 35681
Pedro Amorim [Wed, 22 May 2024 14:40:28 +0000 (14:40 +0000)]
Bug 35570: (QA follow-up): Rebase on final state of bug 35681

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF
Pedro Amorim [Thu, 7 Mar 2024 11:19:39 +0000 (11:19 +0000)]
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/6a37ce0daba8aab13130dacd055c9ca5876b7df4 into this work.
This is to keep this work up to date with latest FreeForm's fixes.

The test plan to demonstrate the issue this patch fixes:
Test plan, k-t-d:

1) Install FreeForm, enable ILL module, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) You'll have to switch the FreeForm branch to the one compatible with this work, i.e.:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout b_36243
3) Restart plack:
koha-plack --restart kohadev
4) Go to OPAC ILL requests, login and visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl
5) Click "Create new request"
6) Change the 'type'. Notice you get a 403 error. Logs say:
Programming error - op 'add_form' must start with 'cud-' for POST
7) Apply patch. Restart plack. Repeat 6)
8) Notice the change type works as expected. Click "Create".
9) Notice the request is created as expected.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility
Pedro Amorim [Thu, 7 Mar 2024 10:46:48 +0000 (10:46 +0000)]
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/c34be16ba34c840193ed5e043e6736fa0b1cb646 into this work.
This is to keep this work up to date with latest FreeForm's fixes.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
13 days agoBug 35570: (QA follow-up): Standard backend: Show appropriate error message when...
Pedro Amorim [Wed, 3 Jan 2024 12:06:47 +0000 (12:06 +0000)]
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing

Add FreeForm fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/9c9da5ff2815fb6ce0af0181341dea5ce8c3bb2e into this work.
This is to keep this work up to date with latest FreeForm's fixes.
See bug 35685 for context and test plan.

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>
13 days agoBug 35570: (QA follow-up): Follow QA script on Standard backend
Pedro Amorim [Fri, 15 Dec 2023 16:20:58 +0000 (16:20 +0000)]
Bug 35570: (QA follow-up): Follow QA script on Standard backend

Make QA script green, fix:
- Variables declared in condition
- Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840)
- missing_filter
- forbidden pattern: Do not use line breaks inside template tags (bug 18675)
- Attribute type should not be used for script tags (bug 20053)
- File must have the exec flag
- forbidden pattern: trailing space char
- valid_template: /shared-includes/custom_fields.inc: not found

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>
13 days agoBug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed
Pedro Amorim [Fri, 15 Dec 2023 16:07:37 +0000 (15:07 -0100)]
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed

Test plan:
1) This patch should not be applied in order to be able to go through the previous patch's test plan
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Please note that you need to be using FreeForm's reorganize_ILL branch at:
https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/
4) Visit ILL page:
/cgi-bin/koha/ill/ill-requests.pl
5) Notice there's a configuration error preventing the use of the ILL module.
6) Click the 'about page' link and verify there is a warning about
   FreeForm
7) Remove FreeForm from /kohadevbox/koha/Koha/Illbackends and refresh the page
8) Repeat 4), notice the requests are listed as expected and you can now
   use the ILL module again.

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>
13 days agoBug 35570: Atomicupdate
Pedro Amorim [Fri, 15 Dec 2023 13:12:27 +0000 (13:12 +0000)]
Bug 35570: Atomicupdate

Move stuff out of 'FreeForm' into 'Standard'

This atomicupdate will printout the changes it made, if any.
It will also print out the report IDs of reports that may contain occurrences of 'FreeForm'.
This is to give the sys admin the chance to fix those reports before users.

To test, empty k-t-d:
1) Run updatedatabase, notice nothing happens
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new 'FreeForm' ILL batch (requires a metadata enrichment plugin like https://github.com/PTFS-Europe/koha-plugin-api-pubmed)
4) Add '123' to the pubmedid list of identifiers and finish creating the batch
5) Upon creating the batch, you will now have 1 request, 1 batch and a few illrequestattributes in the 'FreeForm' backend
6) Run the updatedatabase again, notice the print outs.
7) Create a saved sql report like:
'Select * from illrequests where backend="FreeForm";'
8) Run the updatedatabase again, notice you get a warning for the above report

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>
13 days agoBug 35570: Consider 'Standard' core backend
Pedro Amorim [Fri, 15 Dec 2023 12:53:25 +0000 (12:53 +0000)]
Bug 35570: Consider 'Standard' core backend

Added File::Basename qw( dirname )
Sorted Koha:: dependencies alphabetically
DRYed load_backend a bit and included 'Standard' backend check

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>
13 days agoBug 35570: Put 'FreeForm' backend into core as 'Standard'
Pedro Amorim [Fri, 15 Dec 2023 12:51:43 +0000 (12:51 +0000)]
Bug 35570: Put 'FreeForm' backend into core as 'Standard'

FreeForm copied as is from HEAD 369dffb159f1e70162b685b473dcf26c76f7e7e7
At https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/

Only edits made were 'freeform' -> 'standard' in the markup of the .inc files
and some occurrences of FreeForm in Standard.pm (previous Base.pm) file.

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>
2 weeks agoBug 14787: Fix tidying issue in circulation.pl
Matt Blenkinsop [Wed, 12 Jun 2024 09:03:38 +0000 (09:03 +0000)]
Bug 14787: Fix tidying issue in circulation.pl

There are large blocks of code in circulation.pl that are incorrectly indented. This means any new code placed within those blocks fails the QA tests as it automatically adds new untidy lines. This patch tidies the file to remove this issue and start from a clean position in terms of tidyness.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 14787: Remember confirmations for a patron session
Matt Blenkinsop [Wed, 12 Jun 2024 08:59:54 +0000 (08:59 +0000)]
Bug 14787: Remember confirmations for a patron session

This patch adds functionality that will remember whether an action has been confirmed for a particular patron for the session. While carrying out an action on that patron, if the same checkout confirmation message keeps appearing the user can now select to remember their confirmation while they are still working on that patron. When the user moves onto a new patron the confirmations then reset and accumulate again for the new patron.

Test plan:
We're going to use rental fees as the example to prompt the checkout confirmation dialog. If you wish to use something else to test then feel free, it should work the same. Do not use patron debts though, as we already track a confirmation for this elsewhere and the test plan will appear to fail when in fact it is behaving as expected

1) In system preferences set RentalFeesCheckoutConfirmation to 'ask'
2) Choose a patron and checkout an item to that patron that incurrs a rental charge (in KTD this will be any item that does not have an itype of 'BK', 'REF' or 'VM'
3) A dialog should display asking you to confirm the checkout.
4) There should be a checkbox on the dialog to "Remember for the session for this patron"
5) Click Yes, checkout out without checking this checkbox
6) Select another item and checkout - the dialog should display again
7) This time, check the checkbox and click Yes, check out
8) Checkout another item (depending on your fines limit settings, you may need to pay the rental charges before the system will allow you to checkout again so go ahead and do this)
9) This time the dialog should not appear as the system has remembered our confirmation for this patron for the session
10) Choose a new patron
11) Repeat steps 2 - 9
12) It should work as outlined above
13) Sign off!

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 30648: DBIC schema update
Katrin Fischer [Wed, 30 Oct 2024 17:26:18 +0000 (17:26 +0000)]
Bug 30648: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 37511: DBIC schema update
Katrin Fischer [Wed, 30 Oct 2024 17:21:40 +0000 (17:21 +0000)]
Bug 37511: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 37392: (QA follow-up) Attempt to clarify POD
Martin Renvoize [Wed, 30 Oct 2024 07:21:36 +0000 (07:21 +0000)]
Bug 37392: (QA follow-up) Attempt to clarify POD

This aptch attemptes to tidy up and clarify the POD for various 'things'
methods in the Koha::Patron class.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 37392: (follow-up) Tidy and improve descriptions
Nick Clemens [Tue, 29 Oct 2024 12:57:38 +0000 (12:57 +0000)]
Bug 37392: (follow-up) Tidy and improve descriptions

Tidy and improve the description of patron limits in staff interface

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 37392: Adjust routines
Nick Clemens [Wed, 24 Jul 2024 19:18:15 +0000 (19:18 +0000)]
Bug 37392: Adjust routines

The current code only handled a single layer of groups - top level setting the features, and libraries directly
underneath.

The code, however, was not correctly checking the features, and was limiting to single like when no restrictions found.

This patch gets the root ancestor for a group, checks the desired feature against than group, then fetches all children
of the current group and makes them allowed - i.e. when a library is in a group, all siblings and descendants in that group
or subgroups can be accessed

I adjust some typos in the tests too, this needs more cleanup in the future, but am submitting for any discussion

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
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>
2 weeks agoBug 37392: can_see_things_from is always checking patron visibility
Nick Clemens [Tue, 23 Jul 2024 13:26:12 +0000 (13:26 +0000)]
Bug 37392: can_see_things_from is always checking patron visibility

When trying to edit items, we are seeing the button visibility affected by a patron's
permission to view patrons form any library.

This is because can_edit_items_from is calling can_see_things_from - which is ultimately calling
libraries_where_can_see_patrons

That last call should be to libraries_where_can_see_things. This patch corrects that, and passes forward the group feature to check against

To test:

Set up library group:
* Create a library group for library A + B
* Action: Limit item editing by group

Set up test user:
* Create a staff patron with these permissions:
  * catalogue
  * fast_cataloguing
  * edit_items
  * view_borrower_infos_from_any_libraries
  * edit borrowers
* Home library: library A

Set up test items:
* Create a record with 3 items with different home libraries:
  * A
  * B
  * C

We expect the user will be allowed to edit A and B, but not C.

Test:
* Test editing the items with the test user, only A is allowed to be edited.
* Remove the view_borrower_infos_from_any_libraries permission from test user.
* Test editing items now behaves as expected: A + B are allowed, C is not.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
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>
2 weeks agoBug 37392: Unit test
Nick Clemens [Tue, 23 Jul 2024 13:55:13 +0000 (13:55 +0000)]
Bug 37392: Unit test

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
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>
2 weeks agoBug 38286: Do not fetch the items if OpacHiddenItemsHidesRecord is set
Jonathan Druart [Tue, 29 Oct 2024 12:52:48 +0000 (13:52 +0100)]
Bug 38286: Do not fetch the items if OpacHiddenItemsHidesRecord is set

Koha::Biblio:hidden_in_opac does not need to fetch the items if OpacHiddenItemsHidesRecord is set

Test plan:
  prove t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Item.t t/db_dependent/api/v1/biblios.t
Should return green

Confirm the assumption above is correct.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 36977: (QA follow-up) Adapt tests
Tomas Cohen Arazi [Tue, 29 Oct 2024 10:41:57 +0000 (07:41 -0300)]
Bug 36977: (QA follow-up) Adapt tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 36977: Google does not read sitemaps with the name sitemapNNNN.xml
Janusz Kaczmarek [Tue, 28 May 2024 20:16:09 +0000 (20:16 +0000)]
Bug 36977: Google does not read sitemaps with the name sitemapNNNN.xml

We have experienced problems with Google indexing: it seems (controlled
in Google search console) that Google does not "like" sitemaps
with a name like sitemapNNNN.xml (does not read them).  Changing the name
to sitemap_NNNN.xml miraculously resolves the issue: individual pieces of
sitemap are read as they are declared in sitemapindex.xml.

Test plan:
==========
1. Have your site configured to work with Google search console
   (cf. https://support.google.com/webmasters/answer/9008080).
2. Generate sitemap with:
   misc/cronjobs/sitemap.pl --dir /var/lib/koha/<instance>/sitemap
   (create the directory if necessary)
3. Check with you browser that the sitemap is generated:
   http://<OPAC-url>/sitemapindex.xml
   Check that the individual pieces are readeable:
   http://<OPAC-url>/sitemap0001.xml
4. Go to the Google seach console > Sitemaps > Add a new sitemap
   Enter sitemapindex.xml
5. Most probably Google won't read your sitemap chunks with the
   warning: "Couldn't fetch".
6. Apply the patch. Repeat p. 2, 3, 4, with the difference of the
   chunk name:
   http://<OPAC-url>/sitemap_0001.xml
7. You should see Google reading your entire sitemap with the info:
   "Success".

Signed-off-by: Michael Skarupianski <michael.skarupianski@gmail.com>
Signed-off-by: MichaƂ Kula <148193449+mkibp@users.noreply.github.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 37495: Add ability to use metadata to filter plugins to run for plugins_nightly.pl
Kyle M Hall [Fri, 26 Jul 2024 14:48:17 +0000 (10:48 -0400)]
Bug 37495: Add ability to use metadata to filter plugins to run for plugins_nightly.pl

It would be nice to be able to filter the plugins run by plugins
nightly for development and testing, and for added flexibility
as to when to run cronjob_nightly for different plugins if need be.

Test Plan:
1) Apply this patch
2) Check the metadata for an installed plugin, copy the name or another
   metadata value.
3) Run plugins_nightly.pl with a filter that does not match
   e.g. plugins_nightly.pl -m name="No plugin has this name"
4) Note no plugins cronjob methods are run
5) Run plugins_nightly.pl with a filter that *does* match
   e.g. plugins_nightly.pl -m name="Example Kitchen-Sink Plugin"
6) Not only the matching plugin runs!
7) Run plugins_nightly with no filter
   e.g. plugins_nightly.pl
8) Note all plugins with nightly cronjobs are run!

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>
2 weeks agoBug 38248: Do not deal with return claims if pref is not set
Jonathan Druart [Wed, 30 Oct 2024 08:53:44 +0000 (09:53 +0100)]
Bug 38248: Do not deal with return claims if pref is not set

If the pref is not set we don't embed return_claims and so
row.return_claims will never be set.
When the pref is on, row.return_claims should always be an array.

Test plan:
Same as previous patch

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 37582: Add unit test
Kyle M Hall [Wed, 30 Oct 2024 11:53:35 +0000 (11:53 +0000)]
Bug 37582: Add unit test

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 38273: Adjust t/db_dependent/api/v1/holds.t
Pedro Amorim [Wed, 30 Oct 2024 09:20:04 +0000 (09:20 +0000)]
Bug 38273: Adjust t/db_dependent/api/v1/holds.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 weeks agoBug 37511: DBRev 24.06.00.053
Katrin Fischer [Wed, 30 Oct 2024 08:13:36 +0000 (08:13 +0000)]
Bug 37511: DBRev 24.06.00.053

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>