Katrin Fischer [Sun, 17 Mar 2024 16:46:26 +0000 (16:46 +0000)]
Bug 35973: Correct wrong values for RedirectGuaranteeEmail system preference
The system preferences was added with 0/1 in sysprefs.sql is checked
as boolean. But the .pref file was added with yes/no which both
evaluate as strings to true.
This fixes the .pref file and includes a database update that sets
0 and 1 correctly for the value currently chosen in the pref.
To test:
* Make sure to update RedirectGuaranteeEmail to Enable/Don't enable
before applying the patch
* Verify in the database, that the values was set to yes or no
You can use a report like:
SELECT * from systempreferences WHERE variable = "RedirectGuaranteeEmail";
* Apply patch and run database update
* Verify the value in the database was corrected:
Yes = 1, No = 0
* Change the setting, verify the new value is stored correctly
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Fri, 8 Mar 2024 15:25:10 +0000 (15:25 +0000)]
Bug 35394: Correction to booked items logic
This patch fixes the overly extreme message that was designed to appeared
when someone tried to check out a booked item to the wrong user.
However, the message never appeared due to a logic error within
CanBookBeIssued which this patch also resolved.
Test plan
1) Make an item bookable
2) Add a booking for the item to patron A from tomorrow
3) In the database, update the booking start_date to today (or wait a
day before the next step)
4) Attempt to check the book out to patron B.
Note that you are displayed with the new message 'The item is booked
for another patron' and you are unable to check the item out.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Thu, 18 Apr 2024 06:54:48 +0000 (08:54 +0200)]
Bug 36635: Fix vendor's issue show view
Should be "show" not "cud-show"
Test plan:
Create an issue for a vendor, click on the issue's id on the issue list
table
Notice that with the patch applied the issue is displayed. Without the
patch the "show" view is empty
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Marcel de Rooy [Mon, 19 Feb 2024 13:24:47 +0000 (13:24 +0000)]
Bug 27893: Optionally skip biblio with open orders in batch delete
If the user unchecks the skip checkbox (on by default), we must
make sure that order cancellation is done in background job.
Test plan:
Pick two biblios. One has linked open orders, the other not.
Go to batch delete records. Select 'Enter list of numbers'.
Enter both biblio numbers and check that only one is used on the
follow-up form.
Run the deletion without the skip open orders and verify
that linked order line is cancelled.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Marcel de Rooy [Mon, 19 Feb 2024 11:43:32 +0000 (11:43 +0000)]
Bug 27893: Cancel acq orders in addbiblio.pl
When the user confirms removal although we have linked orders,
we should cancel them.
Test plan:
Add order line to a basket.
Goto newly added biblio record, remove items, remove biblio.
Notice the warning about attached order lines.
Confirm. Check the basket again after deletion took place (cancelled line).
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Marcel de Rooy [Wed, 14 Feb 2024 15:57:50 +0000 (16:57 +0100)]
Bug 36068: Do not overwrite cancellation date in ->cancel
Test plan:
Run t/db_dependent/Koha/Acquisition/Order.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Introducing $orders->filter_by_obsolete and $orders->cancel.
Test plan:
Run t/db_dependent/Koha/Acquisition/Orders.t
Create basket with few orders. Remove some biblio records.
Run acq_cancel_obsolete_orders.pl -c
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Thu, 11 Apr 2024 10:40:16 +0000 (10:40 +0000)]
Bug 36563: Turn into array only if required
Test plan, apply first patch:
1- Visit item search:
http://localhost:8081/cgi-bin/koha/catalogue/itemsearch.pl
2- Set "Home library" -> "is not" -> "Centerville". Notice you get items
from Centerville.
3- Apply second patch, repeat step 2, notice you now don't get items
from Centervile.
4- Test other use cases, like 'is' and 'is not' for multiple choices
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Wed, 10 Apr 2024 10:04:18 +0000 (12:04 +0200)]
Bug 36563: Dirty fix
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Marcel de Rooy [Thu, 21 Mar 2024 14:17:35 +0000 (14:17 +0000)]
Bug 36386: Pass user and group to Net::Server
This prevents the User/Group Not Defined warns in syslog.
Test plan:
Restart sip and check your syslog.
KTD Test Plan:
1) Stop your SIP server
2) Run "perl C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/koha-conf.xml"
We need valid XML without any valid SIP settings to the output goes
to the command line
3) Note the warnings
4) Apply this patch
5) Repeat step 2
6) No warnings!
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Wed, 17 Apr 2024 15:03:53 +0000 (15:03 +0000)]
Bug 36623: Remove localhost reference
This patch removes a reference to localhost from a url within ERM
Test plan:
This is quite hard to test without sushi credentials and is quite an easy fix. Check the patch diff to verify that the localhost reference has now been removed from the url
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Wed, 17 Apr 2024 10:06:03 +0000 (12:06 +0200)]
Bug 30068: Remove table_settings_borrowers_table from circulation.tt
The history is a mess, but here we init a JS variable that is never
used.
Test plan:
git grep table_settings_borrowers_table
should not return anything after this patch applied
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Tue, 2 Apr 2024 12:41:42 +0000 (12:41 +0000)]
Bug 36490: Correct tab-switching keyboard shortcut for header search forms
This patch updates staff-global.js so that we correctly define the
keyboard shortcuts for search header tabs following the switch to using
the WRAPPER for tabs in Bug 35850.
To test, apply the patch clear your browser cache if necessary.
- Go to the staff interface.
- Test each keyboard shortcut to confirm that the header search tabs
activate correctly:
- Check in: Alt-r
- Renew: Alt-w
- Search: Alt-q
- Check out: Alt-u
- Test that the keyboard shortcut takes you to the correct page if the
header search form doesn't exist on the page, e.g. the Authorities
home page.
Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 36420: Allow Basic authentication using `cardnumber`
This patch makes the API Basic authentication work with cardnumbers.
The used `checkpw_internal` method already does the fallback check.
To test:
1. Apply the unit tests patch
2. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1/auth_basic.t
=> FAIL: Tests explode! [1]
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
[1] This highlights an underlying bug! Instead of getting 403, etc we get a 500. This is because of the internal fallback mechanism allowing the cardnumber+password combination, but then the Koha::Patron->find... not finding :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Lucas Gass [Mon, 26 Feb 2024 15:59:29 +0000 (15:59 +0000)]
Bug 30987: Fix relationship fields for patron full and quick add forms
To test:
1. APPLY PATACH and restart services.
2. Find the borrowerRelationship system preference. The description should no longer include the words "Leave empty to deactivate."
3. Populate the system preference with at least 1 choice.
4. Find a patron category with can_be_guarantee set to 'Yes'.
5. Quick add a patron of that type, making sure the relationship field shows in the Patron guarantor section. ( You have to +Add gaurantor before this field will show )
6. The values in the dropdown should refelct the borrowerRelationship values.
7. With BorrowerMandatoryField make relationship mandatory.
8. Try step 5 again, this time the Relationship field should be mandatory.
9. Remove the field from BorrowerMandatoryField and add it to BorrowerUnwantedField.
10. Do step 5 again, the relationship field should not show on the quick add form.
Signed-off-by: Myka Kennedy Stephens <mkstephens@fosgail.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 36630: Change Post to GET to fix CSRF error on item search batch operations buttons
This patch changes the form that submits to batchMod.pl from the Item search results page. The form method does not need to be a POST.
To recreate:
1. Do an item search
2. On the results page 'click Select visible rows'
3. Click 'Batch operations' and select 'Batch item modification'
4. See Programming error - op 'show' must start with 'cud-' for POST http://localhost:8081/intranet/tools/batchMod.pl (referer: http://localhost:8081/cgi-bin/koha/catalogue/itemsearch.pl)
5. Click 'Batch operations' and select 'Batch item deletion'
6. See the same error
To test:
1. Apply patch and repeat steps to recreate the issue
2. See that the batchMod.pl page loads with no error.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Janusz Kaczmarek [Thu, 11 Apr 2024 12:36:25 +0000 (12:36 +0000)]
Bug 36577: (bug 34478 follow-up) marc21_linking_section.pl not working
After applying "Bug 34478: op =~ ^cud- everywhere" the plugin
marc21_linking_section.pl stopped working properly. Since the plugin
does not perform a CUD operation, the GET request can be used, and so
the use of CSRF token is not needed.
The patch fixes also problems with result page numbers display.
Test plan
=========
1. Configure a MARC bibliographic framework to use the plugin
marc21_linking_section.pl (e.g. in 773 $t).
2. Start creating a new record and go to 773 $t. Activate the plugin to find
the any record to become the host record (perform a search for any
common word, like 'and').
3. You will get no results.
4. Apply the patch, restart plack etc.
5. Repeat p. 2 - you should now see some results, possibly more than one
page. You should be able to change page with Next/Previous arrows and
also with the page numbers.
BTW, QA people - maybe it would pay to remove the commented code present there
since the very beginning (2012).
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Fri, 12 Apr 2024 12:31:15 +0000 (12:31 +0000)]
Bug 36597: Fix deletion of circulation desks broken by CSRF
Our CSRF work introduced a problem with deleting circulation desks: The
"delete_confirm" does not need "cud-" because it's a GET operation
leading to a POSTed deletion after the confirmation is submitted.
To test, apply the patch and restart services.
- Go to Administration -> Circulation desks.
- If necessary, create a circulation desk.
- Click the "Delete" button for you new desk.
- You should be taken to a confirmation page which shows details of the
desk you're deleting.
- Confirming the deletion should result in deletion of the desk.
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>
Bug 33832: Allow updating username without changing password on member-password.pl
This patch updates the change password page on the staff interface to
allow for changing the patron's username without changing the password.
If the new password is an empty string we can skip setting the patron's
password and sending the new password to the template.
Test plan:
1. From a patron record tool bar click 'Change password'
2. Notice that if you try to change the user's name without also
changing the password the page just reloads and nothing happens
3. Apply patch and restart_all
4. From the patron record click 'Change password' again
5. Set the user's new username and password eg. '1234Abc' and click
'Save'
6. Confirm that you can log in to the OPAC with the user
7. Return to the patron record and click 'Change password' again
8. This time change just the 'New username field' and click 'Save'
6. Notice that the username is updated
7. Confirm you can log into the OPAC with the new username and the
original password '1234Abcd'
8. Make sure that the change password form still validates passwords
for length and matching errors etc
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>
Thibaud Guillot [Mon, 15 Jan 2024 10:19:51 +0000 (11:19 +0100)]
Bug 35810: Add back to top button on staff pages
Test plan:
1) Apply this patch and rebuild css with 'yarn build'
2) For example, perform a search from catalogue
3) Scroll down to see the button appear and scroll up to see it
disappear
Note that it's works also on patron search etc..
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Wed, 29 Nov 2023 16:37:04 +0000 (16:37 +0000)]
Bug 35432: Expand comments to explain the priority of filling requests
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Wed, 29 Nov 2023 15:00:18 +0000 (15:00 +0000)]
Bug 35432: Remove PULL_BRANCHES and use ifs over unless
PULL_BRANCHES and PULL_BRANCHES2 felt a little arbitrary, moved
to using a last in the outer loop.
Swapped 'next unless' for an if to more directly show when we are acting
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
The code here is going to check items held the the pickup location for a request
or from the least cost branch matching the patron's home library against the HoldsQueuePrioritizeBranch
setting
The loop is the same in both case, so lets simplify this a bit to make the intent more clear
To test:
1 - prove -v t/db_dependent/HoldsQueue.t
2 - It should pass before and after this patch
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Wed, 29 Nov 2023 14:15:09 +0000 (14:15 +0000)]
Bug 35432: Add _can_item_fill_request subroutine
There are a series of repeated checks throughout MapItemsToHoldRequests.
This patch simply consolidates them into a single routine that can be called.
To test:
1 - prove t/db_dependent/HoldsQueue.t
2 - Confirm it passes before and after this patch is applied
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Wed, 29 Nov 2023 14:02:08 +0000 (14:02 +0000)]
Bug 35432: Add comments and POD
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Tue, 19 Mar 2024 15:00:04 +0000 (16:00 +0100)]
Bug 20388: Alert if the search field already exists
Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: David Schmidt <davewood@gmx.at> Signed-off-by: Thomas Klausner <domm@plix.at> Signed-off-by: David Schmidt <davewood@gmx.at> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Tue, 19 Mar 2024 14:33:12 +0000 (15:33 +0100)]
Bug 20388: Add trash icon to the delete button
Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: David Schmidt <davewood@gmx.at> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Tue, 19 Mar 2024 14:28:30 +0000 (15:28 +0100)]
Bug 20388: Adjust code
Sponsored-by: The Research University in the Helmholtz Association (KIT) Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: David Schmidt <davewood@gmx.at> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Alex Arnaud [Wed, 7 Apr 2021 13:20:53 +0000 (13:20 +0000)]
Bug 20388: Elasticsearch - Ability to add search fields from UI
Test plan:
- apply this patch,
- check that SearchEngine system preference is set to Elasticsearch,
- go to Admin > Search engine configuration,
- on the search fields tab, fill a new line at the bottom of the table
(name, label, type)
- click on the "Add" button and save,
- check that the new search field has been saved,
- also test field deletions,
- check that you can't delete already mapped fields.
Bug 36593: Add missing koha_object(s)_class methods to LibraryHour.pm (bug 9796)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 36593: Add 'time' column type support to TestBuilder
This simple patch adds support for the 'time' column type.
To test:
1. Run:
$ ktd --shell
k$ perl -Mt::lib::TestBuilder -e 'my $b = t::lib::TestBuilder->new; my
$hour = $b->build_object({ class => "Koha::Library::Hours" });'
=> FAIL: It explodes as it doesn't know how to deal with the 'time'
column type
2. Apply this patch and the follow-up
3. Run:
k$ prove -MDDP -Mt::lib::TestBuilder -e 'my $b =
t::lib::TestBuilder->new; my $h = $b->build_object({ class => "Koha::Library::Hours" }); p($h->unblessed);'
=> SUCCESS: It generates an hour!
4. Run:
k$ prove t/db_dependent/TestBuilder.t
=> SUCCESS: It builds all the things!
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: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 28268, in
Koha::MetadataRecord::Authority::get_all_authorities_iterator,
introduced a warning:
warn "Something went wrong reading record for authority $row->authid: $@\n";
But a method cannot be called from within quotes in Perl - extrapolation
does not work for functions/methods. So, if something really goes
wrong, this line of code produces a warning like:
Something went wrong reading record for authority
Koha::Schema::Result::AuthHeader=HASH(0x55cf7e0d0958)->authid: Empty
String at /usr/share/perl5/MARC/File/XML.pm line 450.
which is not very informative -- authid is missing.
Test plan
=========
Hard to reproduce. This problem occurs only in rare cases of some weird problem
in stores authority data or if a auth record had been deleted after a ES reindex
action has been initiated. But the problem in the code and the fix seem obvious.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Janusz Kaczmarek [Wed, 26 Apr 2023 23:04:48 +0000 (01:04 +0200)]
Bug 36552: Update record 'date entered on file' when duplicating a record
The 'date entered on file' (MARC21: 008/0-5, UNIMARC: 100a/0=7) of a record created
by duplication of an existing record should be set to the current date instead of
having the value of the original record.
Test plan
=========
1. Check the 'date entered on file' of an existing biblio / authotiry record
(MARC21: 008/0-5, UNIMARC: 100a/0=7).
2. Duplicate the record by Edit > Edit as new (duplicate)
3. Control the 'date entered on file' value - it will equal to that of the
original record.
4. Apply the patch (restart plack).
5. Repeat step 2.
6. Check the date - it should be the current date.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Kyle M Hall [Fri, 25 Aug 2023 17:37:46 +0000 (17:37 +0000)]
Bug 34621: implement Patron import option to 'Renew existing patrons' 'from the current membership expiry date'
Test Plan:
1) Test importing a patron with the "from the current membership expiry date" option,
note it does not work
2) Apply this patch
3) Restart all the things!
4) Re-test, note the expiration was renewed from the patron's current
expiration date!
Signed-off-by: David Nind <david@davidnind.com> Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Mon, 1 Apr 2024 14:32:08 +0000 (14:32 +0000)]
Bug 36473: Handle Invalid Metadata Exceptions in totalissues.pl
This patch wraps the call for record in an eval, and catches any invalid metadata
exceptions, letting the warning show, but allowing the script to continue
To test:
1 - In default KTD record 369 has problems, otherwise you need to break a record
2 - Run : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v
3 - It dies at record 369 (or the one you broke)
4 - Apply patch
5 - Run again
6 - It succeeds, but skips the bad record
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This case brought my attention as there was a different 'user' parameter being passed.
It turns out we already thought about this, and `objects.to_api` is of course always passing it :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 36483: Make API controllers use $c->objects->to_api
This patch makes all controller methods using direct $object->to_api, rely on $c->objects->to_api.
Direct ->to_api calling prevents things like embeds, +strings, etc to be dealt with correctly.
In some cases this change reduces the code as the authors extracted the embed structure from the stash and passed it explicitly.
I left out two Patrons.pm cases because I need to study it a bit more.
To test:
1. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1
=> 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: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Wed, 12 Jun 2019 11:43:48 +0000 (11:43 +0000)]
Bug 23102: 404 errors on page causes SCI user to be logged out
To test:
1 - Have something on the SCO page that won't load
Add to SCOUserJS:
</script>
<img src="http://localhost:8080/silk/famfamfam.png"/>
<script>
2 - Enable the SCO and SCI system preferences:
WebBasedSelfCheck: Enable
SelfCheckInModuke: Enable
AutoSelfCheckAllowed: Allow
AutoSelfCheckID / AutoSelfCheckPass to a valid user with permissions
3 - Add the self_checkin_module and self_checkout_module permissions to the AutoSelfCheck user
4 - Access the selfcheckout module https://yoursite.org/cgi-bin/koha/sco/sco-main.pl
5 - Sign in using a patron
6 - Enter an unkown barcode, I used "DONTMATTER"
7 - If not logged out, click to 'Return to account summary'
8 - You are asked to sign in again
9 - Repeat with the SCI module
10 - Apply patch
11 - Repeat, but this time you can return to account
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Tue, 2 Apr 2024 17:03:21 +0000 (17:03 +0000)]
Bug 36494: Flatpickr error on checkout page if the patron is blocked from checking out
This patch add some error-handling to the recent change to
circulation.tt where we handle dates and on-site checkouts. This
prevents an error in the console when the patron is blocked and the
"specify due date" field is hidden.
To test, apply the patch and make sure OnSiteCheckouts is enabled.
- Go to Circulation and check out to a patron.
- Under the restrictions tab, add a manual restriction.
- When the page reloads and the checkout form is no longer visible,
confirm that there is no error in the browser console.
Confirm that the Bug 18885 test plan still works.
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>
Kyle M Hall [Thu, 8 Feb 2024 17:44:28 +0000 (12:44 -0500)]
Bug 36051: Add option to specify SMS::Send driver parameters in a system preference
If an SMS::Send driver ( such as Twilio ) requires additional parameters, those
parameters have to be placed in a yaml file named after the SMS::Send driver,
and the path to that file specified in the Koha conf file.
It would be good if we had the option to specify those parameters in a YAML
system preference instead. This would be less complicated and avoid requiring
an administrator to update that data from the backend.
Test Plan:
1) Set up an SMS::Send driver that requires additional options;
a Twilio account meets these requirements and can be created for
free. Set this up using the traditional file based system.
2) Verify you can send SMS messages
3) Move the contents of that file into the new system preference
SMSSendAdditionalOptions
4) Verify you can still send SMS messages
5) Delete the file
6) Verify yet again you can still send SMS messages!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Mon, 12 Feb 2024 15:48:06 +0000 (15:48 +0000)]
Bug 6796: day_of_week representation fix
The code here was flawed, DateTime returns a 1-7 indexed array with the
first day being Monday, Koha expects an 0-6 indexed array with the first
day being Sunday.
Sponsored-by: PTFS Europe Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Fri, 9 Feb 2024 16:59:45 +0000 (16:59 +0000)]
Bug 6796: Take CalenderFirstDayOfWeek and TimeFormat into account
This patch adds accounting for the `CalendarFirstDayOfWeek` and
`TimeFormat` preferences in the libraries management pages.
We respect CalendarFirstDayOfWeek for both input and display, but we
only respect TimeFormat for input at this time. We need a new template
helper and js helper for formatting just time in the appropriate format,
currently we only have such formatters for full datetimes.
Sponsored-by: PTFS Europe Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Aleisha Amohia [Tue, 10 Oct 2023 04:06:48 +0000 (04:06 +0000)]
Bug 6796: (follow-up) Displaying library hours
This patch shows the set library hours on a library's view page.
Still to be done:
- show on the Libraries summary page
- write tests
- consider time format settings
- fix translateability of day names in Libraries summary page
Sponsored-by: Catalyst IT Sponsored-by: Auckland University of Technology Sponsored-by: PTFS Europe Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Aleisha Amohia [Mon, 1 May 2023 22:10:44 +0000 (22:10 +0000)]
Bug 6796: (follow-up) QA test tool fixes
Sponsored-by: Catalyst IT Sponsored-by: Auckland University of Technology Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Aleisha Amohia [Fri, 5 Aug 2022 03:00:52 +0000 (15:00 +1200)]
Bug 6796: Don't add a day if hourly loan period pushes due date
If ConsiderLibraryHoursWhenIssuing is set to shorten the loan period to
the closing time, if the loan period initially pushes the due date to
the following day, the day still gets added when calculating the due
date. We simply need to hardcode the due time here as the due day is the
same as the issue day.
We only need to calculate a due date if ConsiderLibraryHoursWhenIssuing
is set to extend the loan period to the next opening day, as we'll need
to consider holidays/closed days.
Sponsored-by: Catalyst IT Sponsored-by: Auckland University of Technology Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Aleisha Amohia [Mon, 1 May 2023 02:56:42 +0000 (02:56 +0000)]
Bug 6796: Fix saving of libraries and tests
Sponsored-by: Catalyst IT Sponsored-by: Auckland University of Technology Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 6796: (follow-up) Fix logic for calculating following day's open hours
Since days for branch hours are stored as 0-6 in the database, when it's
a Saturday (6) incrementing the date leads to an error when issuing an
hourly loan because no opening hours are found for the non-existent day
(7).
This patch fixes this by calculating the tomorrow day and setting it to
0 if it's greater than 6.
This patch also corrects the mappings for days, where local_day_of_week
caluclates the date with Sunday first, which put it out of sync with the
database opening hours days.
Sponsored-by: Catalyst IT Sponsored-by: Auckland University of Technology Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 6796: Consider library hours when calculating due date + tests
This feature adds the ability to set opening and closing hours for your
library and for these hours to be considered when calculating due dates
for hourly loans. If the due date for an hourly loan falls after the
library closes, the library can choose for the due date to be shortened
to meet the close time, or extended to meet the open time the next day.
This feature adds a new table 'branch_hours' for storing the open and
close times per day for each library, and a new system preference
'ConsiderLibraryHoursInCirculation' to choose which behaviour should be
followed when calculating due dates.
To test:
1. Apply patches and update database. Upgrade schema if not applying
patch with schema changes. Restart services.
2. Go to Administration -> Libraries. Edit a library and scroll to the
bottom to find the 'opening hours' section. Test adding and removing
open and close times on various days. Confirm saving works as expected.
3. Add a new library and test adding open and close times works as
expected.
4. Edit your default library and save open and close times for each day.
5. Go to Administration -> Circulation and fine rules. Edit a rule, set
the unit to 'hours' and set the loan period to a number that would cause
a checkout to be due after the close time you just set, i.e. if you set
your close time to be 5pm and your system time is currently 1pm, set the
loan period to be 5 (5 hours) so the calculated due date would be 6pm.
6. Go to Administration -> system preferences. Search for
ConsiderLibraryHoursInCirculation. It should be under 'Checkout policy' in
the Circulation system preferences. Confirm the pre-selected option is
'ignore'. Keep this tab open.
6. In a new tab, get the barcode for an item that has an itemtype
matching the circulation rule you just set.
7. Go to the checkouts for a patron that has a categorycode matching the
circulation rule you just set.
8. Check out your item. Confirm that the checkout is due at the end of
the loan period, not taking closing hours into consideration. Return the
item.
9. Back in your other tab, set ConsiderLibraryHoursInCirculation to
'close', so the due date should be shortened to meet the close time.
10. Check out your item. Confirm the checkout is due when the library
closes. Return the item.
11. Back in your other tab, set ConsiderLibraryHoursInCirculation to
'open', so the due date should be extended to meet the opening time.
12. Check out your item. Confirm the checkout is due the next day when
the library opens.
13. Confirm tests pass t/db_dependent/Circulation/CalcDateDue.t
Sponsored-by: Catalyst IT Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 6796: ConsiderLibraryHoursInCirculation system preference
Sponsored-by: Catalyst IT Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 6796: Add library_hours table and set opening hours for library
Sponsored-by: Catalyst IT Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Magnus Enger [Fri, 5 Apr 2024 13:41:08 +0000 (13:41 +0000)]
Bug 36517: Fix output from install_plugins.pl
When misc/devel/install_plugins.pl does not find any plugins, it prints
the list of pluginsdir, but with a literal \n separating the dirs, and
no newline at the end.
To test:
- Edit koha-conf.xml and add a second entry for <pluginsdir>, so there
are two entries. The second one could just be a copy of the original.
- Run "perl misc/devel/install_plugins.pl"
- Note the output looks something like this:
No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins\n/var/lib/koha/kohadev/pluginsroot@kohadevbox:koha(master)$
- Apply the patch and run the script again. Output should be:
No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins
/var/lib/koha/kohadev/plugins
root@kohadevbox:koha(master)$
- Sign off
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch makes the test independent from existing cash registers in
the system.
To test:
1. Enable UseCashRegisters on a fresh KTD
2. Add a cash register
3. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1/cashups.t
=> FAIL: Tests fail!
4. Apply this patch
5. Repeat 3
=> SUCCESS: Tests pass!
6. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 36581: Define ymd in scope for checkouts table
Test plan:
1. Find or create an item with a public or nonpublic note
(in KTD default data, items on biblionumber 12 have notes already)
2. Check the item out to a patron
--> Checkouts table loading never completes
--> Browser console shows: "Uncaught ReferenceError: ymd is not defined"
3. Apply patch and clear browser cache
4. Refresh the page
--> Checkout table loads and console error is gone
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Lucas Gass [Thu, 11 Apr 2024 08:38:04 +0000 (08:38 +0000)]
Bug 36572: Fix and clean-up set library
To test:
1. Have 3 staff accounts to test:
-STAFF A: superlibrarian
-STAFF B: loggedinlibrary permission
-STAFF C: no loggedinlibrary or superlibrarian permission
2. Enable 'UseCirculationDesks' and create some desks. (Admin >
Circulation desks)
3. Enable 'UseCashRegisters' and create some registers ( Admin > Cash
registers)
4. Use STAFF A ( superlibrarian ) and make sure you can change branch,
desk and register.
5. Use STAFF B ( loggedinlibrary permission ) and make sure you can
change branch, desk and register.
6. Use STAFF C ( no loggedinlibrary or superlibrarian permission ) and
make sure you can change branch, desk and register.
7. Each time you change you should be redirected to the page you were
previously on.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Fix missed case of changing parameter name from "reports" to "id"
To test:
1. Find or create an SQL report that will return more than 20 rows
2. Run the report
3. Change the "Rows per page" drop-down to a new value
--> An empty page is displayed!
4. Apply patch
5. Repeat steps 2-3
--> The report is displayed with the appropriate number of results
Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 35980: Check for CAN_user_borrowers_edit_borrowers in patron-toolbar.inc
This patch removes the 'New patron' and 'Quick add new patron' buttons from the patron tool bar that's included on members-home.pl
To test:
1. Log in with a user with only 'catalogue', 'list_borrowers' and 'manage_patron_lists' permissions
2. From the main page click on Patrons
3. Notice there are 'New patron' and 'Quick add new patron' buttons in the members-home.pl page that lead to permissions errors
4. Apply patch, restart all, reload the page
5. Notice the buttons to add new patrons are gone, but the button to manage patron lists is still there
Signed-off-by: Esther <esther@bywatersolutions.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 35980: Check for CAN_user_borrowers_edit_borrowers in more-member.tt
This patch removes edit buttons and add buttons from the more member page if the user does not have CAN_user_borrowers_edit_borrowers
To test:
1. Log in with a user with only 'catalogue' and 'list_borrowers' permissions
2. Search for a patron
3. Notice there are edit and add (pecil and plus icon) buttons in the patron details page
4. You may have to enable some system prefereences like HouseboundModule to fully test
5. Test that things like Additional attributes and identifiers are still displayed
3. Apply patch, restart all, reload the page
4. Notice the edit and add buttons in the patron details page are gone
Signed-off-by: Esther <esther@bywatersolutions.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 35980: Check for CAN_user_borrowers_edit_borrowers in members-toolbar.inc
This patch removes the message button and more links from the members toolbar if the user does not have CAN_user_borrowers_edit_borrowers
To test:
1. Log in with a user with only 'catalogue' and 'list_borrowers' permissions
2. Search for a patron
3. Notice the 'Add message' and 'More' buttons in the toolbar only link to permissions errors
3. Apply patch, restart all, reload the page
4. Notice the buttons in the toolbar are gone
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Thu, 11 Apr 2024 05:52:53 +0000 (07:52 +0200)]
Bug 30897: Limit to plack environments
I had a feeling we'd want to do this when I submitted the proof of
concept, though I hadn't appreciated the wider issues that have now been
highlighted.. it makes a lot of sense to limit to the plack scope.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Wed, 10 Apr 2024 08:54:48 +0000 (10:54 +0200)]
Bug 30897: Gracefully restart plack after plugin install/remove
This patch adds a graceful plack restart to the plugin
install/uninstall routine to fully allow plugin install to work via the
staff client.
Test plan
1. list your worker processes with something like htop
2. install a plugin
https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases
3. note that the PIDs of the workers stay the same and no sign of
restart (no PID changes and no CPU activity that the workers would
have if they were starting)
4. apply patches and restart services
5. unistall plugin
6. notice worker restart
7. install plugin
8. notice worker restart
9. downgrade plugin
10. notice worker restart
11. upgrade plugin
12. notice worker restart
13. disable and enable plugin
14. *no restart*
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Tue, 9 Apr 2024 15:55:57 +0000 (15:55 +0000)]
Bug 36511: Some scripts missing a dependency following Bug 24879
These files needed the addition of 'use C4::Auth qw( check_cookie_auth
);'.
To test, apply the patch and restart services.
- If necessary, enable the LocalCoverImages system preference.
- Open the browser console and then the "Network" tab. You can click
"Images" to filter for the correct kind of request.
- Perform a catalog search. After the search has loaded, check that
there are no 500 errors in the Network tab.
- Go to Cataloging -> Label creator.
- If necessary, create a label batch and add some items.
- Export your batch and test both the "Download as CSV" and "Download as
XML" links. Both should trigger the correct download.
- Go to Serials -> Claims, and select a vendor with late issues.
- Select all late issues and click "Download selected claims" at the
bottom of the page.
- Your CSV file should download correctly.
The file acqui/check_uniqueness.pl has been corrected as well but I'm
not sure how to test it!
Signed-off-by: danyonsewell <danyonsewell@catalyst.net.nz> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>