Test plan:
Run dbrev, check database.
Bonus: Connect an AV category with a long name to a authority subfield.
Check if you see its values in the authority editor.
(This was the way I found the problem.)
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Thu, 28 Oct 2021 11:45:39 +0000 (11:45 +0000)]
Bug 29336: Identify the fields with wrong length (or name) first
This report will fix the bad lengths first.
And mark the 'bad' names with a TODO for follow-up.
Bad name means: refers to value, should be category.
Scanning kohastructure.sql.
Note: Bug 29347 has been opened to fix the names.
Test plan:
Search for another AV category field with length<>32.
Bonus: Reinstall and check database.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 29758: Get rid of warning in members/boraccount.pl
This patch removes a noisy warning found in production logs.
To test:
1. Run:
$ tail -f /var/log/koha/kohadev/plack-intranet-error.log
2. Open the 'Accounting' tab for a patron, then click on 'Transactions'
=> FAIL: You see this kind of warning in the logs:
[WARN] CGI::param called in list context from...
3. Apply this patch
4. Repeat 2 (change tab and go back)
=> SUCCESS: No more warning!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Fri, 7 Jan 2022 10:29:47 +0000 (11:29 +0100)]
Bug 29812: Add missing use C4::Context in Koha::Token
Caused by bug 18124.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 29464: Make GET /acquisitions/orders honour sorting
When bug 20212 was pushed, we lost (didn't dig enough to find out how)
the sorting feature for this route.
This is mainly because biblio+biblioitems filtering prevents the route
to use plain $c->objects->search, so it has baked a custom version of
it. In this case, it missed the call to the dbic_merge_sorting helper,
that takes care of reading the query parameters and inject the sorting
attributes to the resultset.
To test:
1. Apply the regression tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> FAIL: Tests fail, sorting doesn't actually work
3. Apply this patch
4. Repeat 2
=> SUCCESS: Sorting works!
5. Test sorting the pending orders on parcel.tt
6. Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Fri, 17 Dec 2021 15:49:17 +0000 (15:49 +0000)]
Bug 29704: Add a triggered option to holds_reminder.pl
This patch adds an option to only trigger notices matching the number of
days waiting specified
You will need to define HOLD_REMINDER notices for the specific branch of the
patron and ensure the patron has hold reminder notices in their messaging preferences
TO test:
1 - Place a hold for a patron and check in to confirm
2 - Set the waiting date back a few days:
update reserves set waitingdate = DATE_SUB(CURDATE(), INTERVAL 5 DAY);
3 - Run the cron and see that patron would be notified if running for 4 days weaiting
perl misc/cronjobs/holds/holds_reminder.pl -v --days 4
4 - Apply patch
5 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 4 --triggered
6 - Note patron would not be notified
7 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 5 --triggered
8 - Note patron is notified when days waiting matches exactly
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Julian Maurice [Tue, 16 Nov 2021 15:31:02 +0000 (15:31 +0000)]
Bug 29498: Remove usage of deprecated Mojolicious::Routes::Route::detour
Mojolicious::Routes::Route::detour was deprecated in Mojolicious 8.67
and removed in Mojolicious 9
It was used in Koha::App::Plugin::RESTV1 to connect the "REST API"
Mojolicious app to the other Mojolicious apps (Koha::App::Intranet and
Koha::App::Opac), so it's only a problem when running Koha as a
Mojolicious app.
This patch makes use of the "partial" attribute instead, which does the
same thing.
Test plan:
1. Run `morbo bin/intranet`
2. Point your browser to what morbo says (should be localhost:3000)
3. Log in, and go to Administration » Libraries. This table uses the
REST API, so if you see data in it, that means the API (and the
patch) works
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Joonas Kylmälä [Sun, 14 Nov 2021 12:10:15 +0000 (12:10 +0000)]
Bug 29474: Remove one layer of indendation by adding if check in the begginning
If we simply return "no" immediately from the function when the
checkout is not an autorenewed checkout we can drop one layer of
indendation and the code becomes much easier to read.
To test:
1) prove t/db_dependent/Circulation.t
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Joonas Kylmälä [Sun, 14 Nov 2021 12:05:16 +0000 (12:05 +0000)]
Bug 29474: Decouple renewal checks of auto-renewed issues from non-autorenewed
The too_soon check does not relate at all to auto-renewed issues and
should be moved outside the _CanBookBeAutoRenewed() function.
To test:
1) prove t/db_dependent/Circulation.t
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Thu, 9 Dec 2021 13:55:41 +0000 (13:55 +0000)]
Bug 29670: Fix EDI for AcqCreateItem = 'placing on order'
The AcqCreatItem at order time functionality was broken by bug 27708.
This patch resolves that.
Test plan.
1) Run the newly created unit tests that prove both settings work
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Thu, 9 Dec 2021 16:04:55 +0000 (16:04 +0000)]
Bug 29670: Unit tests
This patch adds unit tests for Koha::Edifact::Order->order_line. We now
check that the message segments are created as expected for both the
'ordering' and not 'ordering' case for acquisitions item creation time.
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD amended patch: spelling segement ==> segment
Nick Clemens [Thu, 6 Jan 2022 12:38:05 +0000 (12:38 +0000)]
Bug 29808: Do not receive transfer for checked out items
This patch adds a check to StockRotationItem->advance to check if an
item is checked out from the destination branch. If so, we do not receive the transfer
To test:
1 - Enable StockRotation system preference
2 - Browse to Tools->Stock rotation->New Rota and create a new rota, set as cyclical
3 - Manage->stages and add two stages, each with 0 day duration
4 - Manage->items - add an item
5 - Checkout the item from the first branch of rotation
6 - Tools->Stock rotation->Manage->items->move to next stage
7 - Error:
[Transfer item is currently checked out] at /usr/share/perl5/Exception/Class/Base.pm line 88
8 - Check in the item at first branch
9 - Checkout the item from the second stage branch
10 - Apply patch
11 - Tools->Stock rotation->Manage->items->move to next stage
12 - No error!
13 - Check in item at second branch
14 - Checkout from first branch
15 - Tools->Stock rotation->Manage->items->move to next stage
16 - Still no error!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This trivial patch acknowledges the fact bug 28871 is probably not going
to be pushed, and changes the method so it, internally, uses
Koha::Item->pickup_locations and Koha::Biblio->pickup_locations in
scalar context.
This is probably the correct solution as the discussion on bug 28883
points towards the future removal of the use of wantarray altogether,
eventually.
To test:
1. Apply the regression tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Hold.t
=> FAIL: It explodes as we see in production, with:
The method Koha::Libraries->branchcode is not covered by tests!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Tue, 4 Jan 2022 13:37:53 +0000 (13:37 +0000)]
Bug 29786: Select only specific items for item level holds
This patch adjusts get_items_that_can_fill to make two requests:
first the list of items for item-level holds
second the list of biblionumbers for title-level holds
This stops the report from pulling more items for item-level hold
This patch also removes the aliases used in the code - while readability
is a bit harder, it allows for using 'me' in get_items_that_can_fill
Otherwise, this routine would need a parameter to know what we called the table.
To test:
1 - Find a record with many items available
2 - Place an item level hold for an item on the record, not the one with lowest itemnumber
3 - Run 'Hold to pull' report
4 - Note the barcode does not match
5 - Apply patch
6 - Reload report
7 - It matches!
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Thu, 18 Nov 2021 07:43:44 +0000 (07:43 +0000)]
Bug 29495: Update relationship methods
This patch updates the relationship methods found in
Koha::Checkouts::ReturnClaim so that they are prefetchable and embeddable on
the API.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 17 Nov 2021 10:27:38 +0000 (10:27 +0000)]
Bug 29495: Add code level constraint replacement
This patch adds a check in Koha::Checkouts::ReturnClaim::store to
replace the database level foreign key check.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 17 Nov 2021 10:10:18 +0000 (10:10 +0000)]
Bug 29495: Add DBIC relationships back into Schema
This patch adds the relationship accessors back into the affected Schema
classes, now below the fold so they are retained during dbic rebuilds.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 17 Nov 2021 10:01:47 +0000 (10:01 +0000)]
Bug 29495: DBIC Schema Rebuild
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 17 Nov 2021 09:56:48 +0000 (09:56 +0000)]
Bug 29495: Drop issue_id constraint from return_claims
This patch removes the issue_id constraint from return_claims.
Due to the nature of our dual table approach to checkouts/old_checkouts
we can't safely hae this constraint and not lose data. Prior to this
commit, when an item is checked in we move the checkout from checkouts
to old_checkouts.. this therefore triggers the delete of the issue_id
from the return_claims table as described by the foreign key constraint.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 29585: Fix unstranslatable strings in addbiblio.tt
This patch makes 'Go to field' and 'Errors' strings translatable
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Thu, 16 Dec 2021 15:44:30 +0000 (16:44 +0100)]
Bug 29717: Remove unecessary DT manipulations from tools/additional-contents.pl
DBIC handles DateTime correctly, no need for this output_pref call.
Test plan:
Create a new content, set the dates, confirm they are set correctly
Modify the content, modify the dates, confirm they are stored correctly
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Wed, 15 Dec 2021 15:44:06 +0000 (15:44 +0000)]
Bug 29702: Fetch group libraries in a single call
The current code gets all group members, then loops through and fetches the library if there is a
branchcode, or recursively calls itself if a group. This slows down performance.
We can utilize the 'libraries' method to get all child libraries at once, then make a check
for child groups separately
To recreate:
1 - Add 100 items to a biblio
2 - Define a library group as a hold group
3 - Add all libraries to the group
4 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Any library'
5 - place a hold on the record and note load time after patron is selected
6 - Set 'Default checkout, hold and return policy'->'Hold pickup library match' = 'Patrons hold group'
7 - place a hold, note longer load time after patron selection
8 - Apply patch
9 - note improvement
10 - prove -v t/db_dependent/Koha/Libraries.t
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This has no effect as it is not causing problems. But.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 29736: (QA follow-up) No need to delete all clubs
There's no real need to delete all the existing clubs in the tests.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Without this patch, the list will always display all clubs.
To test:
1. Have two clubs, with enrollemnts:
- Cthulhu fans
- The Shadow Out of Time fans
2. Search for the letter c
=> FAIL: You get both results
3. Apply this patch
4. Repeat 2
=> SUCCESS: Only Cthulhu is returned
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Mon, 20 Dec 2021 14:14:56 +0000 (15:14 +0100)]
Bug 29736: Don't return empty clubs
There is an error when placing a hold for a club without members:
Uncaught TypeError: err.responseJSON.error is undefined
It seems that we should remove clubs without members from the search.
Test plan:
Create 1 club xx with 2 patrons
Create 1 club xxx with 1 patron and cancel their enrolment
Create 1 club xxxx without patron
Place a hold for club "x", only the first one should be returned with
this patch.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Mon, 13 Dec 2021 17:27:42 +0000 (17:27 +0000)]
Bug 29476: (follow-up) Fix return, add precision test
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Joonas Kylmälä [Sun, 14 Nov 2021 14:19:08 +0000 (14:19 +0000)]
Bug 29476: Correct soonest renewal date calculation for checkouts with auto-renewal
If a checkout with auto-renewal enabled doesn't have a
"norenewalbefore" circulation rule set the code in CanBookBeRenewed()
falls back to using due date (to verify this please look for the
string "auto_too_soon" in C4/Circulation.pm), the calculation result
of GetSoonestRenewDate() however didn't do this, though luckily it was
not used in CanBookBeRenewed so we didn't get any issues
there. However, GetSoonestRenewDate() is used for displaying the
soonest renewal date in the staff interface on the circ/renew.pl page
so you would have gotten wrong results there.
This patch moves additionally the tests made for Bug 14395 under a new
subtest for GetSoonestRenewDate() as they should have been like that
already before.
To test:
1) prove t/db_dependent/Circulation.t
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Mon, 20 Dec 2021 11:02:45 +0000 (12:02 +0100)]
Bug 29735: Remove flatpickr init from categories.js and holds.js
Same as bug 29394, we want the flatpickr instanciations be done at the
same place, from calendar.inc. That way they will all behave
identically.
Test plan:
Edit a patron category and confirm that the "until date" calendar has
the "yesterday" and "today" dates disabled
Place a hold on an item, go to the patron detail page, click the "holds"
tab, suspend.
That should trigger a modal that will display a calendar with
"yesterday" and "today" dates disabled
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers [Fri, 14 Jan 2022 01:33:09 +0000 (15:33 -1000)]
Bug 20076: (RM follow-up) Fix system preference boolean logic
A Yes/No system preference must use 1 for Yes and 0 for No.
So "Send" for 1/Yes and "Don't send" for 0/No.
We add too much problems with double-negation boolean system preferences (such as dontmerge).
Previous patch changed default value to 1 in atomicupdate, do the same
in installer/data/mysql/mandatory/sysprefs.sql
Also to be consistant, sets options = NULL instead of '' in atomicupdate
Also removed useless added empty line in /misc/cronjobs/overdue_notices.pl
ThibaudGLT [Fri, 10 Dec 2021 15:02:03 +0000 (15:02 +0000)]
Bug 20076: Add syspref to remove overdues notification by email to staff if user has no email address
I took the same test plan as victor but I added the system preference to manage the case more easily, especially for users who do not have access to the koha server.
Test plan
1. Check the size of the message queue
With the following SQL query (using an SQL report if you want)
SELECT COUNT(*) FROM message_queue;
2. Run misc/cronjobs/overdue_notices.pl
3. Check the size of the message queue
To ensure that no other overdues will create noise in this test plan.
Or you can take them into account.
4. Choose a patron with no email address
5. Create an overdue (checkout an item and unfold "Checkout settings"
and set a date in the past which is compatible with what you find in
staff:/cgi-bin/koha/tools/overduerules.pl
6. Run misc/cronjobs/overdue_notices.pl
7. Check that you have two new messages in the queue
8. Inspect these two messages
SELECT * FROM message_queue ORDER BY time_queued DESC LIMIT 2 \G
1. One has the type "print" and the borrowernumber matching the patron.
2. The other has
subject: Overdue Notices
borrowernumber: NULL
message_transport_type: email
and contains "These messages were not sent directly to the patrons."
This is the one we don't want anymore.
Because it's now obsolete due to the first message.
9. Apply this patch
10. Run updatedabatase.pl
11. Change syspref 'EmailOverduesNoEmail' to "Don't send"
12. Delete data from message_queue (if you have access) for a cleaner view
13. Run again misc/cronjobs/overdue_notices.pl
14. Check that only the print message is now generated and not the
"Overdue Notices" one.
Owen Leonard [Tue, 23 Nov 2021 18:27:21 +0000 (18:27 +0000)]
Bug 29530: Fix handling of NumSavedReports preference in reports table
This patch updates the way the NumSavedReports preference value is used
on the saved reports page so that the setting is correctly incorporated
into the DataTable.
The patch also expands the description of the NumSavedReports preference
in order to clarify the expected behavior when no value is saved.
To test, apply the patch and go to Administration -> System
preferences and note the value of NumSavedReports.
- Go to Reports -> Use saved.
- Confirm that the first page of saved reports shows the number
specified in NumSavedReports.
- In the "Show" dropdown menu, confirm that the number from
NumSavedReports is preselected by default.
- Expand the dropdown menu to confirm that the NumSavedReports number
is positioned sequentially with the default values. For example, if
NumSavedReports = "78," the menu options should be
"10, 20, 50, 78, 100, All".
- Test with various values of NumSavedReports. A blank value should
result in the "All" option being selected. A non-numeric or
non-positive value should result in the default set of options being
used ("10, 20, 50, 100, All").
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Julian Maurice [Thu, 18 Nov 2021 10:30:33 +0000 (10:30 +0000)]
Bug 29516: Remove dependency on IO::Scalar
IO::Scalar is used in Koha::App::Plugin::CGIBinKoha to create a
filehandle tied to a scalar.
Perl has this feature built in since 5.8.0 so IO::Scalar is not needed
I'm not sure how to test this, since it should behave exactly the same
with or without the patch, but we can at least verify that it doesn't
introduce encoding issues.
Test plan:
1. Run `morbo bin/intranet`
2. Go to http://localhost:3000
3. Create a bibliographic record with some non-latin characters (try
emoji characters for instance). Verify that there is no visible
encoding issues.
4. Save this record as MARCXML and re-import it as a new record using
Tools » Stage MARC records for import. Verify that the new record has
no visible encoding issues
5. `git grep IO::Scalar` should not return any result
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Wed, 17 Nov 2021 16:09:02 +0000 (16:09 +0000)]
Bug 29491: Improve display of notices in patron details
This patch updates the patron notices list so that notices are shown in
a modal dialog instead of inline in the table. The "Resend" button is
shown in the modal window controls.
To test, apply the patch and locate a patron in the staff interface with
multiple sent notices.
- View the patron's "Notices" tab.
- In the table of notices, click one of the notice titles.
- A modal window should appear with the notice subject as the header
and the notice content in the main body of the modal.
- If the message has any other status than 'pending' there should be a
"Resend" button in the modal footer. Confirm that it submits the
form and resends the correct message.
- Try viewing multiple notices to confirm that the contents of the
modal are correctly updated for each message.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Wed, 17 Nov 2021 15:35:37 +0000 (15:35 +0000)]
Bug 29491: (preparatory step) Reindent template
Step 1: Replace tabs with spaces and reindent. This patch should include
only whitespace changes. If you view the diff while ignoring whitespace
there should be no changes.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 24866: (follow-up) Replaced tabulations by dashes
The rendering of SELECT elements is up to the browser.
But Bug 16123 CSS code 'style="padding-left: xx' doesn't work on modern browsers.
Based on the previous contribution, this fix replaces CSS style attribute with dashes, creating a leveled structure that should work with most browsers.
Tested on Linux Ubuntu with Firefox 94.0, Chromium 95.0.4 and Opera 81.0.1
TEST PLAN :
1. Go to the Administration module
2. Add a new budget (ie : Budget 2022)
3. Add a fund to this budget (ie : Book)
4. Add a sub-fund to fund Book (ie : Fiction)
5. Add another sub-fund, this time to sub-fund Book (ie : Adult fiction)
You will have this hierarchy :
Budget 2022
|____ Book
|_____ Fiction
|_____ Adult fiction
6. Go to the Acquisition module
7. Select a vendor and create a new basket
8. Place an order
9. Check the budget dropdown menu
BEFORE PATCH
Book
Fiction
Adult fiction
OR
Book
Fiction
Adult fiction
AFTER PATCH
Book
-- Fiction
-- -- Adult fiction
Co-authored-by: Didier Gautheron <didier.gautheron@biblibre.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 24866: Display budget hierarchy in the budget dropdown menu used when placing a new order
The rendering of SELECT elements is up to the browser.
But Bug 16123 CSS code 'style="padding-left: xx' doesn't work on modern browsers.
This patch replace CSS style attribute with   html entity.
On supported platforms
TEST PLAN :
1. Go to the Administration module
2. Add a new budget (ie : Budget 2020)
3. Add a fund to this budget (ie : Book)
4. Add a sub-fund to fund Book (ie : Adult fiction)
You will have this hierarchy :
Budget 2020
|____ Book
|_____ Adult fiction
5. Go to the Acquisition module
6. Select a vendor and create a new basket
7. Place an order
8. Check the budget dropdown menu
BEFORE PATCH
Book
Adult fiction
OR
Book
Adult fiction
AFTER PATCH
Book
Adult fiction
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Mon, 13 Dec 2021 12:01:24 +0000 (12:01 +0000)]
Bug 29685: Reduce item processing by calculating 'items any available' outside of loop
See bug 24185, this avoids looping every each item of the record for every item of the record
How to reproduce:
1) on freshly installed kohadevbox create/import one book,
remember that biblionumber for later use it in down below,
2) add 100 items for that book for some library,
3) find some patron, that patron's card number we will
use as a borrower down below to open holds page,
4) check for the rule or set up a single circulation rule
in admin "/cgi-bin/koha/admin/smart-rules.pl",
that rule should match above book items/library/patron,
check that rule to have a non-zero number of holds (total, daily, count) allowed,
and, IMPORTANT: set up "On shelf holds allowed" to "If all unavailable",
("item level holds" doesn't matter).
5) open "Home > Catalog > THAT_BOOK > Place a hold on THAT_BOOK" page
("holds" tab), and enter patron code in the search field,
or you can create a direct link by yourself, for example, in my case it was:
/cgi-bin/koha/reserve/request.pl?biblionumber=4&findborrower=23529000686353
6) it should be pretty long page generation time on old code, densely increasing for every hundred items added. In the case of this solution, it's fast, and time increases a little only, linear.
In testing with 100 books I went from ~6.5 seconds to ~3.2 seconds
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 12 Jan 2022 08:46:46 +0000 (09:46 +0100)]
Bug 29856: Make the ES config more flexible
I need to add a 'request_timeout' entry to the ES configuration to fix some timeout problems on the sandboxes.
Instead of hard coding this new option it seems preferable to be
flexible and allow different options to be passed from the config file.
Test plan:
Add to the $KOHA_CONF, inside the elasticsearch section
<request_timeout>60</request_timeout>
Rebuild the ES index
koha-elasticsearch --rebuild kohadev
Change the value of the timeout to 1
Rebuild the index
It should fail (with a quite bad error 'Bad response received when
submitting request to Elasticsearch')
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Tue, 23 Nov 2021 13:48:22 +0000 (14:48 +0100)]
Bug 29557: Add auto_account_expired to AUTO_RENEWALS
It was missing and the notice sent was not providing the reason of the
failure.
Test plan:
Check an item out with a date in the past, mark it as auto renew
Modify the expired date of the patron and set it in the past
Run the automatic_renewals.pl cronjob script, confirm that the notice
now contains the reason of the failure.
QA note: The template will be updated only for English installations.
Should we add an alert for others?
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Florian Bontemps [Wed, 27 Oct 2021 12:50:42 +0000 (12:50 +0000)]
Bug 17127: Remove notes from detail.tt to only use MARCNOTES
Notes come from the biblio table, but that table is already used to fill in MARCNOTES through Biblio.pm and get_marc_notes.
Get_marc_notes does check for NotesToHide and already read every note on the records, but .notes doesn't go through that same filter.
I don't see the point of keeping notes as a condition when MARCNOTES does the same job but better.
To test:
1) Take any record, or create one
2) Input something in the 500 field (or 300 in UNIMARC)
3) In Systempreferences -> NotesToHide, fill in the number 500 (or 300).
4) Save, then go look at the record detail in the OPAC and admin website.
5) You should still see the 500 or 300 field under the Description tab.
6) Apply patch.
7) Reload the record detail page.
8) Observe the error is gone.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Tue, 16 Nov 2021 10:55:08 +0000 (11:55 +0100)]
Bug 29419: Retain user's inputs when suggesting for purchase and match found
If a user suggests for purchase and a match is found, their inputs was
not retained: quantity, item type, library, reason.
Test plan:
1. Suggest for purchase
2. Fill the title in with a string that will match an existing record
3. Fill value in quantity, item type, library and reason input/dropdown
4. Submit
=> Notice that with this patch the values you entered are retained on
the confirmation screen
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 29404 moved code from request.tt into holds.js, and I didn't know
about the _() vs. __().
This patch fixes that.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 5 Jan 2022 09:27:30 +0000 (10:27 +0100)]
Bug 29788: Fix batch delete item
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Tue, 4 Jan 2022 14:34:48 +0000 (15:34 +0100)]
Bug 29788: Make Koha::Item->safe_to_delete use Koha::Result::Boolean
This patch reuse the (awesome) Koha::Result::Boolean module to retrieve
the return of Koha::Item->safe_to_delete.
Test plan:
Try to delete an item that has previously been checked out and confirm
that you are still blocked.
Try using the cronjobs, the item and biblio detail pages, as well as the
batch delete item tool.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Tue, 4 Jan 2022 14:59:15 +0000 (15:59 +0100)]
Bug 29790: Restore warning if deletion of serial item fails
If the deletion of a serial item failed, the UI did not provide a warning/error message.
Test plan:
0. Create a new subscription with "Create an item record when receiving
this serial"
1. Receive a new item, set a barcode
2. Check it out
3. Select the item you have received in the serial item list (page
"Serial collection information") and click "Delete selected issues"
4. Tick "Delete the associated items" and confirm the deletion
=> Without this patch the deletion fail but the UI does not warn it
=> With this patch applied you see a warning "one or more associated
items could not be deleted at this time."
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Tue, 4 Jan 2022 14:40:19 +0000 (15:40 +0100)]
Bug 29789: Remove unused $error from cataloguing/additem.pl
my $error = $input->param('error');
It should be removed as $error is used later but not related to this variable.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen [Tue, 2 Nov 2021 13:10:35 +0000 (13:10 +0000)]
Bug 29391: Improve output of reservoir search
This patch makes the cataloging reservoir search results a configurable
DataTable. The empty edition and date columns are removed, and an import
data column is added.
To test, apply the patch and go to Cataloging.
- Perform a cataloging search which will return results from the
reservoir.
- The table of reservoir search results should be a DataTable with
paging, navigation, filtering, column configuration, etc.
- Confirm that all DataTable controls work correctly.
- Go to Administration -> Table settings -> Cataloging -> addbooks.
- Try modifying the default configuration and confirm that the
settings take effect.
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 5 Jan 2022 15:45:34 +0000 (16:45 +0100)]
Bug 29778: Remove DBMS error
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Table 'additional_contents' is specified twice, both as a target for 'DELETE' and as a separate source for data at /kohadevbox/koha/C4/Installer.pm line 738
Happened on MariaDB 10.1 and 10.3, not 10.6
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Mon, 3 Jan 2022 10:31:54 +0000 (11:31 +0100)]
Bug 29778: Prevent orphan additional contents
When deleting a content, only the main one (lang="default") is removed,
which leads to orphan contents in the DB that are still displayed on the
UI.
Test plan:
0. Don't apply this patch
1. Create some contents, translate them in different languages
2. Delete some of them
=> Note that they are still displayed on the UI and that the entries
with lang!="default" are still in the DB
3. Apply this patch
4. Repeat 1
5. Run updatedatabase
6. Delete from of the contents
=> Note that the orphan entries created before you applied the patch
have been removed and that the "delete" behaviour is now working
correnctly.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch adds a missing include so the script is no longer broken.
To test:
1. Choose an item that is checked out and copy its barcode
2. Run:
$ kshell
k$ perl misc/cronjobs/delete_items.pl --verbose \
--where "barcode='39999000010831'"
=> FAIL: It explodes with:
Can't locate object method "find" via package "Koha::Items"...
3. Apply this patch
4. Repeat 2
=> SUCCESS: You get:
Where statement: where barcode='39999000010831'
Item '549' not deleted: book_on_loan
5. Sign off :-D
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Tue, 21 Dec 2021 13:20:46 +0000 (13:20 +0000)]
Bug 29747: Delete columns that don't exist from settings
This patch simply checks if we are callinmg from the plugin, and removes
two columns from the settings if so
To test:
1 - In Admin->Marc bibliographic framework got to Marc Structure for default framework
2 - Search for 856$u
3 - Set Plugin to upload.pl
4 - Edit a record in the default framework
5 - Under 856u, click 'Upload'
6 - Uplaod a file and then click 'Choose'
7 - nothing happens
8 - View consiole (f12) and see error
9 - Apply patch
10 - Reload the page
11 - No more error
12 - Click choose
13 - Record link is populated
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Mon, 8 Nov 2021 17:27:03 +0000 (17:27 +0000)]
Bug 26296: (follow-up) Make sure title remains mandatory
This patch adds a flag to the OPAC preferences file marking suggestion
title as mandatory OPACSuggestionMandatoryFields and excluded from
OPACSuggestionUnwantedFields.
The patch also modifies the markup around required fields in the OPAC
suggestion form to comply with changes made in Bug 27668 to mandatory
field styling.
To test, apply the patch and restart services.
- Test the OPACSuggestionMandatoryFields preference. In the modal,
"title" should be checked and the label in red. It should not be
possible to uncheck the checkbox.
- Test that the "Select all" and "Clear all" links don't affect the
"title" checkbox.
- Confirm that your selections are still saved correctly.
- Test the OPACSuggestionUnwantedFields preference. In the modal,
"title" should be unchecked and disabled.
- Test that the "Select all" and "Clear all" links don't affect the
"title" checkbox.
- Confirm that your selections are saved correctly.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Fri, 8 Jan 2021 20:06:45 +0000 (20:06 +0000)]
Bug 26296: Use new table column selection modal for OPAC suggestion fields
This patch builds on the change introduced by Bug 22844, changing the
selection mode for the OPACSuggestionMandatoryFields and
OPACSuggestionUnwantedFields preferences to a modal.
This patch includes a database update for converting the format of the
saved values in these preferences. Previously the suggestions table
fields would be separated by a comma. Now they should be separated by a
pipe.
To test, apply the patch run the database update.
- Go to Administration -> System preferences.
- Search for 'OPACSuggestion.'
- The input fields for OPACSuggestionUnwantedFields and
OPACSuggestionMandatoryFields should appear as "locked" (read-only)
inputs.
- Clicking either input field should trigger a modal window with
checkboxes for each available column in the suggestions table.
- Test that the "select all" and "clear all" links work correctly.
- Test that the "cancel" link closes the modal without saving your
selections.
- Test that the "Save" button closes the modal, copies your
selections to the form field, and triggers the preference-saving
function.
- Test that changes to both preferences are correctly reflected in the
OPAC suggestion form.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 29508: Make GET /patrons/:patron_id use Koha::Patrons->search_limited
This patch makes the route return 404 if the user is not allowed to see
the requested patron information.
To test:
1. Apply the regression tests
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: The code doesn't respect limits
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch makes GET /patrons rely on this new behavior from the
objects.search helper.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 29506: Make objects.search call search_limited if present
This patch makes objects.search implicitly update the passed
*$result_set* to use search_limited. This way no object leaks could
happen without noticing.
To test:
1. Apply the regression tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail because search_limited is not used
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Results are correctly filtered based on userenv!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 29503: Make GET /patrons use Koha::Patrons->search_limited
This patch makes the controller method use Koha::Patrons->search_limited
so filters based on configuration and permissions apply when fetching
patrons.
To test:
1. Apply the regression tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Boo, you get more patrons than you should
3. Apply the patch
4. Repeat 2
=> SUCCESS: Yay! Things are filtered as expected (i.e. using
Koha::Patron->libraries_where_can_see_patrons)
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>