Alex Arnaud [Wed, 28 Mar 2018 09:03:56 +0000 (09:03 +0000)]
Bug 20261: Fix pagination of the results in authority search
Test plan:
- apply this patch,
- do a search that return more than 20 results,
- click on page 2,
- check that you get results,
- check other pages if possible
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Alex Arnaud [Mon, 12 Mar 2018 16:12:20 +0000 (16:12 +0000)]
Bug 17373: Add mappings for unimarc authorities - Match index
Test plan:
1. apply patches
2. switch SearchEngine syspref to ElasticSearch
3. load new mapping
(admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1)
4. load some unimarc authorities like the sample attached to bug 17373
5. reindex authorities
(./misc/search_tools/rebuild_elastic_search.pl -d -a -v)
6. search entire notice for shalev or שלו
7. you should find stuff
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Fridolin Somers [Thu, 13 Oct 2016 07:45:40 +0000 (09:45 +0200)]
Bug 17373: Elasticsearch - Authority mappings for UNIMARC - patch1
This patch starts the UNIMARC mapping for ES.
It is needed to test.
More patches will come.
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Tue, 27 Mar 2018 19:16:16 +0000 (15:16 -0400)]
Bug 20325: C4::Accounts::purge_zero_balance_fees does not check account_offsets
purge_zero_balance_fees is used in cleanup_database.pl to determine which fees can be cleaned up.
It uses a simple SQL query to determine which rows in accountlines need to be removed:
463 my $sth = $dbh->prepare(
464 q{
465 DELETE FROM accountlines
466 WHERE date < date_sub(curdate(), INTERVAL ? DAY)
467 AND ( amountoutstanding = 0 or amountoutstanding IS NULL );
468 }
The function comes with the following warning:
451 B<Warning:> Because fines and payments are not linked in accountlines, it is
452 possible for a fine to be deleted without the accompanying payment,
453 or vise versa. This won't affect the account balance, but might be
454 confusing to staff.
This was a reasonable solution prior to the addition of account_offsets in 17.11. The problem now is that rows in accountlines which are linked as credits in accountlines will *always* have amountoutstanding marked as 0. These are linked to debits via account_offsets. purge_zero_balance_fees will delete credits and leave rows in account_offsets which link to deleted credits.
Sites using the --fees option cleanup_database.pl which upgrade to 17.11 may have all of their credits removed without warning.
Test Plan:
1) Apply this patch
2) prove t/db_dependent/Accounts.t
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Mark Tompsett [Thu, 5 Apr 2018 01:31:38 +0000 (01:31 +0000)]
Bug 20191: Use Test::MockTime to hold time still
The problem is the calls to HTTP::OAI::Header, etc.
may reference gmtime which is continually changing by
the second. By forcing time to lock for all the tests,
except the last one, we can be assured things should
not fail.
TEST PLAN
---------
install libtest-mocktime-perl
apply the patch
restart_all
in kshell, prove t/db_dependent/OAI/Server.t
run koha qa test tools
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Victor Grousset [Fri, 5 Jan 2018 14:03:38 +0000 (15:03 +0100)]
Bug 19953: Record page: acquisition details: add column for invoice
Test plan:
1. create a vendor with minimal info
2. create a basket with minimal info
3. add a item to the basket
4. close the basket
5. receive a shipment
6. on the "receipt summary" click on "receive" for the wanted item (it
should be the only one)
7. items → receive? → tick this checkbox
8. save
9. click on "finish receiving"
10. go to the record → Acquisition details
11. apply this patch
12. refresh the page
13. you should see the new column
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19267: Rancor - Warn before leaving page if record modified
To test:
1 - Open the advanced editor
2 - Make some changes to a record
3 - Click on 'Patrons' or leave the page in some way
4 - Note there is no warning and changes are not saved
5 - Apply patch
6 - Open the advanced editor
7 - Make some changes
8 - Leave the page
9 - Note you get a warning of unsaved changes and can stay on the page
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
In acqui/parcel.pl both the "Pending orders" and "Already received" tables show how many holds there are for the given record. However, the count of holds in the "Pending orders" table confuses librarians because it only lists holds for the particular items in the orderline. Due to that, the holds column may show 0 holds even if there are a dozen record level holds for that bib! This is not what librarians seem to expect, instead it seems that the same total holds in the "Pending orders" table would be preferred.
Test Plan:
1) Find an invoice with an item in the "Already received" table
2) Add one or more record level holds to the record
3) Note the holds column does not count those holds
4) Apply this patch
5) Note the holds column now shows total holds and holds for just those ordered items
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nancy Keener <nkeener@washoecounty.us> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 19812: (QA follow-up) Swap sides for total and item holds
Bug 19812: (QA follow-up) If 0 holds show '0' not '0 / 0'
Bug 19812: (QA follow-up) Remove unnecessary line
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 3 Jan 2018 14:07:17 +0000 (14:07 +0000)]
Bug 19910: Use the delimiter syspref to name download link
To test:
1 - Set delimiter syspref to anything but comma
2 - Download report results as comma separated text
3 - They actually follow the syspref
4 - Apply patch
5 - Download link should now match pref selection
6 - Change pref, note link changes
7 - Verify things still work as expected
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Wed, 17 Jan 2018 19:30:06 +0000 (14:30 -0500)]
Bug 20008: Fix restrictions added from memberentry.pl if TimeFormat is 12hr
Test Plan:
1) Set TimeFormat to 12 hour
2) Add a restriction with an expiration date via memberentry.pl
3) Note the restriction exists, but has no expiration date
4) Apply this patch
5) Repeat step 2
6) Note the restriction exists and has an expiration date!
Signed-off-by: Roch D'Amour <roch.damour@inlibro.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, 31 Jan 2018 16:47:46 +0000 (13:47 -0300)]
Bug 20115: Make the prefs sortable
If we depend on the order, we should make it sortable.
I let the customization to someone else (we would need an icon to tell
the user it's sortable).
Something does not work here:
If fr-FR and fr-CA is installed, but only 1 is ticked, it will be
considered as last. I do not think it's a blocker as it does not make
really make sense to have it installed but not used (the interface is
also weird, there is a dropdown list with only 1 entry)
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 6 Nov 2017 18:35:50 +0000 (15:35 -0300)]
Bug 19578: Remove MARC punctuation in notices (TT syntax)
Jenkins fails (run 287) on a test in t/db_dependent/Letters/TemplateToolkit.t:
With the historical syntax:
# Your request for an article from tQYRS (c3Av58O0P5xkkIGu) has been canceled for the following reason:
With the TT syntax:
# Your request for an article from tQYRS_ (c3Av58O0P5xkkIGu) has been canceled for the following reason:
The last character of the biblio's title has been removed because it's a punctuation character.
It comes from: C4::Letters::_parseletter
893 $val =~ s/\p{P}$// if $val && $table=~/biblio/;
The same replacement is done for patron's attributes too.
Test plan:
- Confirm that the new tests pass. That should be enough to confirm this change make sense.
Test plan (manual):
- Create a biblio with a title ending with a punctuation (like "with_punctuation_"), or any other fields of biblio/biblioitem
- Generate a notice which will display this field (CHECKIN for instance)
Use the historical syntax and the TT syntax, both should display the title without the punctuation character at the end
CHECKIN historical:
The following items have been checked in:
----
<<biblio.title>>
----
CHECKIN TT syntax:
The following items have been checked in:
----
[% biblio.title %]
----
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Mark Tompsett [Tue, 30 Jan 2018 22:35:39 +0000 (22:35 +0000)]
Bug 20083: (follow-up) use same logic in opac-showmarc
It was correctly pointed out that opac-showmarc would leak
the same way as catalogue/showmarc.pl, and so this patch
moves the authentication step up to the top where it
should be so as to prevent inappropriate data leaks.
TEST PLAN
---------
1) Set your OpacPublic system preference to Disabled
2) Open your OPAC and login
3) Find a biblio with items
4) Go to the opac details, particularly MARC view.
5) Copy the "view plain" shortcut link.
6) log out.
7) Paste the link into the address bar.
-- the information will leak!
8) apply the patch
9) restart_all
10) Refresh the OPAC link
-- log in screen will appear.
11) run koha qa test tools
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andreas Roussos [Fri, 26 Jan 2018 01:12:47 +0000 (14:12 +1300)]
Bug 20083: Information disclosure when (mis)using the MARC Preview feature
The MARC Preview feature in the Staff client (catalogue/showmarc.pl) does not
check whether a user is logged in or not. As a consequence, it can be used to
obtain information that would normally be available to logged-in users only.
For example, you can view any bibliographic record by passing a value to the
'id' argument, but you can also view records as they were imported (normally
done via the 'Staged MARC management' tool).
All three 17.11 installations currently listed at
https://wiki.koha-community.org/wiki/Koha_Demo_Installations
are affected by this issue, as demonstrated by the URLs below:
It should be noted that this only applies to XSLT-enabled installations.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19223: Add methods to correctly handle plugin-generated output
This patch introduces two methods to be used by plugin authors:
->output
->output_html
They are basically wrappers for the helper methods from C4::Output
(output_html_with_http_headers and output_with_http_headers).
Plugin authors can use them, or keep the current flexibility of handling
the headers themselves in their code.
The KitchenSink plugin should be updated to highlight this.
To test:
- Run:
$ kshell
k$ prove t/db_dependent/Plugins.t
=> FAIL: The methods are not implemented
- Apply this patch
- Run:
k$ prove t/db_dependent/Plugins.t
=> SUCCESS: Tests pass, and they are meaningful
- Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19223: Unit tests for output and output_html methods
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 15:32:55 +0000 (12:32 -0300)]
Bug 19935: Replace GetPendingIssues - Remove the residue
Here we are, no more occurrences of GetPendingIssues, we can remove the
tests and subroutine \o/
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 15:23:42 +0000 (12:23 -0300)]
Bug 19935: Replace GetPendingIssues - SIP
Sounds like we do not need related fields or 'overdue' flag here.
No idea how to confirm there is no regression here.
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 15:06:59 +0000 (12:06 -0300)]
Bug 19935: Replace GetPendingIssues - sco-main
Same as previously, we do not need all the prefetched values here, just
a few.
Test plan:
Use the self checkout module to check some items out
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
At first glance we just need the biblio title and the subtitle (in
addition of the fines info), we should not need the prefetch.
Test plan:
Loggin at the OPAC, on the summary page you should see your checkouts
and overdues with the correct values
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 14:47:46 +0000 (11:47 -0300)]
Bug 19935: Replace GetPendingIssues - opac-ics.pl
We only need the biblio title and the barcode, we should not need the
whole prefetch.
Test plan:
On your OPAC summary page export your checkout list using the
"Download as iCal/.ics file" link.
Before and after the patchset, the generated files must be the same
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We are in the notices part, so we need to fetch all the data to avoid
regressions.
Test plan:
Print a summary slip before and after this patch.
They must be the same
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Same as previously, we just want Koha::Patron->checkouts->count to know
if a patron has checkouts.
Test plan:
Confirm that you cannot delete a patron's card if they have pending checkouts
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 14:15:02 +0000 (11:15 -0300)]
Bug 19935: Replace GetPendingIssues - Discharges
We should actually use Koha::Patron->checkouts here to avoid the
prefetch.
Test plan:
A patron with checkouts cannot get a discharge
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 14:10:50 +0000 (11:10 -0300)]
Bug 19935: Replace GetPendingIssues - ILSDI
Here we should only access to what we want in the template, but let do
it as it for now.
Test plan:
Hit
/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=542&show_contact=0&show_loans=1
With 42 a borrowernumber with checkouts
Before and after these patches the XML must be the same
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 18:49:18 +0000 (15:49 -0300)]
Bug 19935: Replace GetPendingIssues - IssueSlip
Luckily we have a good test coverage here!
Test plan:
Print issue slips before and after these patches (with overdues, etc.)
They should be the same.
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 18:49:03 +0000 (15:49 -0300)]
Bug 19935: Add Koha::Patron->pending_checkouts
To move this subroutine out of the C4 namespace we face the same
problematic as bug 17553 (with GetOverduesForPatron).
We need to provide an equivalent method and so return all the related
value for a given checkout.
We can acchieve the easily using Koha::Object->unblessed_all_relateds,
but we need to keep in mind that it is a temporary move.
Indeed we will want to use our API to only access/retrive values we really need.
The whole trick could be removed when the current syntax for notices
will be deprecated and removed.
Note: this method returns the same number of elements than ->checkouts
They indeed returns the same things, but it sounds better to me to have a
different method to highlight (from the callers) where does it come
from (C4::Members::GetPendingIssues).
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 16:19:51 +0000 (13:19 -0300)]
Bug 17553: Move GetOverduesForPatron to Koha::Patron->get_overdues
With the help of Koha::Object->unblessed_all_relateds we are going to
replace GetOverduesForPatron without introducing regressions (hopefully)
on both template notice syntaxes.
Test plan:
0/ Do not apply any patches
1/ Check some items in to a given patron, with and without overdues.
2/ Print the overdues slip (Circulation module > Print > Print overdues)
3/ Apply these patches
4/ Print again and compare the result
=> The 2 generated slips must be exactly the same
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 4 Nov 2016 10:23:56 +0000 (10:23 +0000)]
Bug 17553: Move existing tests
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 16:48:28 +0000 (13:48 -0300)]
Bug 19926: Add tests for Koha::Object->unblessed_all_relateds
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 16:19:16 +0000 (13:19 -0300)]
Bug 19926: Add the Koha::Object->unblessed_all_relateds method
In order to refactor our legacy code step-by-step, we will need to
provide code with the exact same behaviors and then improve it.
The same idea appears for the TT syntax for notices: we will want to
deprecate the existing syntax in order to support only one syntax.
Currently we fetch all the values from the related tables, without
knowing which are actually used.
I am suggestion to introduce a Koha::Object->unblessed_all_relateds
method which will return a hash containing all the fields from the
related tables (with the problems we know: collision in column names).
It is the existing behavior of GetOverduesForPatron and GetPendingIssues
for instance, they are used to send notices and so we have to provide
all the data needed.
See dependent bugs to understand the context and test this patch.
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Roch D'Amour [Thu, 22 Feb 2018 21:08:59 +0000 (16:08 -0500)]
Bug 18820: Main block size now adjust to OpacNavRight like it would for opacuserlogin
Test plans :
- "beforepatch.png" shows the result you get when OpacNavRight and opacnav are set to false.
- "opacuserlogin=f_opacnav=f.png" shows the result with the patch and OpacNavRight and opacnav set to false
- "opacuserlogin=t_opacnav=f.png" shows the result with the patch and OpacNavRight set to true and opacnav set to false
Applied patch, can confirm it functions as expected. Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Paudet [Mon, 19 Jun 2017 13:27:15 +0000 (09:27 -0400)]
Bug 18820: Adding lines that check if opacuserlogin is enable and if OpacNav has content.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Dominic Pichette <dominic@inlibro.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19892: Replace numbersphr variable with Koha.Preference('OPACNumbersPreferPhrase') in OPAC
Test Case
1) Check that the following files have been changed properly.
opac/opac-search.pl
opac/opac-main.pl
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt
2)Apply bug
3) Check that there are no differences in behaviour as a result of the patch.
Signed-off-by: Roch D'Amour <roch.damour@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 21 Feb 2018 04:56:23 +0000 (04:56 +0000)]
Bug 20291: Add a StaffLoginInstructions preference for adding text to staff client login
To test:
1 - Apply patches
2 - Upgrade database
3 - Check the staff client login page, should be no change
4 - Add something to the preferene
5 - It should appear on the login page
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>
Nick Clemens [Mon, 15 Jan 2018 14:38:13 +0000 (14:38 +0000)]
Bug 20052: Add Koha Reports object class
To test:
prove -v t/db_dependent/Koha/Reports.t
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Maksim Sen <maksim.sen@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Marcel de Rooy [Thu, 22 Mar 2018 08:17:46 +0000 (09:17 +0100)]
Bug 18382: (QA follow-up) Replace ->ymd by ->datetime
The first patch makes Hold.t fail on:
not ok 8 - Hold is suspended with a date, truncation takes place automatically
Failed test 'Hold is suspended with a date, truncation takes place automatically'
at Hold.t line 94.
got: '2018-03-22'
expected: '2018-03-22T00:00:00'
We could remove the midnight time there, but we also could replace ymd by
datetime. The cpan doc tells us:
Same as $dt->ymd('-') . 'T' . $dt->hms(':')
Test plan:
With this patch, run Hold.t again. It should pass now.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Mon, 5 Jun 2017 14:46:45 +0000 (10:46 -0400)]
Bug 18382: action_logs entry for module HOLDS, action SUSPEND is spammy
When a hold is suspended, 'suspend_until' is represented as a DateTime object, complete with locale. All told, this is about 800 lines of text.
Test Plan:
1) Enable the HoldsLog syspref
2) Add a hold on a record/item
3) Suspend the hold with a date to resume
4) Note the massive amount of date in the suspend_until field
5) Apply this patch
6) Suspend another hold with a date to resume
7) Note the log has an acutal date in the suspend_until field
Check the logs using module 'Holds' and Action 'Suspend'
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Thu, 29 Mar 2018 12:33:56 +0000 (12:33 +0000)]
Bug 20494: Remove unused code in neworderempty.pl and addbiblio.pl
Should be sufficient to read code and see all lines were commented and
that this patch removes useless lines
To be thorough, ensure that your can add an order to a basket and add a
biblio.
Signed-off-by: Mark Tompsett <mtompset@hotmail.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: David Bourgault <david.bourgault@inlibro.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, 23 Feb 2018 10:58:27 +0000 (10:58 +0000)]
Bug 20282: Match course reserve on holdingbranch
To test:
1 - Add a course (Course Reserves)
2 - Add an item to the course
3 - Ensure to change the holding branch for the course reserve
4 - Modify the course item
5 - Note the dropdwn for holding branch is unset
6 - Apply patch
7 - Modify the course item
8 - Dropdown should be correctly populated
Signed-off-by: Maksim Sen <maksim.sen@inlibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Mon, 12 Mar 2018 11:15:12 +0000 (07:15 -0400)]
Bug 20369: Analytics search is broken with QueryAutoTruncate set to 'only if * is added'
Test Plan:
1) Enable EasyAnalytics
2) Disable QueryAutoTruncate
3) Create an analytic record, add some host items to it
4) Browser to the analytics tab for the record
5) Click the link in the 'used in' column of the table
6) No search results
7) Apply this patch
8) Reload the page, now you get the analytic record!
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Wed, 3 Jan 2018 11:20:46 +0000 (11:20 +0000)]
Bug 19907: Fix email validation in patron edit form
Test plan:
0) Confirm that email validation is not working in add/edit patron form
1) Apply the patch
2) Edit/add patron, the e-mail validation should be working now
3) Ensure the password validation is still working (use test plan from
bug 19908)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 26 Mar 2018 15:22:15 +0000 (12:22 -0300)]
Bug 20462: Ensure batch item deletion will not delete the same item twice
This has been done on bug 9509 when barcodes are scaned, but not when using a text file.
Test plan (stolen from Barton on the bug report):
1) Create a text file containing duplicate barcodes
Here's a quick way to do that, substitute INSTANCE for the instance name of your test server:
sudo koha-mysql INSTANCE <<< "select barcode from items where barcode is not null limit 3" | sed '1d;p' > /tmp/dup_barcodes.txt
2) Go to Home › Tools › Batch item deletion
3) Click 'Choose File', select the file you created in step 1.
4) Click 'Continue'
5) Note that duplicate items appear in the list of items to batch delete
6) Check 'Delete records if no items remain'
7) This will trigger a software error
Note that entering the barcodes via the 'scan items one by one' text box removes duplicates in the list, so this only causes problems when uploading a file.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 20318: Merge invoices can lead to an merged invoice without Invoice number
When you want to merge invoices you have a page with a non editable
field 'Invoice number:' it shows the content of the first invoice to be
merged.
But if you validate by clicking the 'merge' button you arrive on the
next page which says that 'Invoice has been modified' and if you quit
this page without saving you have now a merged invoice without Invoice
number.
This tiny patch just prevents this issue to occur.
Test plan :
1° go to the acqui/invoices.pl page and search invoices to merge.
You must have at least 2 invoices on the same vendor
2° check boxes to select invoices to merge and click on 'merge selected
invoices' button
3° next page you see the non editable field 'Invoice number:'
4° click on the 'merge' button
5° next page you see 'Invoice has been modified'
6° leave this page i.e click on the left link 'Invoices'
7° search invoices you'll see the merged invoice without invoice number.
Apply the patch, replay the steps 1 to 3
4° on this page you can enter your invoice number and click on the
'merge' button.
If you leave this field empty and click merge, a message informs you
that it is required and you can not merge.
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 21 Dec 2017 18:59:24 +0000 (15:59 -0300)]
Bug 18474: Restore multiple holds when patron is searched for
We lost the ability to place multiple holds when we are searching for
patrons. The multi_holds parameter is lost and not handled correctly in
the template.
Test plan:
- Make sure you can place multiple holds for a patron you will search for
- Same for simple hold
TODO the multiple holds view should not be displayed if only 1 record
has been selected from the search result.
Signed-off-by: claude brayer <claude.brayer@cea.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Tue, 13 Mar 2018 14:57:47 +0000 (14:57 +0000)]
Bug 20385: Don't try to get info for bad authtypecodes
TO test:
0 - Have a koha with ES enabled and some auth records
1 - backup your db
2 - sudo koha-mysql <<instance>>
3 - UPDATE auth_types SET authtypecode="PERSO_NAMB" WHERE
authtypecode="PERSO_NAME" (or adjust as necessary)
4 - Search for some authorities where a PERSO_NAME record will be
returned
5 - KA_BOOM!
6 - Apply patch
7 - Results are returned, they do not display a code, viewing record you
won't see code
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Thu, 29 Mar 2018 17:57:01 +0000 (17:57 +0000)]
Bug 20498: (bug 19641 follow-up) Patron advanced search form missing from patron entry page
My patch moving patron-related templates' javascript to the footer left
out a script from the patron entry template which is required if the
patron header search menu is going to work.
To test, apply the patch and go to Patrons -> New patron.
Clicking the [+] link in the "Search patrons" header search form should
expand the advanced search options.
Test that the page's toolbar still "floats" correctly when you scroll
the page.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Lari Taskula [Wed, 28 Mar 2018 21:19:52 +0000 (21:19 +0000)]
Bug 20490: Correct bug number typo in comment in Circulation.t
NOTE: Confirmed that the typo of 17641 was part of bug 17941.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19784: Adapt /v1/patrons to new naming guidelines
This patch introduces two functions to the patrons endpoint:
- _to_api
- _to_model
This are in charge of field mappings in order to comply with the
guidelines.
Koha::REST::V1:Auth is adjusted to handle 'patron_id' as well. 'borrowernumber'
handling is kept until the existing endpoints get updated.
To test:
- Apply the patches
- Run:
$ kshell
k$ prove t/db_dependent/api/v1/*.t
=> SUCCESS: Tests pass!
- Sign off :-D
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19784: Remove reference to 'borrowernumber' param from other endpoints
This patch removes the $ref occurences for borrowernumber in not
patron-specific endpoints. 'borrowernumber' is still used on them, but as a
hardcoded parameter. The param rename will happen on a separate bug for
each endpoint.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adapts the existing endpoint's tests so they expect:
- 'patron_id' for 'borrowernumber'
- 'library_id' for 'branchcode'
- 'category_id' for 'categorycode'
In the process, I tried to make the tests more robust, by creating random
data that gets deleted to make sure our tests cases can't have false
positives.
Independent subtests are wrapped inside transactions to avoid
eventual interference.
To test:
- Apply the patch
- Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: The api doesn't implement the expected behaviour and attributes
for endpoint responses
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 16330: Remove validation code from Koha::Patron
This patch removes previously added validation code from Koha::Patron
as we will rely on the DB structure and relationships to catch the same
problems. This is implemented on bug 19828.
This patch also adapts the API controller class to expect this behaviour
change from Koha::Patron. The expected exceptions are adjusted, and some
minor changes take place. The API tests are adjusted as well.
To test:
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Patrons.t
k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests should still pass
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch refactors the original work so it implements the controllers
and the spec using Mojolicious::Plugin::OpenAPI, and OpenAPI for the specification.
It removes the ability for patrons without permissions to edit their own data or their
guarantee's. This will be moved to a patron modification requests endpoint for simplicity.
It makes use of bugs 19410 and 19686 and their dependencies to deal with parameters handling,
query building and pagination.
Tests are adapted.
To test:
- Apply this patches and the dependencies
- Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Benjamin Rokseth [Wed, 27 Apr 2016 13:47:04 +0000 (13:47 +0000)]
Bug 16330: Add routes to add, update and delete patrons
This patch adds support for add, edit and delete patrons via REST API.
GET /api/v1/patrons Get patron list from params
GET /api/v1/patrons/<borrowernumber> Get single patron
POST /api/v1/patrons Create a new patron
PUT /api/v1/patrons/<borrowernumber> Update data about patron
DEL /api/v1/patrons/<borrowernumber> Delete a patron
Revised Test plan:
1) Apply this patch
2) Run tests perl t/db_dependent/api/v1/patrons.t
3) Add a user with proper rights to use the REST API
4) play with your favourite REST client (curl/httpie, etc.):
Authenticate with the user created above and get a CGISESSION id.
Use the CGISESSION to add, edit and delete patrons via the API.
5) Use PUT /patrons/<borrowernumber> for a patron without borrowers
flag. This should go into pending patron modification status and
needs to be accepted by a librarian.
Please note there is no validation of body input in PUT/POST other
than branchcode,category,userid,cardnumber.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jesse Maseto [Fri, 2 Mar 2018 14:48:06 +0000 (14:48 +0000)]
Bug 19488: Add borrowernumber to brief info on patron details pages in staff client
To test:
- View different tabs of a borrower's patron account in staff
- Verify the borrowernumber is shown in the brief info section
on the left
Signed-off-by: JM Broust <jean-manuel.broust@univ-lyon2.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 28 Mar 2018 12:42:19 +0000 (12:42 +0000)]
Bug 19564: (QA follow-up) Make commented out tests pass
We likely shoudln't pass through an uncoverted sort order for now, but
it does allow us to look ahead to implementing the orders directly so
seems a good option to have.
Either this patch should be used, or the commented out tests should be
removed
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 22 Dec 2017 18:21:51 +0000 (15:21 -0300)]
Bug 19564: Add tests for _convert_sort_fields
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19564: Fix extraction of sort order from sort condition name
Currently sort order is extracted from sort condition by splitting the
field, instead use regular expression to extract the last part preceded
by underscore.
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 21 Dec 2017 00:35:47 +0000 (21:35 -0300)]
Bug 19673: Allow to set patron attributes to 0 with batch patron modification
This patch will have to be tested deeply to make sure it will not
introduce regression!
The idea is to display an empty option in the patron attributes select
and ignore it. That way we can deal with false values 0 and "" which
were skipped before.
Test plan:
Add several patron attributes
Use the batch patron modification tool to add/update/remove them
Play with empty "" and 0 values, as well as other values
Modify several attributes in a row
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Thu, 4 Jan 2018 15:31:52 +0000 (15:31 +0000)]
Bug 19916: Add keyword and standard ID fields to acq external search
To test:
1 - Add an order from external source
2 - Note you don't have keyword or standard ID fields
3 - Add a catalog record from Z3950, note those fields are there
4 - Apply patch
5 - Check acq and note you do have those fields
6 - Do some searches to verify they work as expected
Signed-off-by: Maksim Sen <maksim.sen@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pasi Kallinen [Mon, 5 Mar 2018 07:09:28 +0000 (09:09 +0200)]
Bug 20330: Allow translating more of quote upload
Translate the error messages, and the table headers.
Test plan:
1) Go to Home -> Tools -> Quote editor -> Import quotes
2) Upload quotes from a file. Try to trigger the error messages
3) On successful import, check the table header texts
4) Apply patch, update & install a language
5) The error messages and the table header texts should
show up in the xx-YY-staff-prog.po
6) Repeat 1,2,3
Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi> Signed-off-by: Mark Tompsett <mtompset@hotmail.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: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: removed debian/control changes as the file is generated
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>