Kyle Hall [Wed, 15 Jun 2022 16:06:55 +0000 (12:06 -0400)]
Bug 30969: Cross site scripting (XSS) attack in OPAC authority search ( opac-authorities-home.pl )
There appears to be a cross site scripting attack vulnerability in opac-authorities-home.pl, but may be accessible from any page using C4::Output::pagination_bar.
Test Plan:
1) Use the URL above to show the XSS vulnerability exists
2) Apply this patch
3) Restart all the things!
4) Reload the page, no XSS vulnerability!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Martin Renvoize [Wed, 15 Dec 2021 09:20:52 +0000 (09:20 +0000)]
Bug 29504: (follow-up) Account for other blockers
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7a7716b6d8039476a6cc2d6403092cc2df42458e)
Martin Renvoize [Mon, 22 Nov 2021 11:33:25 +0000 (11:33 +0000)]
Bug 29504: Allow 'ADDITIONAL_MATERIALS' check to be confirmed
The additional materials check when CircConfirmParts is enabled was
errantly relying upon the 'FORCE_CHECKOUT' permission. This patch
updates the template to allow confirmation as well as cancellation of
chekout.
Test plan
1. Set a staff member with circ permissions, but not FORCE_CHECKOUT
2. Turn on CircConfirmItemParts
3. Log in as staff member in step 1
4. Attempt to checkout an item with a 952$3
5. The only option given is the Continue button (with a red X) and when
clicked, the item does not get checked out.
6. Apply patch
7. Repeat step 4.
8. You should now have the option to 'Yes, check out (Y)' or
'No, don't check out (N)'
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 49ef741405d0b81ba0cb37dd81fa9a4b5aba5bbb)
Jonathan Druart [Mon, 7 Mar 2022 10:30:35 +0000 (11:30 +0100)]
Bug 30234: Fix local cover image display for other holdings
Bug 26145 added the ability to add local cover images to items.
If SeparateHoldings is set, items from other libraries are displayed in
a separate tab, and not considered as visible. We have a JS test to
assume that images not shown are not present, this only apply for the
images for the bibliographic record, as they can come from different
sources.
Test plan:
Turn on LocalCoverImages and SeparateHoldings
Create a record with different items coming from different libraries
Attach images to items and to the biblio
Notice that with this patch you can see the images from the "Other
holdings" tab
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 54734f68f21a2d4d248e339d144b67e071317236)
Fridolin Somers [Thu, 2 Jun 2022 07:23:23 +0000 (21:23 -1000)]
Bug 30883: Authorities merge is limited to 100 biblio with Elasticsearch
In C4::AuthoritiesMarc::merge, we search all biblio records using an authority with Koha::Authorities->linked_biblionumbers().
This method uses simple_search_compat() with no results limit, even saying in comment :
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/Authorities.pm#L80
With Zebra searchengin it is correct.
But not with Elasticsearch, there is an hardcoded limit at 100 in case no limit is given :
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/SearchEngine/Elasticsearch/Search.pm#L346
This means authorities links are wrong after a merge or an edit in case the authority is used in more than 100 biblio records.
:(
I propose to fix by using by default the real server max given by Koha::SearchEngine::Elasticsearch::Search::max_result_window().
This will allow a huge limit nearly impossible to reach.
See Bug 30882 to how increase this limit.
Test plan :
1) Use Elasticsearch search engine
2) Use an authority id=111 linked to 200 biblio records
3) Perform a search 'an:111', you get 200 results
4) Create a new authority id=222 linked to 2 biblio records
5) Perform a search 'an:222', you get 2 results
6) Perform a merge of the two authorties, keeping id=222
7) Perform a search 'an:111'
without patch you get 100 results
with patch you get no results
8) Perform a search 'an:222'
without patch you get 102 results
with patch you get 202 results
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 48d4b016ab8f5b7199efe75384c592e39e5dfce6)
Nick Clemens [Thu, 23 Jun 2022 17:29:26 +0000 (17:29 +0000)]
Bug 31005: Don't inlcude attributes only required for other categories
To test:
1 - Create a new patron attribute - check boxes to make it mandatory and visible etc.
2 - Limit it to 'Patron' or other category
3 - Edit a patron not in that category
4 - Attempt to save
5 - 500 Error
6 - Missing mandatory extended attribute (type=MAND)
7 - Apply patch
8 - Attempt aedit again
9 - It succeeds!
10 - Edit a patron in the category with MAND required
11 - on the edit page, right click teh attribute - click 'delete node'
12 - Submit the form
13 - 500 error, but this time that's good, the attribute check works
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bc0264bae4769fc75133f0e10f13fc6edd86f016)
Nick Clemens [Thu, 23 Jun 2022 17:22:53 +0000 (17:22 +0000)]
Bug 31005: Unit test
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39c39430766f66008a465e1d023830c49b1f6122)
Shi Yao Wang [Fri, 15 Apr 2022 16:37:34 +0000 (12:37 -0400)]
Bug 30551: Make cash register report take branchcode from cash register
This patch makes it so cash register reports puts branchcode from the
cash register where the payment was made into "Transaction library"
column instead of taking the branchcode of the manager.
Test plan:
1- Use cash registers (administration > system preferences > UseCashRegisters)
2- Create another library if you only have one (administration > libraries > new library)
3- Create a cash register in each library if they don't already have one (administration > cash registers > new cash register)
4- Create a fee on your own account and pay it right after in both libraries.
5- Go to reports > cash register and generate the statistics.
6- Notice "transaction library" in both rows are the same even though the fees were paid in two different libraries and two different cash registers.
7- Apply the patch and click submit to re-generate statistics
8- Notice it now shows the correct library where the transactions were done
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43299fe5cc1c8110112a76ba88e9ab03aaeda43c) Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit bb8602c19045c40c283fdff07fae5ee4edcfc5bf) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 29418: (follow-up) Fix links generated in XSLTs
This patch addresses the case of links that are generated on the XSLT
side, those linking to host records using 773$t and 773$a.
To test:
1. Repeat the test plan from the other patches
2. When sitting on the detail view of the host record, click on the link
to open the child.
=> SUCCESS: The link works, because of the previous patches
3. Click on the 'In:' link so the search takes you to the host record
=> FAIL: The link leads no results
4. Apply this patch
5. Restart all
6. Reload the child record page and click on the link
=> SUCCESS: Voila! The host record is retrieved!
7. Bonus points: Retry the full test plan, but add a " or ? to the
author in both host and child records
=> SUCCESS: Things don't work before this patch, and work afterwards.
8. Sign off :-D
Sponsored-by: Theke Solutions Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 29418: Make detail rendering use the cleaned-up title for searching
This patch makes both staff and OPAC detail pages generate a valid
search link so you can trace related records in the Show analytics
link.
To test:
1. Pick a bibliographic record (I chose 'Unconditional' from the sample
data
2. Add " and ? to the title statement. I changed it to
'Uncond"itional?¿'
3. Add a child record to it
4. Open the detail page for the host record
=> FAIL: It doesn't show the 'Show analytics' link
5. Repeat 4 for the same record, in the OPAC
=> FAIL: It doesn't show the 'Show analytics' link
6. Apply this patch
7. Repeat 4 and 5.
=> SUCCESS: Links are shown!
8. Follow the links
=> SUCCESS: The links take you to the right resultset!
9. 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: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 29418: Make clean_search_term escape double quotes
We noticed that several characters will break Zebra queries. So search
terms need to be quoted for things to work. In this context, double
quotes inside search terms are problematic because double quotes are
what we use for quoting strings.
This patch makes the clean_search_term method escape double quotes.
To test:
1. Apply the unit tests patch
2. Run:
$ kshell
k$ prove t/Koha/SearchEngine/Zebra/QueryBuilder.t
=> FAIL: It doesn't work as it should!
3. Apply this patch
4. Repeat 2
=> SUCCESS: It does the job!
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: Victor Grousset/tuxayo <victor@tuxayo.net>
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: Victor Grousset/tuxayo <victor@tuxayo.net>
Fridolin Somers [Thu, 19 May 2022 03:50:13 +0000 (17:50 -1000)]
Bug 30781: Fix warning in GetPreparedLetter
Test by running :
prove t/db_dependent/Letters.t
Check you dont see warning :
Use of uninitialized value $val in substitution iterator
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 34b84b68e509c9172b850dad4dbc5b7e9f518225)
Fridolin Somers [Thu, 19 May 2022 03:47:18 +0000 (17:47 -1000)]
Bug 30781: Add unit test for substitute with undefined value
Add unit test that generates warn.
This may be usefull as no regression test.
Run prove t/db_dependent/Letters.t
You see warn :
t/db_dependent/Letters.t .. 1/84 Use of uninitialized value $val in substitution iterator at /kohadevbox/koha/C4/Letters.pm line 607.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2e0243c378158755660d7bc95e15ad32dd6d0ebf)
Nick Clemens [Thu, 24 Mar 2022 15:31:05 +0000 (15:31 +0000)]
Bug 30354: Don't assign warn as letter
TO test:
1 - Check out an item marked for autop renewal to a patron and make it overdue
2 - Set system preference AutoRenewalNotices to follow messaging prefs
3 - set that borrower to receive both email and SMS AUTO_RENEWALS_DGST
4 - confirm your AUTO_RENEWALS_DGST does not have SMS content but does have email
5 - run the auto_renew cron
6 - item is renewed, but error from cron, and cron dies:
No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583.
no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/automatic_renewals.pl line 305.
Can't use string ("1") as a HASH ref while "strict refs" in use at /kohadevbox/koha/C4/Letters.pm line 898.
7 - Apply patch
8 - Make item eligible for auto renewal agian (or checkin/checkout)
9 - Run the cron
10 - There is still 2 warn, but cron does not die:
No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583.
no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/ automatic_renewals.pl line 305.
11 - Patron receives email and item is renewed
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b4685ca2054d7b5484f09c4c879fb36919443a13) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 30663: Implement overrides handling in POST /suggestions
This patch implements the override checks in the controller as expected
by the previous patch.
To test:
1. Apply this bug patches up to 'Add x-koha-override options...'
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/suggestions.t
=> FAIL: Tests fail! The controller doesn't care about overrides or
sysprefs about suggestions limits.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Things work!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ce9664e1b01e9f3dc807855d76927b9184453aee) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 30663: Add x-koha-override options to /suggestions
This patch adds the x-koha-override header parameter to the route that
is used to create suggestions, POST /suggestions.
The idea is that adding suggestions will be rejected under certain
conditions unless x-koha-override is passed with appropriate values. The
added overrides are:
* any
* max_total
* max_pending
Tests are added for the expected behavior.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 25317416e62a267a4f4b06cf35f37ad38e04b40a) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This methods follow basically what's done in opac-suggestions.pl
I chose 'pending' as opposed to 'open' to follow what we use in the UI
which might be the case because of being more accurate for end users.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Suggestions.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 54dbb852486b004a73dc6aabae6dda4fcecb2573) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Jonathan Druart [Thu, 28 Apr 2022 08:32:28 +0000 (10:32 +0200)]
Bug 30628: Fix patron selection in batch patron modification tool
bug 28014 added Datatables to this view, but the form is submitted with
only the checkboxes from the first page.
Solution adapted from https://stackoverflow.com/questions/33240409/how-to-submit-checkboxes-from-all-pages-with-jquery-datatables
Test plan:
Have more than 20 cardnumbers, use the batch patron modification tool
Select (not all) patrons from the first page and second page
Submit the form
Notice that the patrons you have selected appear on the confirmation
page.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7e053bf5462494cf91f2f2be745416d2d7ad261b) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Martin Renvoize [Mon, 25 Apr 2022 14:37:33 +0000 (15:37 +0100)]
Bug 30610: Update on click binding for print receipt
This patch updates the binding for the on click even of the print
receipt button so that subsequent pages in the datatable work with the
reciept printing button.
Test plan
1) Enable cash management and process enough transactions to display
more than one page of transactions in the register details page.
2) Confirm the 'Print receipt' button works on the first page of
transactions
3) Confirm the 'Print receipt' button works on subsequent transactions
pages in the datatable.
4) Confirm the same for the past transactions table.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 126c70c982089c74c75d1c99d33c01c9cc4cf001) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Jonathan Druart [Thu, 28 Apr 2022 07:43:06 +0000 (09:43 +0200)]
Bug 30630: Prevent crash on check-in if HoldsAutoFill is ON
RevertWaitingStatus has already removed the itemnumber from the hold, passing $itemnumber (from scanned item) should work, as it will reattach the hold to the item
Test plan:
1 - Enable HoldsAutoFill
2 - Place a title level hold
3 - Check in an item and confirm hold
4 - Switch to another branch
5 - Checkin the item
Without this patch you got
Can't call method "biblionumber" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1577.
at /kohadevbox/koha/C4/Reserves.pm line 1576
With this patch applied the operation succeeds
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 73a2e3558944effbdb4a19e6c8a331679d41fcf8) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 333b698d6264859d6cae3ab112cca6c4ce52c623) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Nick Clemens [Fri, 4 Mar 2022 16:19:35 +0000 (16:19 +0000)]
Bug 24001: Fix Card template/rpinter profile creation and edit
This patch adjusts the template/profiles to use the default of '0'
This should probably be NULL, and the columns foreign keys, this code
could use a further rewrite, but this should fix a long standing bug
To test:
1 - Using the fresh install, with all the sample data.
2 - Go to Home › Tools › Patron card creator › Templates
3 - New > Card template
4 - Save
5 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'profile_id' at row 1
6 - Edit an existing template
7 - Save
8 - Error: Can't bless non-reference value at /kohadevbox/koha/C4/Creators/Profile.pm line 89
9 - Create a new 'Printer profile'
10 - Save
11 - Error: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'template_id' at row 1
12 - Apply the attached patch.
13 - Verify you can create a new 'Card template' and 'Printer profile' with no errors
14 - Verify you can edit and save both of the newly created objects above
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 65c784d3fd9b745613c35c84bef10422a7170043) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Blou [Tue, 30 Jun 2020 16:50:09 +0000 (12:50 -0400)]
Bug 24001: Fix patron card template edition
Error when saving Patron card Template:
Can't bless non-reference value at
/home/vagrant/kohaclone/C4/Creators/Profile.pm line 89
This is caused by the profile dropdown offering invalid choices and is
fixed by adding a filter to limit options to creator = 'Patroncards'.
The UI already handles the case where no valid profile is avaiable.
Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.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.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8be82f861621cdf86bcd4b683254365542897ed4) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 30212: Make Select2 available for ILL backends
This patch makes select2 available for ILL backend developers to use on
their templates.
To test:
1. Have a configured backed and an ILL request
2. Open the inspector and load any action on the backend (intranet)
=> FAIL: no select2 asset is transfered from Koha to the browser
3. Apply this patch
4. Reload
=> SUCCESS: There's select2
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: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c864cc73e58daa37bbfc71a5629ece7625579fbe)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Fri, 18 Mar 2022 09:26:48 +0000 (10:26 +0100)]
Bug 30199: Do not generate jwt if patron does not exist
This is a follow-up patch for bug 29543. If an invalid cardnumber has
been used we should not generate a token.
Test Plan:
1. Set SelfCheckoutByLogin to 'cardnumber'.
2. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
3. Enter an invalid carnumber like 'thisisabadcardnumber'
4. See the appropriate message "Sorry The userid thisisabadcardnumber was not found in the database. Please try again."
5. Try again with a different cardnumber and notice the same exact error message including the 'thisisabadcardnumber' cardnumber.
6. Apply this patch
7. Restart all the things!
8. Repeat steps 2-4
9. Try again with a different cardnumber, you should now see the correct
cardnumber!
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e5aeb047a563b20769d49c2777d47039581ca7bd)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Fri, 22 Apr 2022 09:42:09 +0000 (11:42 +0200)]
Bug 30595: Prevent update_child_to_adult.t to fail randomly
t/db_dependent/selenium/update_child_to_adult.t .. # Looks like you planned 3 tests but ran 2.
# Failed test 'Update child to adult'
# at t/db_dependent/selenium/update_child_to_adult.t line 132.
# Looks like you planned 3 tests but ran 2.
# Looks like you failed 1 test of 2 run.
t/db_dependent/selenium/update_child_to_adult.t .. 1/1
# Failed test 'Update child to patron'
# at t/db_dependent/selenium/update_child_to_adult.t line 153.
Cannot wait more for element '//input[@type="submit"]' to be visible at /kohadevbox/koha/t/lib/Selenium.pm line 189.
It happens when there are too many patron's categories and the submit
button is not in the viewport.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit faa35972b038b9df0459a582ced73e98adb897cc)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Lucas Gass [Mon, 11 Apr 2022 19:35:14 +0000 (19:35 +0000)]
Bug 30346: Correctly transfer values when editing rules
To test:
--Create a circulation rule with a value in "Overdue fines cap (amount), or edit an existing rule to add it
-Save the new (or edited) rule.
-Edit the same rule again to change any other field. Note that "Overdue fines cap (amount)" is now blank
-Save your edited rule - "Overdue fines cap (amount)" will save as blank.
Apply patch
--Create a circ rule with a value in Overdue fines cap (amount) and check "Cap fine at replacement price" for that same rule.
-Save the rule
-Try ediding the rule and make sure both of those values now save correctly.
-Add several more rules and try playing with both "Cap fine at replacement price" and "Overdue fines cap (amount)". Make sure everything saves right.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f69e3b364f13cb6dbcf9aa12d3d21fea8c1f3798)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Thu, 14 Apr 2022 10:51:18 +0000 (10:51 +0000)]
Bug 30540: Fix perl critic complaint of leading zeros
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8cc4961143756681ec1b9e1639bad6bb5198b7cf)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Martin Renvoize [Thu, 14 Apr 2022 08:14:47 +0000 (09:14 +0100)]
Bug 30540: eval on set_time_zone
This patch adds an eval around the call to set_time_zone so that we
don't crash on invalid local dates and instead just keep the passed
floating timezone.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6dab34fe66d41b367141f8e1b96abfe1729d045b)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Martin Renvoize [Thu, 14 Apr 2022 09:19:47 +0000 (10:19 +0100)]
Bug 30540: Unit test
This patch adds tests for checking the output_pref method against
a timezone and datetime that would cause an Invalid local time failure
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/DateUtils.t
=> FAIL: The feature is not implemented, tests fail to complete
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 052dd948af6eaaaeeb0e83a6950543b4832aeefe)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Martin Renvoize [Wed, 13 Apr 2022 07:24:22 +0000 (08:24 +0100)]
Bug 30518: Correct DateTime maths for needs_advancing
The needs_advancing method prior to this patch used basic DateTime
arithmatic, adding a DateTime::Duration in Days to the Arrival date of
the item and then comparing that to today. This, however, can cause bugs
when the arrival + duration date coincides with a DST boundary and as
such may result in an invalid local date. See
https://metacpan.org/pod/DateTime#Making-Things-Simple for further
details.
This patch updates the code to use the DST safe delta_days method to
count the days between arrival and now instead and then compares this
integer to the defined duration of the stage.
To test:
1. Re-run the unit tests, they should now pass.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3929335cdbea81c7c891a8a979d69861468502fd)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Martin Renvoize [Wed, 13 Apr 2022 07:52:02 +0000 (08:52 +0100)]
Bug 30518: Unit test
This patch adds tests for checking the needs_advancing method against
a timezone and datetime that would cause an Invalid local time failure
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/StockRotationItems.t
=> FAIL: The feature is not implemented, tests fail to complete
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4450ad21100a02055e3f0f05918b2d4b17852107)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Thomas Klausner [Mon, 21 Feb 2022 11:35:15 +0000 (12:35 +0100)]
Bug 30142: Remove spaces from ElasticSearch mapping MARC fields
A first step to "validate" the MARC mappings: Remove all whitespace, so
if a user enters "245a " (with a trailing whitespace, which can easily
happen when copy/pasting) we only store "245a" in the DB. This is
neccessary, because the ES indexer will throw an exception in an invalid
MARC mapping.
Test Plan:
* Go to /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
* Go to the Bibliographic Records Tab
* Enter "100 a b c " (notice the whitespaces!) in the first "mapping"
field
* Scroll down and save
* Go back to the Bibliographic Records Tab
* The spaces are still there
Now apply the patch
* Repeat the above steps
* After saving you should see "100abc" without any spaces in the
"mapping" field
Sponsored-by: Steiermärkische Landesbibliothek Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0dbb236d891b69f09ab06a62e2679755ea36621c)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Julian Maurice [Fri, 1 Apr 2022 08:16:09 +0000 (10:16 +0200)]
Bug 30406: Add column filters before hiding columns
The code that adds column filters works only on visible columns, so we
should hide columns after filters are created
Test plan:
1. Apply patch
2. Go to Tables settings. Hide city_state for the cities table.
3. Create some cities and go to the cities page
4. Verify that filtering works as expected.
5. Make the city_state column appear. Verify that filtering on this
column works too
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 37594d77377dc4b0784d497d70aee05977277dee)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Mason James [Sat, 5 Mar 2022 02:30:21 +0000 (15:30 +1300)]
Bug 19169: Add a test to detect unneeded 'atomicupdate' files
to test...
1/ set git repo
$ git reset --hard v21.11.03
2/ run test
$ prove ./t
OK
3/ apply patch
4/ run test again, observe FAIL
$ prove ./t/00-check-atomic-updates.pl
./t/00-check-atomic-updates.pl .. 1/?
# Failed test 'check for unhandled atomic updates: bug_29596.pl'
# at ./t/00-check-atomic-updates.pl line 34.
# 'bug_29596.pl'
# matches '(?^u:.*pl$)'
# Looks like you failed 1 test of 3.
./t/00-check-atomic-updates.pl .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests
JD Amended patch: fix copyright year Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1d24015e46c3127497aac31b2baddad547e4e8b3)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This patch tackles a very specific scenario. Calling split(...,
CGI::param) makes it be called in list context. The split docs say:
split /PATTERN/,EXPR,LIMIT
this means the first CGI param will be used as EXPR and the second one
as LIMIT, which is wrong anyway. So the fix is to just force scalar
context.
To test:
1. Not sure, just make sure nothing breaks when using the scripts in the
browser.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e5dc760b92bd939245c3d24a0cfa3db99f9ac764)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
I squashed the patches because they are too trivial to have a test plan.
Or it is too much work to write the test plan for such trivial cases. I
leave the original commit messages just in case.
Generally, this are all cases in which CGI::param is being called in a
trivially identifiable _list context_. i.e. they are assigned to a
@variable.
I left one case out on purpose: admin/auth_subfields_structure.pl
Paul introduced this:
my @kohafield = ''.$input->param('kohafield');
and then:
my $kohafield = $kohafield[$i];
My intuition says it is forcing scalar context on the first assignment
so the list contains a single element and then inside the loop some
$kohafield assignments should lead to undef, and even warnings. I leave
it for a separate patch because it is not that easy testable and is a
sensible area.
Bug 29771: Remove warning from acqui/finishreceive.pl
This patch removes a warning that shows when receiving.
To test:
1. Do the acq workflow up to the receive step.
2. Once you choose the items and click on Finish
=> FAIL: There's a warning in the logs
3. Revert receipt
4. Apply this patch
5. Receive
=> SUCCESS: No more warnings
6. Sign off :-D
Bug 29771: Remove warning from svc/members/add_to_list
To test:
1. Run:
$ tail -f /var/log/koha/kohadev/*-error.log
2. Generate a patron list
3. Perform a patron search that gives you a few
4. Select some, and choose to add them to the list
=> FAIL: The logs show the infamous warn:
CGI::param called in list context from /kohadevbox/koha/svc/members/add_to_list
5. Apply this patch
6. Restart plack and repeat 4
=> SUCCESS: No warn!
7. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1cfa7e38458b0e644ba7a34ae81520987071eca1)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Thu, 21 Apr 2022 14:30:24 +0000 (16:30 +0200)]
Bug 30583: Fix hold system for translated templates
There are missing quotes, and the translate script is messing up with
the generated template.
Error is:
Template process failed: file error - parse error - holds_table.inc line 216-217: unexpected token (hold)
The generated line, without this patch is:
216 <td><input %]="%]" class="printholdslip" data-reserve_id="[%" hold.reserve_id="hold.reserve_id" html="html" name="printholdslip" type="button" value="Recibo" |="|"></td>
With this patch applied:
216 <td><input class="printholdslip" data-reserve_id="[% hold.reserve_id | html %]" name="printholdslip" type="button" value="Recibo"></td>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Kyle M Hall [Wed, 30 Mar 2022 16:34:55 +0000 (16:34 +0000)]
Bug 30118: (QA follow-up) Fix Perl Critic issues
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 61468ffe6d201cdb1257923d9fed575ffb5911cb)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Bug 30118: Make holds_block_checkin in SIP behave like in Koha interface.
In koha interface, a warning is displayed when an item on hold is returned
only if the return is for this specific item.
This patch does the same in SIP: the return is blocked when holds_block_checkin
is enabled and there is a hold on a specific item and this is the very item
being returned.
Test plan:
The following behavior is expected in SIP:
- An item is returned, and there is a reservation on record-level: block
- An item is returned, and there is a reservation on this very item: block
- An item is returned, and there is a reservation on another item: allow
Signed-off-by: Sonia <sonia.bouis@univ-lyon3.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 41abb100c3d3e5cf97473abf06337e49f9b44710)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Kyle M Hall [Thu, 14 Apr 2022 10:50:20 +0000 (06:50 -0400)]
Bug 30541 - Resolve return claim works but "hangs" if MarkLostItemsAsReturned is set for return claims
Basically, if MarkLostItemsAsReturned is set for return claims, the code will crash while trying to pull the checkout so it can update the lost status of the item. This is because the code assumes there must be a checkout and never checks the old_checkouts table.
This bug appears to only exist in 21.05 at this time. It was fixed by a combination of bugs 29495 and 28588.
Test Plan:
1) Set MarkLostItemsAsReturned for return claims
2) Mark a checkout as claims returned
3) Verify the checkout is no longer on the patron record
4) Resolve the claim
5) Note the attempt "hangs" but refreshing the page shows it worked
6) Apply this patch, restart all the things!
7) Repeat steps 2-4
8) It works!
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Christine Lee <chlee@pascolibraries.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Thu, 24 Mar 2022 15:24:06 +0000 (16:24 +0100)]
Bug 30172: Enqueue the job even if rabbitmq is not reachable
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ce24a745c30f807587857e2f9449176ad4f78291)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Thu, 24 Feb 2022 09:41:16 +0000 (10:41 +0100)]
Bug 30172: Prevent race condition when enqueuing a new task
As we are sending the job to the rabbitmq before in the transaction, the
worker can receive the job to process before the transaction committed.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 40a329474486ffdef145466ddb66d65060d656ac)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Fridolin Somers [Tue, 18 Jan 2022 19:49:09 +0000 (09:49 -1000)]
Bug 29704: (RM follow-up) Fix typo sned send
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1b1612170918241acca97ac34c16965378b4bd32)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b392547ab6937abafcd2e964f9d7490f1426a51c)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Fri, 25 Mar 2022 08:05:18 +0000 (09:05 +0100)]
Bug 30222: Remove warning
Use of uninitialized value in string ne at misc/cronjobs/automatic_renewals.pl line 193.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6f574f6747b03bdf4d48a0a134da38b4a0442fe7)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Tue, 15 Mar 2022 13:34:39 +0000 (13:34 +0000)]
Bug 30222: Further simplify logic
For any borrower, we are either:
1 - following their preference, and that should set 'wants_email'
OR
2 - Never sending / following the cron, and can determine 'wants_email'
from the 'send_notices' variable
This patch adds an 'else' if not using preferences to accomplish this
Follow test plan on previous patches
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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 92c8bc7e4b7d39b5a4deb21ff3bc4bc6cce28c40)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Fri, 11 Mar 2022 13:24:33 +0000 (13:24 +0000)]
Bug 30222: Simplify logic for reporting
This patch adds two new variables:
$wants_email and $wants digest
These are used to simplify checks on whether notices should be sent
To test:
1 - Apply patch
2 - Confirm notices are not sent of pref is 'cron' and send_notcies flag not set
3 - Confirm notices are sent if pref is cron and send_notices flag is set and borrower
does not have preference set for auto renewals
4 - Confirm notices not sent if pref is set to follow messaging preference and borrower
does not have preferences set for auto_renewals
5 - Confirm regular notices sent if pref is set to follow messaging preferences and borrower
does have the preference set but not digest
6 - Confirm digest notices sent if pref is set to follow messaging preferences and borrower
does have the preference set and wants digest
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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 17f1793ba952e3a95f98ec777d56486611b7036d)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Fri, 11 Mar 2022 12:00:26 +0000 (12:00 +0000)]
Bug 30222: Only send auto renewal digest wehn there is an update
Currently, the code sends an email to the patron when there is any error that is not
'too_soon' - we also don't include issues that are 'too_soon', so emials may be missing information
This patch changes the code to:
1 - push all issues that were checked to the report when a borrower wants a digest
2 - adds a variable to track when any of the issues has been updated, and checkes this when
sending digests
3 - if nothing has been updated, no report is sent to the patron
To test:
1 - Checkout an item, marked for autorenewal, backdated to be overdue to a patron
2 - Set preferences
AutoRenewalNotices = 'according to patron messaging preferences'
EnhancedMessagingPreferences = 'Allow'
3 - Set the patrons preference for auto renewal to email+digest
4 - Ensure the patron has an email
5 - Place an item level hold for another patron on the issued item
6 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
7 - Check patron record/notices tab
8 - Note item not renewed, patron notified
9 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
10 - Note item not renewed, status not changed, patron notified again
11 - Apply patch
12 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
13 - Item not renewed, patron no notified
14 - Checkout another item marked for auto renewal to the patron, but due in the future
ensure it is outside of 'no renewal before'
15 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
16 - Patron not notified, items not renewd
Change to status of 'auto_too_soon' is not notified
17 - Checkout a third item, marked for auto renew, overdue
18 - place an item level hold for another patorn on third item
19 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
20 - patron is notified, nothing renewed, all statuses reported
21 - cancel the item level hold on third item
22 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
23 - item renewed, patron notified, all statuses reported
24 - perl misc/cronjobs/automatic_renewals.pl -v --confirm
25 - nothing renewed, patron not notified, only change is one issue 'auto_too_soon'
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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3fac0c7aee782f96867d2384422962b038c5f7aa)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Mon, 21 Mar 2022 14:56:21 +0000 (15:56 +0100)]
Bug 26328: Add test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 68664b7b706945ad0d9176be69dd5fe71a0bd13b)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
David Cook [Fri, 4 Dec 2020 05:36:04 +0000 (05:36 +0000)]
Bug 26328: Cast barcode from varchar to integer for incremental barcode
Without this patch, the incremental barcode generation will
treat 978e0143019375 as having an exponent and interpret it as a very
large number.
With this patch, the incremental barcode generation will first cast
barcode varchar strings to integers before finding a max() value.
In this case 978e0143019375 becomes 978 instead of
1.7976931348623157e308
Test plan:
0. Using koha-testing-docker
Before applying patch:
1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=autobarcode
2. Set to "generated in the form 1, 2, 3"
3. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=1#additema&searchid=scs_1607059974968
4. Add item with barcode 978e0143019375
5. Click "p - Barcode"
6. Note the barcode is "Inf"
After applying patch:
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=1#additema&searchid=scs_1607059974968
2. Click "p - Barcode"
3. Note the barcode is "39999000019194"
Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 445cbb373bc7756494a4b28cede53ec23942999e)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Fri, 8 Oct 2021 13:57:31 +0000 (15:57 +0200)]
Bug 29020: Add link on the admin module
It works! P1 and P2 are inverted in the test plan, but
the principle that user with manage permission accesses
bg jobs from the admin page and user who do not only
have access through main page is there.
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ca55dc3e42c77f41f8c0cf66e6db9aeda4e66842)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Fri, 8 Oct 2021 13:53:02 +0000 (15:53 +0200)]
Bug 29020: Add link on the mainpage for users without admin access
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fde5d5f7019728f56a8e16433e52c17dd021dffa)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Owen Leonard [Thu, 3 Mar 2022 16:45:43 +0000 (16:45 +0000)]
Bug 30220: Purchase suggestion defaults to first library
This patch updates the OPAC suggestions form to update the variable
used to pre-select the logged-in user's library.
To test, apply the patch and make sure the "suggestion" preference is
set to "Allow."
- Log in to the OPAC and click "your purchase suggestions" in the
sidebar menu on your summary page.
- Click "New purchase suggestion."
- The selected library should match the logged-in user's home library.
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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit caf905ca385b09b66c356fdd40315e1cdc8037e9)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Mon, 7 Feb 2022 08:26:12 +0000 (09:26 +0100)]
Bug 30035: Fix month name in prediction pattern
We are using %B to display the month name but it seems that using the
CLDR pattern LLLL would be more appropriated.
https://metacpan.org/pod/DateTime#CLDR-Patterns
%B - The full month name.
LLLL - The wide stand-alone form for the month.
For instance in Catalan:
https://metacpan.org/pod/DateTime::Locale::ca
%B will display "de gener" when LLLL will be "gener"
Test plan:
Create a new numbering pattern:
Home > Serials > Numbering patterns > New numbering pattern
Numbering formula: {X}
Label: monthname
Add: 1
Every: 1
Set back to: 1
When more than: 999
Formatting: Name of month
And test it at the bottom of the form
Locale: Catalan
The number column should contain "gener", not "de gener"
Test other locales and confirm that the output is correct (no change
expected for English, French and Spanish for instance).
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 93c33c527fdbfad0f46bc26a6b3496cba7d02fbb)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Lucas Gass [Wed, 27 Oct 2021 21:58:44 +0000 (21:58 +0000)]
Bug 29338: Add print hold/transfer button to request.tt
1. Apply patch
2. Make some holds, have some item level and some bib level
3. On request.tt notice a new column on the holds_table called 'Print hold/transfer slip'
4. Make sure the button works and takes you to the proper hold/transfer slip
5. Make sure it works well with both item/bib level holds
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a68021a2387ff1caf854c17fc5331e85926c1f7e)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Owen Leonard [Tue, 18 Jan 2022 12:46:51 +0000 (12:46 +0000)]
Bug 29482: Replace the term branch with library
This patch replaces the word "branch" with the word "library" in the
self-checkout template, as per terminology guidelines.
To test, apply the patch and go to Administration -> System preferences.
- Set the "IndependentBranches" preference to "Yes."
- Log into the self checkout system using a staff user with permission
to do self-checkout but not superlibrarian status.
- Try to check out an item which belongs to a library that's different
to the one you're logged in with.
- You should see a message, "Item cannot be checked out," including the
text "This item belongs to another library."
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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 323428543012e9390c11463256d90a6105352625)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Bug 29875: Update wording on maxreserves system preference
To test:
1 - see the current wording
2 - apply patch
3 - words are changed
Test to confirm accuracy of wording:
1 - set maxreserves to 1
2 - set all/all circ rule to unlimited holds allowed total, holds allowed daily, and holds per record
3 - confirm you can place 1 hold for a patron, but the second is blocked
4 - set maxreserves to 0
5 - confirm you can place and number of holds for the patron
6 - set maxreserves to blank
7 - confirm you can place any number of holds for the patron
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a6e54eea79ae0097aa8936e0a75d63bf52b51951)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Fridolin Somers [Sat, 22 Jan 2022 01:57:28 +0000 (15:57 -1000)]
Bug 28943: (QA follow-up) Fix opac.pref
Fix YAML syntax of opac.pref, we must use dash for new lines.
Also removes duplicate text before syspref.
No need to say "code" since it is now a list of categories.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 31fffa6006bf25bfa303fa44f4ae56f461cebb59)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Bug 28943: Lower the risk of accidental patron deletion
If you do not use a temporary self registration patron category,
you should actually make the preference
PatronSelfRegistrationExpireTemporaryAccountsDelay empty.
As the comment in sysprefs.sql already said, we should not let
a zero value in the pref delete patrons too.
The module is changed now, the test adjusted and
the description of both related sysprefs modified.
Test plan:
Run t/db_dependent/Members.t
Check in Administration the two adjusted OPAC pref descriptions.
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: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8e500c57da0e33b517c13715d3a17271fe47c286)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Fri, 25 Feb 2022 20:04:41 +0000 (20:04 +0000)]
Bug 22993: Handle default messaging preferences during patron creation from API
TO test:
1 - Set default messaging preferences for a patron category
2 - Create a patron in that category using the API
3 - Verify messaging preferences are not set
4 - Apply patch, restart all
5 - Create another patron
6 - Verify messaging preferences are correctly set
7 - prove -v t/db_dependent/api/v1/patrons.t
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1e02087923230e5c6ecad66dcf1288a196ba2c81)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Fri, 25 Feb 2022 20:04:14 +0000 (20:04 +0000)]
Bug 22993: Unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c5577fa6ba3c7a29acbe83cde82b3195ef32ef86)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Marcel de Rooy [Thu, 3 Mar 2022 10:27:20 +0000 (10:27 +0000)]
Bug 30203: Circulation.t: prevent locking by setting envvar
Running this test without prove is disastrous. The LOCK in
the called SendCirculationAlert will ruin your data.
But no longer when you apply this patch.
Test plan:
Run prove Circulation.t
Inspect your data (e.g. borrowers table).
Run perl Circulation.t
Inspect your data (e.g. borrowers table) again.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ac53c18af0896115db7cb8f7e9fd6c09ed3fd243)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Mon, 14 Feb 2022 18:38:16 +0000 (18:38 +0000)]
Bug 30098: Only redirect from patron search if single result is on first page
This patch simply adds a check that we are oin the first page (starting at result 0)
before redirecting to a isngle patron
To test:
1 - Perform a patron search that returns 41 results, on Koha testing docker, 'a' works
2 - Go to second page of results, works
3 - Go to third page of results, redirected to the patron
4 - Apply patch
5 - Repeat search and paging
6 - On third page you remian in results and are not redirected to patron
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e77ca95756919ab1630a35b1c69e0fdc41289f27)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Marion Durand [Mon, 18 Oct 2021 12:35:21 +0000 (14:35 +0200)]
Bug 26269: "Date due to" and "Show any items currently checked out" filters doesn't work properly in overdues.pl
Filter "Date due to" is now taken into account even when filled with a
future date for the displayed result and downloaded results.
Filter "Show any items currently checked out" is now taken into account
for the downloaded results.
To test:
1- Go to Circulation then to overdues
2a- Add a filter with "Date due To" > today
2b- Check that only the results with "Due date" < today are displayed
(not those with "Due date" between today and the date requested)
2c- Click on "Download file of displayed overdues"
2d- Check that the file contains only the results with "Due date" <
today (not those with "Due date" between today and the date requested)
3a- Reset filter and then add the filter "Show any items currently
checked out"
3b- Check that all the results are displayed (even those with "Due date"
> today)
3c- Click on "Download file of displayed overdues"
3d- Check that the file contains only the results with "Due date" <
today (not those with "Due date" between today and the date requested)
9- Apply the patch
10- Repeat step 1 to 8, checking that all the results corresponding to
the selected filter are now displayed/downloaded
David Gustafsson [Wed, 13 Oct 2021 13:36:43 +0000 (15:36 +0200)]
Bug 29220: Minor fixes and improved code readability
The current handling of onsite checkouts with OnSiteCheckoutsForce
syspref enabled is confusing and hard to understand. It's also fragile
with a high risk future changes could result in subtle bugs.
Also fix an inconsistency in which errors (DEBT_GUARANTORS) are considered blocking for
forced onsite checkouts.
To test:
1) Enable OnSiteCheckouts, disable OnSiteCheckoutsForce
2) Edit a biblio item and for example set Not for loan to a value
restricting loans
3) Try to check out the item for some patron
4) A message that item is not for loan should be displayed
5) Select "On-site checkout" and try again
6) The same message should be displayed
7) Try to checkout with some invalid barcode
8) A message that barcode was not found should be displayed
9) Now enable OnSiteCheckoutsForce
10) Try to checkout the item for some patron
11) A message that item is not for loan should be displayed
12) Select "On-site checkout" and try again
13) Checkout should now succeed, no messages should be displayed
14) Try to checkout with some invalid barcode
15) A message that barcode was not found should be displayed
16) All of the above steps should produce the same result with and without this patch
Additional:
Before patch:
a) Set NoIssuesChargeGuarantorsWithGuarantees to 1
b) add a guarantee with another guarantor
c) charge a 1.01 fine to other guarantor
d) checkout is blocked due to fines
Apply patch
e) checkout is allowed when onsite checkouts forced
Sponsored-by: Gothenburg University Library Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ad5699ea1dc95b4ed22bc56a9615dfcff02a2990)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2bcac55ba4372d2f6d7899cd973242db1211ce67)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit bd082b5506cfaf08362b9634b0532d98f79fa9fa)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Marcel de Rooy [Mon, 13 Dec 2021 13:23:57 +0000 (13:23 +0000)]
Bug 29687: Uninitialized warning C4/XSLT line 286
From plack-opac-error.log:
[WARN] Use of uninitialized value $value in concatenation (.) or string at /usr/share/koha/C4/XSLT.pm line 286.
Test plan:
An opac search triggered the warning. So repeat it without warns.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 74382c321c16348919f83f63e505dea93239c2ca)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Wed, 23 Feb 2022 14:21:04 +0000 (15:21 +0100)]
Bug 30164: Fix datatable wrapper when no filter passed
This problem appears (at least) on the cities list view:
If you pass a filter in the "Search cities" filter in the header, it
won't be taken into account and all the cities will be displayed.
There are two problems. First we are passing an "empty" q=[] in the
body, the filter from the header is passed as URL parameters. We should
not need to pass the q if it's empty.
Then the main problem is coming from a bug in
Koha::REST::Plugin::Query but I didn't manage to track it down. If we
have two 2 passed, only the second one will be used. We are certainly
using a hash somewhere we should not.
This patch is fixing the bug but not on the correct side. A follow-up
bug should take care of the main problem at lower level.
Test plan:
Hit /admin/cities.pl
Create some cities
Use the filter in the header of the page and submit
=> Without this patch all cities are retrieved
=> With this patch applied only the relevant cities are displayed.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 43dd25e2aa2298bea2a60cacaa8c465cf5f7678c)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>