Aleisha Amohia [Sun, 14 Mar 2021 20:15:32 +0000 (09:15 +1300)]
Bug 14237: Tests
Confirm all tests pass: t/db_dependent/CourseReserves/CourseItems.t
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Aleisha Amohia [Tue, 2 Feb 2021 21:04:30 +0000 (10:04 +1300)]
Bug 14237: Schema updates
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Aleisha Amohia [Tue, 2 Feb 2021 21:01:15 +0000 (10:01 +1300)]
Bug 14237: Database updates
This patch adds a biblionumber column to course_items, adds a
relationship between course_items.biblionumber and biblio.biblionumber,
and changes course_items.itemnumber to allow null values.
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Aleisha Amohia [Wed, 3 Feb 2021 00:03:31 +0000 (13:03 +1300)]
Bug 14237: Add individual bibliographic records to course reserves
This feature allows a patron to add bibliographic records to course
reserves. They can be added individually or in a batch. The courses that
have reserved this record will also show on the record's detail page.
To test:
1) Update database, refresh schema, and restart services
2) Enable the system preference UseCourseReserves
3) Set up a couple of biblios and a couple of items (attached to
different biblios)
4) Go to Course Reserves and add a new course
5) Click Add reserves and put something in both the barcode field and
biblionumber field. Click submit and confirm you get an error.
6) Add a barcode in the barcode field and submit. Confirm the item is
reserved for the course as expected.
7) Add a biblionumber in the barcode field and submit. Add notes and
Save. Confirm the record is reserved for the course as expected and the
notes are saved correctly.
8) Edit the record-level course reserve that you just added. Confirm the
correct record shows and any edits save as expected.
9) Go back to the course and try removing reserves. Use both the Remove
action button for individual reserves and the Remove all reserves
button. Confirm both work as expected.
10) Go to Batch add reserves and put something in both the barcodes
field and biblionumbers field. Click submit and confirm you get an
error.
11) Remove the barcodes and put some biblionumbers in the biblionumbers
field. Add notes and Submit. Confirm the records are all added as
expected.
12) Click on one of the biblios that has been reserved for the course.
Confirm that the course shows under 'Courses that have reserved this
title' on the biblio detail page.
13) Go back to the course and click Add reserves. Try and add a
biblionumber that is already reserved. Confirm it detects that the
biblio has already been reserved.
Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ) Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28644: Fix calling borrowernumber on undefined value
If the hold is not found (e.g. already cancelled), we should
return earlier without crashing:
Can't call method "borrowernumber" on an undefined value at /usr/share/koha/C4/Reserves.pm line 521
(Note: line number from 19.11)
Test plan:
Run t/db_dependent/Reserves.t
Add a hold, go to user menu with holds in OPAC.
At the same time, cancel this hold from staff.
Now click the Cancel in OPAC.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
There are too many warnings about uninitialized variables in Search.pm.
This patch deals with that, the same way it is dealt accross the file:
by setting an empty string when things are not defined.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/Search.t
=> FAIL: Wow, too many warnings. Some related to this bug, some not.
2. Apply this patch
3. Repeat 1
=> SUCCESS: No more warnings!
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28673: Add missing ampersand to amp; construction
Super trivial one character fix ;)
Test plan:
Open Your Lists from the button on main page.
Click again on Your lists under Lists in the middle of the form.
Verify that the URL does no longer show something like:
op=listamp;category=1
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 18 Jun 2021 10:36:00 +0000 (12:36 +0200)]
Bug 28561: Remove DBIC warning in opac-shelves
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 17 Feb 2021 10:50:39 +0000 (11:50 +0100)]
Bug 22544: Fix OpacLoginInstructions
Moved recently
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 17 Feb 2021 10:48:36 +0000 (11:48 +0100)]
Bug 22544: TT plugin should return hashref only if news exist
It restore the header and fix the RSS feeds (see comment 103)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Tue, 19 Jan 2021 08:42:02 +0000 (08:42 +0000)]
Bug 22544: Use template plugin for news author display
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Mon, 18 Jan 2021 12:41:31 +0000 (12:41 +0000)]
Bug 22544: Add default language value to KohaNews template plugin
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Mon, 18 Jan 2021 11:49:51 +0000 (11:49 +0000)]
Bug 22544: Enhance exception description
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Mon, 18 Jan 2021 09:33:21 +0000 (10:33 +0100)]
Bug 22544: Clarify documentation and change param 'type' to 'location'
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Thu, 1 Oct 2020 05:39:19 +0000 (05:39 +0000)]
Bug 22544: Fix filtering by location on tools -> news management
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Thu, 1 Oct 2020 05:03:52 +0000 (05:03 +0000)]
Bug 22544: Update search_for_display to be able to take more types
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Wed, 30 Sep 2020 18:58:01 +0000 (18:58 +0000)]
Bug 22544: Update to current codebase
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Mon, 2 Mar 2020 07:04:54 +0000 (07:04 +0000)]
Bug 22544: (QA follow-up) Fix spelling
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Wed, 20 Mar 2019 11:07:22 +0000 (11:07 +0000)]
Bug 22544: Refactor searching of news items
Test plan:
1) Go to tools and define some news
2) Try different parameters, try to edit new items, and delete some
3) Go to all places where news are presented and ensure that there are
the right ones shown:
opac main page - based on language
opac righ column (formerly syspref OpacNavRight) - based on language
opac news rss feed
circulation slip (not quick slip)
intranet main page
4) run tests:
prove t/db_dependent/Koha/News.t
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Wed, 20 Mar 2019 10:20:29 +0000 (10:20 +0000)]
Bug 22544: Add tests
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Wed, 20 Mar 2019 07:36:53 +0000 (07:36 +0000)]
Bug 22544: Move GetNewsToDisplay to Koha namespace
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 22544: fix count call - to squash
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Tue, 19 Mar 2019 10:35:23 +0000 (10:35 +0000)]
Bug 22544: Move add_opac_item to Koha namespace
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Tue, 19 Mar 2019 10:30:27 +0000 (10:30 +0000)]
Bug 22544: Move upd_opac_new to Koha namespace
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Tue, 19 Mar 2019 10:23:40 +0000 (10:23 +0000)]
Bug 22544: Move del_opac_new to Koha namespace
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Tue, 19 Mar 2019 10:17:31 +0000 (10:17 +0000)]
Bug 22544: Move get_opac_news to Koha namespace
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Tue, 19 Mar 2019 09:14:47 +0000 (09:14 +0000)]
Bug 22544: Move get_opac_new to Koha namespace
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Fri, 18 Jun 2021 13:09:29 +0000 (13:09 +0000)]
Bug 28597: Fetch the logged in branchcode for OpacSuggestioninstructions
To test:
1 - Set two news items with location 'OpacSuggestioninstructions'
2 - One should be for all libraries
3 - One should be for a specific library
4 - Sign in to opac with user from the specific library
5 - Add a suggestion
6 - The instructions only show the all libraries item
7 - Apply patch
8 - Reload
9 - All libraries and specific library items are shown
10 - Allow anonymous suggestions: AnonSuggestions - Allow
11 - Sign out of opac
12 - Add a suggestion
13 - Only all librares news is visible
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28455: Update wording on TrackLastPatronActivity
This patch updates the wording on TrackLackPatronActivity to maintain the corrections from bug 28467 and also reflect the change made in this bug. It should now read: The first time each day that a patron either logs into the OPAC, connects to Koha via SIP, or checks an item out, borrowers.lastseen will update with the current date and time.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Tue, 25 May 2021 18:20:25 +0000 (18:20 +0000)]
Bug 28455: lastseen should be updated at checkout if TrackLastPatronActivity is enabled
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 22 Jun 2021 09:46:55 +0000 (11:46 +0200)]
Bug 28611: Fix width to 50% for additem form elements
This patch suggests to set the width of select and input to 50%
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28299: Make buildKohaItemsNamespace accept Koha::Items
This patch makes buildKohaItemsNamespace (and its only caller,
XSLTParse4Display) accept a an optional Koha::Items resultset.
This way we don't need to calculate (from the DB) the list of hidden
itemnumbers, but solve it in one query.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 7 May 2021 09:16:17 +0000 (11:16 +0200)]
Bug 28299: Take OpacHiddenItems into account on opac-shelves
hidden_items was not passed to XSLTParse4Display
2 things:
* Should we hide the biblio record if OpacHiddenItemsHidesRecord is set?
* allow_onshelf_holds is not working like in other scripts, what's the
expected behaviour? If hidden should we completely ignore the item?
Test plan:
1. Without the patch
2. fill OpacHiddenItems with «damaged: [1]»
3. find a record with several item
4. mark one of them as damaged
5. OPAC: go to the record, you shouldn't see the damaged item
6. add the record to a list
7. see the list
8. in Availability you see the damaged item mentioned, this is the issue
9. apply the patches and restart the services
10. the list should not mention the damaged item :D
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 23 Jun 2021 07:50:55 +0000 (09:50 +0200)]
Bug 28462: Remove line breaks in TT tags
Same as previous patch for other files.
Looks like the problem exists only with IF.
== test plan ==
1. See the problematic strings in a given language
git grep "\bIF\b" misc/translator/po | grep -v '#' | grep '\bzh-Hant-TW'
2. update the language
misc/translator/translate update zh-Hant-TW
3. Recheck the problematic strings, they aren't here anymore
4. Check the diff: git diff
and search the if's with «/-.* IF » to see how the deleted strings
look like and that it makes sense.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 26 May 2021 14:24:32 +0000 (16:24 +0200)]
Bug 28462: Remove TT tag on several lines - opac-advsearch.tt
It fixes the translation in case the operators have been translated
Test plan:
1. misc/translator/translate update pt-BR
2. In pt-BR-opac-bootstrap.po , find OpacAdvSearchMoreOptions
3. sabotage the translation part, like replacing IF with something else
4. misc/translator/translate install pt-BR
5. enable and use pt-BR and hit opac-advsearch.pl
6. Notice the error
Template process failed: file error - parse error - /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/pt-BR/modules/opac-advsearch.tt line 409: unexpected token (e) [% IF (OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size> 0 e extended_options) ou (OpacAdvSearchOptions and OpacAdvSearchOptions.size> 0 e n expandido_options) %] at /kohadevbox/koha/C4/Templates.pm
7. Apply the patch and redo update and install of the language
8. Note that it's now working
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 16 Jun 2021 12:51:08 +0000 (14:51 +0200)]
Bug 28524: Escape 'rank' in cat_issues_top.pl
It's a MySQL 8 keyword
Test plan:
Turn off strict_sql_modes (there are other problems in this script)
Hit Home Reports > Most-circulated items
Submit the form
Without this patch you got:
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'RANK, biblio.biblionumber AS ID, itemcallnumber as CALLNUM,
ccode as CCODE, loca' at line 1
With this patch applied you see the report result view
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 16 Jun 2021 12:54:47 +0000 (14:54 +0200)]
Bug 28523: Escape 'rank' in bor_issues_top.pl
It's a MySQL 8 keyword
Test plan:
Turn off strict_sql_modes (there are other problems in this script)
Hit Home Reports > Patrons with the most checkouts
Submit the form
Without this patch you got:
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to
use near 'RANK, borrowers.borrowernumber AS ID FROM `old_issues`
With this patch applied you see the report result view
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
David Cook [Fri, 21 May 2021 06:52:25 +0000 (06:52 +0000)]
Bug 28409: Comprehensively validate category in opac-shelves.pl
Default to a category of 1 (ie Private). Only allow input of 1
or 2 (ie Public)
== Test plan ==
1. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?category=function(){window.location.href%20=%20%27https://git.koha-community.org/stats/koha-master/authors.html%27}()
2. Note that you are redirected to another website
3. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=add&shelfname=foo&category=9
4. Note that you can't see this list in the Lists (but it has been added to the database)
5. Apply the patch & restart services
6. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?category=function(){window.location.href%20=%20%27https://git.koha-community.org/stats/koha-master/authors.html%27}()
7. Note that you are not redirected to another website
8. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=add&shelfname=bar&category=9
9. Note that "bar" has been added as a Private list
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
So Debian 9's version of Test::MockModule doens't have ->redefine, and
Ubuntu 20.04's doesn't recognise qw(nostrict). So the only solution is
to just remove the keywords use completely and move back to using
->mock, as the rest of the codebase.
FIXME: using ->mock might be hiding some errors (like a method not being
defined/removed) and should be avoided. ->redefine will explode if the
method doesn't already exist, which is what we want, to catch this kind
of errors. That's why ->mock in strict mode is forbidden. We should try
packaging a newer Test::MockModule ourselves.
Tested on master-buster, master-stretch and master-focal.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch makes t/Auth_with_shibboleth.t use the new
t::lib::Mocks::Logger tools
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch introduces a new way to mock and test Koha::Logger.
As the POD says, it is used by calling
my $logger = t::lib::Mocks::Logger->new();
It then provides convenient methods for testing the logging itself per
log-level:
* warn_is
* warn_like
* debug_is
* debug_like
...
Methods for counting the logging activity and also for clearing the mock
buffer are provided as well. This is covered in the POD and also on the
follow-up, that makes use of this to fix Auth_with_shibboleth.t
To test:
1. Run:
$ kshell
k$ prove t/Auth_with_shibboleth.t
=> FAIL: Tests fail! It expects some warns but they are not returned by
the lib
2. Apply this patches
3. Repeat 1
=> SUCCESS: Tests pass! The tests now use the new lib, and they
correctly find the logging Auth_with_shibboleth.pm does on function
calls.
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Jonathan Druart [Wed, 16 Jun 2021 13:28:01 +0000 (15:28 +0200)]
Bug 28571: Remove C4::Auth::_session_log
It's not used and must be removed
Test plan:
% git grep _session_log
must not return any result.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 22 Jun 2021 10:54:15 +0000 (12:54 +0200)]
Bug 28606: Remove $DEBUG and $ENV{DEBUG}
We should remove the debug statements or use Koha::Logger when we want
to keep it.
Test plan:
Confirm that occurrences of remaining occurrences of DEBUG need to be
kept (historical scripts for instance)
Confirm that the occurrences removed by this patch can be removed
Confirm that the occurrences replaced by Koha::Logger are correct
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Looks good to me, noting a few minor points on BZ.
JD amended patch: replace "warn #Finished" with "#warn Finished", and
put the statement on a single line
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Fri, 18 Jun 2021 15:45:42 +0000 (15:45 +0000)]
Bug 28601: Fix 'Home' breadcrumd on circulation-home.pl
To test:
1 - Got to 'Circulation'
2 - Click 'Home' in breadcrumbs
3 - You are still in circulation home
4 - Apply patch
5 - reload page
6 - Click 'Home'
7 - Success!
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch fixes a scope issue. Originally, a variable declared as
our $borcat
was replaced by
my $patron
This patch makes the method not rely on global variables, but have a
parameter for the patron, and thus things are clearer.
To test:
1. Open the OPAC detail page for a record
=> FAIL: The logs show some errors about the $patron variable not
available in the scope
2. Apply this patch
3. Repeat 1
=> SUCCESS: No errors
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28588: (follow-up) Make the API use the new method
This patch adapts the controller method for resolving a return claim so
it uses the Koha::Checkouts::ReturnClaim method instead.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/return_claims.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests 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: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch introduces a high-level method for resolving claims.
The behavior intends to replace the code in the API controller that is
used for resolving a claim.
To test:
1. Apply this patches
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Checkouts/ReturnClaim.t
=> SUCCESS: Tests pass
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28604: Prevent double encoding of MARC::Record::MiJ->to_mij output
This patch fixes a double-encoding issue with MiJ output.
Mojolicious' *text* renderer encodes the passed information according to
the request context. [1]
MARC::Record::MiJ->to_mij, conveniently encodes the string before
output [2].
This causes double encoding.
So the solution to this situation, is to use the *data* renderer, which
doesn't perform any encoding [3].
To test:
1. Apply the regression tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/biblios.t
=> FAIL: Tests contain diacritics and fail!
3. Have a record with diacritics
4. Try the API routes for fetching a biblio:
$ curl --location --request GET 'http://localhost:8080/api/v1/public/biblios/144' \
--header 'Accept: application/marc-in-json'
(replace the record id with the one you've chosen)
=> FAIL: Boo, double encoding
5. Bonus point: you can try it on the non-public route, but you need
more configuration boilerplate (basic auth, permissions). If you look
at the fix, you will understand the tests cover it and no need to
complicate yourself.
6. Apply this patch
7. Repeat 2
=> SUCCESS: Tests pass!
8. Repeat 4 (and maybe 5)
=> SUCCESS: No double encoding! Yay!
9. 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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch introduces regression tests for the encoding issue with MiJ
output.
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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds the q query parameters to the route.
To test:
1. Try the route with the following query parameter:
q={"patron_id":2}
i.e. GET /api/v1/patrons?q={"patron_id":2}
=> FAIL: You get a bad request respose
2. Apply this patch
3. Restart all
4. Repeat 1
=> SUCCESS: You get the patron
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 17 Jun 2021 13:47:07 +0000 (14:47 +0100)]
Bug 28581: Enhance POD for EnqueueLetter
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 17 Jun 2021 13:30:59 +0000 (14:30 +0100)]
Bug 28581: Use 'from_email_address' where appropriate
This patch replaces a few more trivial cases where we were using
library->branchemail with a fallback to KohaAdminEmail to just use the
new library->from_email_address method directly instead.
There were also a couple of cases where we were passing borrowernumber
and the patrons library from address too.. this is unneccesary as the
code in _send_email_massage will already default to patron library from
address if we do not pass an override.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Added a semicolon.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 17 Jun 2021 13:12:23 +0000 (14:12 +0100)]
Bug 28581: (QA follow-up) Prevent code failure
This patch prevents a fatal error when both $params->{from} and
$params->{borrowernumber} are undefined. We fallback to
KohaAdminEmailAddress before finally falling through to setting a
failure status for the message if that last fallback is not found.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Marcel de Rooy [Thu, 17 Jun 2021 09:59:18 +0000 (09:59 +0000)]
Bug 28581: Use from_email_address in the codebase
Adding only a few (trivial) cases now. Changes in C4::Letters
are not trivial after all..
We now add the KohaAdminEmail fallback implicitly when the from
address was still empty. The extra check makes us not rely on
a do or die action in Email::Stuffer.
Test plan:
Run password recovery or membership expiry cron.
Check sender address.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 17 Jun 2021 08:54:46 +0000 (09:54 +0100)]
Bug 28581: Add 'from_email_address' method and use in Koha::Patron
This patch adds a new 'from_email_address' method to Koha::Library to
return the appropriate email address to use as the 'from' field for
email notices from the library.
We then update Koha::Patron->queue_notice to use this new method instead
of the incorrect inbound_email_address.
I also update the POD for inbound_email_address to clarify it's use
case.
Test plan
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Lucas Gass [Wed, 12 May 2021 18:20:16 +0000 (18:20 +0000)]
Bug 26205: Add logging of news items
To test:
1. Apply patch, updatedatabase, restart_all
2. Make sure the system pref 'NewsLog' is turned on.
3. Go to the Koha News tool and create a new news item.
4. View the logs and display only the OPAC News module
5. You should see your new news, it will include the lang (
OPACheader_en ) and the content of the news item.
6. Filter the logs so the only action is 'Add', your new news item
should appear
7. Modify some news items
8. They should appear in the logs now as modification.
9. Make sure you can filter the action to 'Modify' and can confirm it
works
10. Delete some news items
11. They should appear in the logs now as deletinon
12. Make sure you can filter the action to 'Delete' and can confirm it
works
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 4 Jun 2021 13:36:59 +0000 (15:36 +0200)]
Bug 28516: Prevent failures if borrower_attribute_types.mandatory=1
TestBuilder will generate an integer for the
Koha::Patron::Attribute::Type object, but if 1 is picked some tests are
failing randomly
At least t/db_dependent/Koha/Patrons.t and t/db_dependent/Koha/Patrons/Import.t
The expection "Missing mandatory extended attribute" is raised when the
patron is stored.
Test plan:
The following script should return 0 when the patch is applied:
"""
use t::lib::TestBuilder;
my $builder = t::lib::TestBuilder->new;
my $x = $builder->build_object(
{
class => 'Koha::Patron::Attribute::Types',
}
);
say $x->mandatory;
"""
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28598: Update DateFormat and TimeFormat descriptions to remove warnings
To test, confirm that the warnings are present without the patch and gone with it.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 16 Jun 2021 13:24:31 +0000 (15:24 +0200)]
Bug 28570: Remove log to /tmp file from bor_issues_top.pl
This is unusual and must not be done.
Removing it.
Test plan:
Use the "Home > Reports > Patrons with the most checkouts" report and
confirm that it is working correctly after you applied this patch
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 22 Jun 2021 09:57:00 +0000 (11:57 +0200)]
Bug 28514: Set lang to default is not passed
It fixes the following test:
# Failed test 'no lang passed, default is returned'
# at t/db_dependent/Koha/Notices.t line 105.
# got: 'es-ES'
# expected: 'default'
# Looks like you failed 1 test of 7.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 28242: added captions to tables and legends to forms
Ensured that in the OPAC, all tables have relevant captions and all forms have relevant legends.
Many of these have class="sr-only" so they are not visible but will be
available for people who use screen-readers.
To test:
1) Go to OPAC
2) Apply patch and dependencies
3) Check that on all pages, any tables have a caption (many of them will
not be visible, but will be in the markup code)
4) Check that on all pages, any forms have a legend (many of them will
not be visible, but will be in the markup code)
5) Check that the captions are appropriate and relevant
6) Check that the legends are appropriate and relevant
Sponsored-by: Catalyst IT Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds the mentioned syspref to the sysprefs list, shared for
statistical purposes.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Wed, 9 Jun 2021 10:59:31 +0000 (10:59 +0000)]
Bug 28508: Use "Invoice number" instead of "Invoice no" on the invoice search filter
This patch corrects instances of the abbreviated phrase "Invoice no."
from the templates, making it "Invoice number." Also corrected: An
instance of "Bookseller" is replaced with "Vendor."
To test, apply the patch and confirm that the phrase is correct in these
cases:
- Acquisitions -> Invoices: Check the "Search filters" form in the
left-hand sidebar.
-> View an invoice: Check the label in the form.
- Acquisitions -> Vendor -> Receive shipments: Check the table of
invoices.
- Acquisitions -> Orders search (in the search header) -> Advanced
search: Check the labels in the form.
Signed-off-by: Salman Ali <salman.ali@inLibro.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Note: I fixed Salman's SO line
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 21 May 2021 18:10:14 +0000 (18:10 +0000)]
Bug 28418: Show template_id of MARC modification templates
This patch adds an "id" column to the table of MARC modification
templates. The table is now a DataTable with table settings, with the
new column hidden by default to preserve the existing configuration.
To test, apply the patch and restart services.
- Go to Administration -> MARC modification templates.
- If necessary, add two or more templates.
- Confirm that table of templates displays as a DataTable, with all
associated sorting, filtering, export, etc.
- The "id" column should be hidden by default.
- Confirm that column visibility controls work correctly.
- Confirm that the table settings found under Administration -> Table
settings work correctly to set the default visibility of the table
columns.
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 5 Mar 2021 15:19:40 +0000 (15:19 +0000)]
Bug 27882: Move external search results links out of page heading
This patch modifies the JavaScript which adds search result information
to the OPAC search results page which is returned from OverDrive,
Recorded Books, or Open Library. The information now displays below the
page heading instead of inside it.
To test you must have OpenLibrarySearch enabled, OverDrive-related
preferences populated (OverDriveClientKey, OverDriveClientSecret,
OverDriveLibraryID), or RecordedBooks preferences (RecordedBooksClientSecret,
RecordedBooksDomain, RecordedBooksLibraryID).
This patch was written with OverDrive and Open Library results active.
- Apply the patch and perform a search in the OPAC catalog.
- On the search results page you should see results for your external
services appear below the page heading ("You search returned..."),
e.g.
"Found 20257 results in the library's OpenLibrary collection"
"Found 337 results in the library's OverDrive collection"
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Katrin Fischer [Sun, 21 Mar 2021 13:11:25 +0000 (13:11 +0000)]
Bug 27498: (follow-up) Update to display logic
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Amit Gupta <amitddng135@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Wed, 3 Feb 2021 12:04:31 +0000 (12:04 +0000)]
Bug 27498: Add a link for the Hold Ratios to Acquisitions home page
This patch adds a link to the hold ratios report in the Acquisitions
sidebar menu under the "reports" heading.
To test, apply the patch and go to Acquisitions. The link to the hold
ratios report should be there and it should work correctly.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Amit Gupta <amitddng135@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 30 Oct 2020 12:33:54 +0000 (12:33 +0000)]
Bug 26838: Improve styling of checkin message
This patch makes some changes to the style and use of the "problem"
class in the staff interface:
- Remove the background color
- Remove the extra line height
Some changes to the template:
- Remove the problem class from the checkin message. The checkin
message configuration determines whether the dialog is an alert or a
message-style dialog.
- Add Font Awesome icons to the "problem" messages in patron details
and serials collection. This is to help emphasize the message for
users who might have difficulty seeing the color difference.
To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
- Go to Administration -> Item types and configure a checkin message
for an item type: Add a message and select "Message" as the checkin
message type.
- Check in an item with that item type and confirm that you see the
checkin message. It should be displayed in a message-style dialog
without any additional styling.
- Change the item type configuration to use "Alert" as the checkin
message type. Confirm that the correct style is shown in this case as
well.
- Locate a patron with a NULL value in borrowers.password. View the
detail page for that patron.
- Under the "Library use" heading, the "Password" line should contain a
link with the text "Undefined," preceded by a red-colored Font
Awesome icon.
- In Serials, locate a subscription which is expired.
- View the details for the subscription, and then open "serial
collection" from the sidebar menu.
- On the serial collection page there should be a cell in the
subscription summary table showing the message "Subscription expired"
preceded by a red-colored Font Awesome icon.
Signed-off-by: Salman Ali <salman.ali@inLibro.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Fri, 11 Jun 2021 12:15:35 +0000 (12:15 +0000)]
Bug 8280: Add koha set and item fields to pqf.properties
This patch adds a 'koha' set to the pqf properties and maps some basic
koha fields to all for searchign
To test:
1 - Apply patch
2 - cp etc/z3950/pqf.properties /etc/koha/sites/kohadev/z3950/pqf.properties
3 - sudo koha-z3950-responder --restart kohadev
4 - Test a search:
curl -XGET "http://localhost:2100/biblios?version=1.1&operation=searchRetrieve&query=koha.itemtype=BK&maximumRecords=60&recordSchema=marcxml"
5 - Test other fields added:
koha.withdrawn
koha.lost
koha.classification-source
koha.materials-specified
koha.damaged
koha.restricted
koha.cn-sort
koha.notforloan
koha.ccode
koha.itemnumber
koha.homebranch
koha.holdingbranch
koha.location
koha.barcode
koha.onloan
koha.itemtype
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Copied the changes from z3950 to zebradb too.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 3 Feb 2021 10:03:31 +0000 (10:03 +0000)]
Bug 27600: Remove password check from SIP2 `renew_all`
This patch removes the password check code from the renew_all method for
SIP2. This is required, as many units send an empty AD field in the SIP
message which can cause the transaction to fail.. but the authentication
should have already taken place earlier in the session.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>