Jonathan Druart [Wed, 5 Jul 2017 13:44:55 +0000 (10:44 -0300)]
Bug 18854: Make sure offset will not be < 0 - protect from DoS
There was a bug that meant a very large offset in the search params
will cause the search script to run forever (or long enough to crash
the machine)
To test
1/ Get ready with sudo top so you can kill the thread before it causes
your machine to OOM
2/ Hit a page like yourdomain.com/cgi-bin/koha/opac-search.pl?q=1&offset=-9999999999999999999
3/ Notice the process runs for a long time
4/ Kill the process
5/ Apply the patch
6/ Hit the page again, notice the it loads (offset is set to zero)
7/ Do the same to search in the staff client
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit aabf001232fc46ee04cecb3a43fe8c0366a091df) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Chris Cormack [Sun, 25 Jun 2017 05:34:12 +0000 (17:34 +1200)]
Bug 18854 - Protect from DOS
There was a bug that meant a very large offset in the search params
will cause the search script to run forever (or long enough to crash
the machine)
To test
1/ Get ready with sudo top so you can kill the thread before it causes
your machine to OOM
2/ Hit a page like yourdomain.com/cgi-bin/koha/opac-search.pl?q=1&offset=-9999999999999999999
3/ Notice the process runs for a long time
4/ Kill the process
5/ Apply the patch
6/ Hit the page again, notice the it loads (offset is set to zero)
7/ Do the same to search in the staff client
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: changed -2 to 0 in opac-search.pl. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 99b32717cd2596ce89a2d46b8cb4ddbba2dea5ad) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Tue, 6 Jun 2017 15:50:19 +0000 (15:50 +0000)]
Bug 17639 - Remove white filling inside of Koha logo
This patch modifies the Koha logo SVG file to remove the fill from two
letters. This patch also optimizes the file and converts the text object
to paths for better cross-platform portability.
To test you could:
- Open the file in an editor and confirm that the change is correct
- or -
- Open the file in a browser and use the code inspector to add a
background-color attribute to the top-level <svg> tag. The logo should
appear transparent, with no white fills.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 068db9aaabb0694b4d12404bda16525efad0fde7) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Aleisha Amohia [Tue, 27 Jun 2017 01:40:48 +0000 (01:40 +0000)]
Bug 18858: Prevent warn when deleting a borrower debarment
To test:
1) Look at intranet log
2) Go to delete a debarment on a borrower
3) Notice warn
4) Apply patch
5) Add a new debarment
6) Delete this debarment
7) Notice warn is gone
Sponsored-by: Catalyst IT Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7ed66a6c8ae1c3c824e496c2d312e23db1dd8e41) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Fri, 23 Jun 2017 14:11:44 +0000 (14:11 +0000)]
Bug 18577 - Importing a batch using a framework not fully set up causes and endless loop
To test:
1 - Create a new framework - don't set it up
2 - Stage some records for import
3 - Manage the import, note your new framwork is in the list
4 - Apply patch
5 - Reload the page
6 - Note the framework is no longer an option
Followed test plan, worked as intended Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 96b1f92ae218bc889d1490385f934deec28f630a) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Julian Maurice [Wed, 28 Jun 2017 17:05:42 +0000 (13:05 -0400)]
Bug 18633: Remove useless use of CGI TT plugin
The form is sent using AJAX so there is never a query string in
the URL (no POST parameters either)
Tested both patches together, item search behaves as before, log
entries are gone Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a000d95a4d322607eccdbf08abc94dd78d4e5617) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Colin Campbell [Tue, 20 Jun 2017 15:35:35 +0000 (16:35 +0100)]
Bug 18830: Fix phrasing of screen message
Verb should be plural in this message
Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8a0ecda6c4ff368b9ff7a18593d7bdf4fc07e541) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lee Jamison [Thu, 22 Jun 2017 16:42:15 +0000 (16:42 +0000)]
Bug 18848: borrowers.lastseen comment typo
Typo in comment for the lastseen column in the borrowers table.
To test:
1. Verify lastseen column displays "last time a patron has been seed"
2. Apply patch
3. Verify lastseen column changed to "last time a patron has been seen"
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e3bf4fc8bb821456305d587a8d49fe39b07abd06) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lee Jamison [Thu, 22 Jun 2017 16:42:15 +0000 (16:42 +0000)]
Bug 18848: borrowers.lastseen comment typo
Typo in comment for the lastseen column in the borrowers table.
To test:
1. Verify lastseen column displays "last time a patron has been seed"
2. Apply patch
3. Verify lastseen column changed to "last time a patron has been seen"
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 23b84c0b6532d9c42894b648891d835e7624db49) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 14572 - insert_single_holiday() forces a value on an AUTO_INCREMENT column, during an INSERT
Removing all the id from the columns on the inserts and removing the
parameter '' of the values for the id.
Test plan:
1) Go to tools -> calendar
2) Add a Holiday only on this day.
3) Add a Holiday repeated every same day of the week.
4) Add a Holiday repeated yearly on the same date.
5) Add a Holidays on a range.
6) Add a Holidays repeated yearly on a range.
7) You should have the five calendars displayed.
Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b94b16f67963b03fd17170d2c2f2efa581c12c0f) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Colin Campbell [Thu, 8 Jun 2017 11:59:55 +0000 (12:59 +0100)]
Bug 18755: Allow empty passwords in Patron Info to return OK
With this patch a parameter 'allow_empty_passwords="1" can be added to a
login in the SIP configuration file to allow the behaviour as was normal
before the patch for bug 16610 was applied. Some sip clients rely on
this behaviour sending an empty password field when they wish to
validate to user but do not have the password.
If a password is supplied it will be validated
A test has been added to Message.t to confirm this behaviour
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>
(cherry picked from commit ebb887e5c93c96c6fc51d95b76de6a221ba4463e) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
The commands in the test plan are examples, and may need varying
depending on your installation. This was created as a result
of attempting to clean the installation process up. However,
I believe the redefine might exist normally too. I just didn't
check. This is tested on a Debian 8 box sudo apt-get update'd
fully.
TEST PLAN
---------
empty error log
$ echo > ~/koha-dev/var/log/koha-error_log
drop and recreate and empty db
> drop database koha_library;
> create database koha_library;
> quit
run the web installer, but DO NOT LOG IN!
*opening chrome to Staff Client URL*
check the error log
$ less ~/koha-dev/var/log/koha-error_log
...
[Fri Jun 09 13:08:52.793627 2017] [cgi:error] [pid 5802] [client 192.168.71.101:58169] AH01215: [Fri Jun 9 13:08:52 2017] CGI.pm: Subroutine multi_param redefined at /usr/share/perl5/CGI.pm line 419.
...
Marcel de Rooy [Wed, 14 Jun 2017 13:37:55 +0000 (15:37 +0200)]
Bug 18634: Handle colliding translation for preference sections
Problem on this report was caused by translating the tabs Privacy
and Payments by the same string. This caused overwriting a hash entry.
This patch tests if the key already exists and if so, it merges the
entries instead of overwriting the old contents.
Test plan:
[1] Make sure that e.g. Privacy and Payments translate to e.g Vie privee.
[2] Run translate install fr-CA (or the language you altered)
[3] Without this patch you should loose preferences from either Privacy or
Payments. With this patch, they should be merged.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with fr-CA.
Signed-off-by: Blou <philippe.blouin@inlibro.com>
Reset the .po files, reproduced the problem. Applied the patch and suddenly 'paypal' appeared.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0d98089ec701bc96893e68408ce2dedad36f7235) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Mon, 3 Jul 2017 09:42:21 +0000 (09:42 +0000)]
Bug 18434 - Followup fix tests for sorting and factes
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 540d488e980b2521b424bed0f0267002c6dbd03e) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Fri, 16 Jun 2017 14:01:12 +0000 (10:01 -0400)]
Bug 18434 - Followup - same changes for sort and facet fields
To test:
1 - Index some stuff with multiple fields defined for sorting
i.e. Authorites - make heading sortable - default is 110a and 111a for
heading - a record with 111a empty will make the sort field empty
2 - view the record:
curl http://localhost:9200/koha_kohadev_authorities/data/30?pretty=true
3 - Note the blank field
4 - Apply patch
5 - Reindex
6 - Fields should be correctly populated
Unit tests to follow (once I have the originals working for all)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 241be8ff1ae24fff6165c8d6877945637467ee9a) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 18434: (QA followup) Move _convert_marc_to_json tests into Indexer.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3b5529c3abca87afb4f66f5bc7d3aa0fe005c1aa) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Fri, 14 Apr 2017 14:03:11 +0000 (10:03 -0400)]
Bug 18434: Elasticsearch indexing broken with newer catmandu version
To test:
1 - Make sure you have latest koha deps, catmandu versions should be:
libcatmandu-marc-perl 1.09-1~kohadev1
libcatmandu-perl 1.0304-2~kohadev1
2 - Reindex elastic
3 - Try searching and likely notice odd results
4 - Try:
curl -XGET
'http://localhost:9200/koha_kohadev_biblios/data/792?pretty=true'
with a known biblionumber and notice some null fields
5 - Apply patch
6 - Reindex
7 - Note fields are populated and search works as expected
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9eb88f588bd13ddf25135c26acd905abe71f326a) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch tries to introduce exhaustive tests for this class method.
I didn't try to provide a regression test for the current bug per-se, but
cover the current method behaviour as much as I could.
(kidclamp) I added a quick test of _convert_marc_to_json to use the mocking here
and illuminate what the change does, before the patches this should
fail (fields are indexed in place of one another), after it should succeed (new indexed fields are appended).
A minor bug is highlighted by this new tests, I'll provide a followup for it.
To test:
- Run:
$ sudo koha-shell kohadev
k$ de kohaclone
k$ prove t/db_dependent/Koha_Elasticsearch.t
=> FAIL: The returned fixer rules are not the expected ones
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2d19a34529bc313922a085a99288e55d8634c8b6) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 18756: Users can view aq.baskets even if they are not allowed
Due to bad use of grep syntax if there is one or more Basket Users the result of grep is not equal to 0 and the borrower is allowed.
Test plan :
1- select system preference 'AcqViewBaskets' on 'user'
2- create 2 borrowers (A, B) with only permissions on acquisition :
group_manage
order_manage
order_receive
staff
3- login with A and create a basket
4- add a basquet manager other than B
5- relog with account B
6- you can see the basket
Apply the patch.
The basket is no longer visible.
1- relog with A
2- add basquet manager B
3- relog with B
5- you must see the basket
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0c09adbfc87b950b9f08aebede131ba694997290) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers [Wed, 14 Jun 2017 10:33:25 +0000 (12:33 +0200)]
Bug 18756 - add Unit Test
Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8b15c064405ff4a48cb3f5803dd6bd16d49d5b9b) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 5 Jul 2017 23:03:24 +0000 (20:03 -0300)]
Bug 18870: Force scalar context for Koha::Club methods
These 2 methods are called from the template in list context.
However since bug 18539 Koha::Objects->find can no longer be called in
list context.
Forcing the context to scalar fixes the problem and should not
introduced side-effects.
Test plan:
- Create a club template
- Create a club using this template
=> Without this patch you should no longer get the following error:
Template process failed: undef error - Cannot use "->find" in list
context at /home/vagrant/kohaclone/Koha/Club.pm line 51.
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a81947782bb884feccd5401499f1a6e8f469b0b0) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
TEST PLAN
----------
git grep -i getsupplierby
-- only the code removed and the test tweaked
git bz apply 18782
sudo koha-shell -c bash kohadev
prove -v t/db_dependent/Serials.t
qa -v 2 c 1
exit
-- sign off
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit c69e02c4419a2d4a7ca31af6441081cadd4e51b3) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Thu, 22 Jun 2017 06:55:16 +0000 (08:55 +0200)]
Bug 18214: Add check for shared or public list
Following the idea behind bug 10865, we are only showing the permissions
when the list is shared or public.
Adding a simple test in opac-shelves here.
Note 1: Since the owner can always add or delete entries, the permissions
will not be relevant anymore for a strictly private list.
Note 2: Staff view always shows the permissions. This could have been
changed here too, but that change is far less urgent (bug 10865 did not
touch staff view and bug 18228 will rearrange permissions anyway).
Test plan:
[1] Verify on OPAC that you see the permissions for a private list with
shares or a public list. And you do not see them for a private list
without shares.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit b494837c8d17a29936e2c2bcc067120c26876855) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Mon, 6 Mar 2017 08:44:48 +0000 (09:44 +0100)]
Bug 18214: Cannot edit list permissions of a private list
If you have disabled the pref OpacAllowPublicListCreation, your users are
not able to edit the list permissions for private/shared lists.
For a private list they may only be theoretically relevant, but for a shared
list they are relevant.
Since we do not always know the history of a list (has it been public or
shared, does it contains entries from other users) and therefore permissions
are even relevant for a currently private list, we should just allow editing
these permissions.
Test plan:
[1] Do not yet apply this patch.
[2] Disable OpacAllowPublicListCreation.
[3] Create a private list in OPAC. Edit the list. Verify that you do not
see the permission combo boxes.
[4] Apply this patch. Edit the list again. Do they appear now?
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Marc Véron [Wed, 14 Jun 2017 09:10:56 +0000 (11:10 +0200)]
Bug 18800: Patron card images: Add some more explanation to upload page and fix small translatabiity issue
The file
koha-tmpl/intranet-tmpl/prog/en/modules/help/patroncards/image-manage.tt
has a small translatability issue (sentence splitting by html tags).
This patch fixes it and adds a little bit more explanation about
uploading, using and replacing such images.
To test:
- Verify that text changes make sense
- Apply patch
- Go to Home > Tools > Patron card creator > Images and verify
that the page displays properly
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 053fbaf9267cce79ba80d23389b26f46a91111f8) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Wed, 31 May 2017 14:19:35 +0000 (16:19 +0200)]
Bug 18697: Final polishing
GetFictiveIssueNumber:
Returns undef instead of 0 for irregular frequencies. Also added to POD.
Removed unused variable $wkno.
Adding a return makes the if(unit) unneeded.
Replaced (a+b)/b by 1+a/b.
_delta_units:
Added a comment about its parameters.
GetFictiveIssueNumber.t:
Adjusted the tests for irregular frequencies accordingly.
Test plan:
[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t
[2] Run t/db_dependent/Serials/GetNextDate.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4e9701c36a6743eff72b8127de2cc79ff463013b) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Wed, 31 May 2017 13:20:40 +0000 (15:20 +0200)]
Bug 18697: Adjusting unit tests for dayly serial frequencies
No changes were needed for GetNextDate.t.
In GetFictiveIssueNumber.t we add a subtest for daily frequencies.
Test plan:
[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8eae9660839750d95c53f6cc2a4287a6196f0cc6) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Tue, 30 May 2017 14:44:46 +0000 (16:44 +0200)]
Bug 18697: Fix date calculation for dayly frequencies in Serials
The changes in _get_next_date_day are actually only cosmetic. The sub
now reads exactly the same as its counterparts for other units, but
the results are exactly the same as before.
In GetFictiveIssueNumber we now call _delta_units for each type of unit.
The two Delta_Days calls are moved to _delta_units. Note that this also
is a cosmetic change; results should be exactly the same.
Test plan:
[1] Edit a subscription. Test predication pattern for some daily freq.
[2] Run t/db_dependent/GetNextDate.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f65ca90b0f3d12a22c02918a37131b0c1ff8bd5e) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Tue, 30 May 2017 13:56:22 +0000 (15:56 +0200)]
Bug 18697: Adjusting unit tests for weekly serial frequencies
Corrections and added unit tests following the changes of the first patch.
GetFictiveIssueNumber.t: New subtest for weekly frequencies.
GetNextDate.t: Correcting a few dates one day. If we use 2/week, we will
calculate an interval of 3 days and correct with 4 days at the end of
the cycle. The connection with firstacqui is not relevant anymore.
Test plan:
[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t
[2] Run t/db_dependent/Serials/GetNextDate.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e25f4670f36e53db44931cbbcfb3c5df2125c71a) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Tue, 30 May 2017 13:01:52 +0000 (15:01 +0200)]
Bug 18697: Fix date calculations for weekly frequencies in Serials
Same solution applied as in bug 18356/18607. Consistency++
The code in _get_next_date_week is again very similar to the code in
_get_next_date_month or _get_next_date_year. I will not merge them here,
but we could consider that in the future.
Code in GetFictiveIssueNo has been adjusted similarly to month and year.
Test plan:
[1] Do not apply this patch. Create a subscription for 3/week.
When the first issue date is on a Saturday or Sunday, the
intervals in the prediction pattern are 0,0,7,0,0,7,etc.
Starting on Wed-Fri 1,1,5,etc. Starting on Mon-Tue 2,2,3,etc.
[2] Apply this patch. Check again.
The interval should be always 2,2,3 now and no longer depend on the
day_of_week of first issue date.
[3] Check another weekly frequency with multiple units per issue.
Say 1 issue/3 weeks.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ffb1c87d2962b19a07798da3bf81bef328270145) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Mon, 29 May 2017 10:08:40 +0000 (12:08 +0200)]
Bug 18607: Adjusting unit tests for monthly serial frequencies
The changes in the first patch require some corrections as well as
additional test cases.
GetNextDate.t: Since the calculation for multiple issues per unit has
slightly changed, a few dates (day 15 or day 16) have been changed in the
unit test; when we use 2/month, the algorithm now always adds 15 days.
Added a few test descriptions in this regard too.
GetFictiveIssueNumber.t: Add the monthly subtest with two test cases. In
the first case we tests multiple units per issue, and in the second case
we test multiple issues per unit (month).
Test plan:
[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t
[2] Run t/db_dependent/Serials/GetNextDate.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 05a49035ccff1d962ef0c21ca1b154e07ba5dba7) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Tue, 16 May 2017 12:46:55 +0000 (14:46 +0200)]
Bug 18607: Fix date calculations for monthly frequencies in Serials
Similarly to the solution of bug 18356, this patch fixes the date
calculation for monthly frequencies.
The calculation in GetFictiveIssueNumber now makes use of the new
_delta_units sub introduced on bug 18356.
The calculation in _get_next_date_month is also very similar to the one
in _get_next_date_year. I do not merge them here, but this could still
be considered later on. At least consistency is achieved now between
both routines. The connection with firstacquidate has been cut thru
just like for year units.
Test plan:
[1] Without this patch, look at the prediction pattern for a
subscription with first issue on Feb 21 and 5 per month. The first
issues will be 21, 22, 23, 24, 25. Then jumping to 21, 23, 25, etc.
[2] Apply the patch. Look at the same prediction pattern. You will now
see 6 day intervals and a new cycle starting on the 21st.
So Feb 21, 27, Mar 5, 11, 17 and Mar 21, 27, etc.
[3] Edit an subscription. Try a few other monthly frequencies.
[4] The next patch adjusts related unit tests.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit adfcd8d79c6691fb1062a2a5874a736b7792d303) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Tue, 9 May 2017 15:01:46 +0000 (17:01 +0200)]
Bug 18356: Fix date calculations for yearly frequencies in Serials
The problem as described on BZ 18356 is a combination of an error in
GetFictiveIssueNumber and GetNextDate for unit==year.
[1] In GetNextDate the Add_Delta_YM calculation should be applied only to
frequencies based on years per unit.
In the case of multiple units per year we calculate the number of days to
add. And if we have reached the end of a cycle, we correct the
rounding applied in the cycle.
NOTE 1: We obsolete the idea here of rebasing dates on firstacqui. In case
of manual adjustments, we probably do not want it. And otherwise we do not
need it anymore due to the correction at the end of a cycle.
NOTE 2: The calls to Add_Delta_YM are intentionally not corrected for leap
years. Say you start at 2016-02-29. If you use 1/yr or 1/2yr, you will
switch to the Feb 28th in the following years. In 2020 there will be no
switch to Feb 29 again; if someone should need it, please use a manual
adjustment. This is probably highly exceptional.
[2] In GetFictiveIssueNumber the year should be decreased by one if you
have more units per year and you did not yet reach firstacqui day and
month. This affects calculations in GetNextDate with irregularities.
NOTE 1: I added a wrapper around Date::Calc::N_Delta_YMD in order to improve
its results; this will especially be needed when we use it later for
month units.
NOTE 2: In case of manual adjustments this calculation does not really make
sense. Another report should deal with improving irregularities.
Test plan:
[1] Verify that both GetNextDate.t as well as GetFictiveIssueNumber.t pass.
[2] Look at the prediction pattern for a few frequencies.
For example: 1 iss/y, 1 iss/2y, 5 iss/y.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d71fb0e17c87a39fc5abe7c9b2d866636c244347) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch deals with tests for yearly frequencies.
Adjust/extend GetNextDate.t:
[1] Adjust mixup of units/issues in a description.
[2] Add testing +2 years on 29-2 of leap year for freq 1 issue/2 years.
[3] Add tests for freq 9 issues/year.
Add GetFictiveIssueNumber.t:
[1] Two subtests are provided for irregular frequencies (very trivial) and
for year frequencies (with four specific test cases).
Test plan:
[1] Run t/db_dependent/Serials/GetNextDate.t
[2] Run t/db_dependent/Serials/GetFictiveIssueNumber.t
Note: Without the second patch both tests should fail. This shows the need
of the adjustments in the second patch.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 285f6bd945373c06633b2c42621d754d93c37903) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Mark Tompsett [Thu, 15 Jun 2017 22:07:53 +0000 (18:07 -0400)]
Bug 18807: t/db_dependent/www/batch.t fails
get() does not take two parameters. fixed.
prove and run koha qa test tools
Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit da10c3169b8cae71bf4a98b6585654a09704c323) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 14 Jun 2017 19:56:13 +0000 (16:56 -0300)]
Bug 18807: Fix tests www/batch.t
Several things are wrong here:
1. It assumes that import_record_id is the biblionumber
=> Wrong, it is only true when the DB is empty and that the 2 AI equal 1
2. The encoding in the template is 'UTF-8', not 'utf8', it leaded to
"stage-marc-import.pl: marc21record.mrc: Unexpected charset UTF-8, expecting utf8"
3. We did not test that the biblio was correctly imported
Test plan:
Make sure the tests now pass.
For the www tests you need to set the following env vars:
KOHA_USER, KOHA_PASS, KOHA_INTRANET_URL and KOHA_OPAC_URL
Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 768c5758a2bb34876528e64edbb9d651942668c9) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 14 Jun 2017 18:53:18 +0000 (15:53 -0300)]
Bug 18806: Fix batch revert
Since bug 18242: When a biblio is deleted, a new transaction is created.
tools/manage-marc-import.pl use the AutoCommit flag, which does not
allow nested transaction.
AutoCommit must not be used.
Test plan:
Import a batch, then revert it.
The biblios must have been correctly deleted, they were not before this
patch
Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3db0401366b8e099ab2046d68cf20a9f754e1eae) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
To test:
- Review code, verify that line breaks are removed
- Run QA tools
- Bonus test: Create a "language" aa-AA and verify that no fragments
containign %%] are picked for the 6 files
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 9fb5f8519f2937aa7db6b53d6501f09ada11db4f) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Translators should not be confronted with such code internals.
To test:
- Review code change (it removes line breaks)
- Bonus test: Create a new translatin for "language" aa-AA and
verify that the line no longer appears in aa-AA-staff-prog.po
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 3b64ebe2346de50d2fa3745d0febb935b5cc8b75) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 14 Jun 2017 16:08:43 +0000 (13:08 -0300)]
Bug 18804: (bug 13501 follow-up) Fix add item form (select2)
Hard to say here, select2 adds so many elements that we need to ignore.
Here we just assume that input text with an id starting with
tag_952_subfield must be filled
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 8035a467f0b5d8441d4164bc183286d4f2593438) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Tue, 13 Jun 2017 20:43:39 +0000 (17:43 -0300)]
Bug 18804: Skip selenium tests if Selenium::Remote::Driver is not installed
We do not want these tests to fail if the module is not installed.
This module is not in the dependencies of Koha and it is good as it.
A developper who wants to use it will know what to do.
It is part of RM duties to make sure these tests pass
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 943a3a5c3ab4df6337607e1e237ff4f059d23da4) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marc Véron [Thu, 18 May 2017 18:02:33 +0000 (20:02 +0200)]
Bug 18630: Translatability (Clubs): 'Cancel' is ambiguous and leads to mistakes
The button to cancel a club enrollement is labelled with 'Cancel'. That is ambiguous and translates e.g. in German to 'Abbrechen' which can lead to
mistakes.
To test:
- Apply patch
- Enroll a patron to a club
- Enable public enrollment in OPAC
- Verify that the button to cancel enrollment in both OPAC and staff client
reads 'Cancel enrollement' (instead of 'Cancel' without patch)
(The button appears on the patron's detail pages in OPAC and staff client)
Amended for comment #4 / mv
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 628d8391d29a59f7d6a0ecfb52081684cee81403) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marc Véron [Sun, 4 Jun 2017 17:55:08 +0000 (19:55 +0200)]
Bug 11235: Names for reports and dictionary are cut off when quotes are used
To reproduce for saved reports:
- Go to Home > Reports > Guided reports wizard
- Create a report with double quotes in it's name, e.g. 'My "double quoted" report'
- Go to "Saved reports", locate in the list the new report (name is correct here,
is correct in database as well)
- From the selection button at the right choose "Edit"
- Result: Content of edit field for the report name is truncated (displays only: 'My')
To reproduce for Reports dictionary:
- Go to Home > Reports > Guided reports wizard
- Create a new definition, give it the name 'The "double quoted" definition' and enter
a text with double quotes for "Description"
- Save
- Verify that in the list of definitions both name and descriptions are truncated
(in database as well)
To test:
- Apply patch
- Verify that issues described above can no longer be reproduced
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f4c965781d82e9537015b695cc15677cd06d72cd) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Julian Maurice [Wed, 12 Oct 2016 10:38:16 +0000 (12:38 +0200)]
Bug 13452: Fix for plack
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a44f202fdb9c933e0b5ac88656e2c8f74e498023) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Julian Maurice [Fri, 2 Oct 2015 09:31:10 +0000 (11:31 +0200)]
Bug 13452: Fix obvious issues in issues_avg_stats.pl
- Remove joins with issuingrules which are not needed
- Fix the SQL query so that $weight is now the value of COUNT(*) instead
of a timestamp
- QA fix: '$column eq $itype' instead of '$column =~ $itype' (same for
$line)
Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 25d28e7c8100c1993f8794e39ed135781de04a47) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Katrin Fischer [Mon, 8 Jun 2015 23:04:07 +0000 (01:04 +0200)]
Bug 13452: 'Average loan time' report to obey item-level_itypes preference
Fixes the 'Average loan time' report so that the system
preference setting item-level_itypes is taken into account.
Before the patch, the report was always using the biblio
level itemtype. With the patch, it will depend on the pref
setting.
To test:
- Run various reports, compare results with both
possible pref settings
- Try limiting your search in various ways, especially
on a specific itemtype
- Make sure you switch checkboxes in testing,
using itemtype as the row or as the column
Notes:
- Filtering on a specific itemtype on master was not working
if the itemtype was chosen as column. The patch should fix that.
- Fixes headings and breadcrumbs so that the name of the report
is the same as on the reports start page
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d0bf036c1828bbbd37a022f8449e217e8e269475) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 21 Jun 2017 17:14:09 +0000 (14:14 -0300)]
Bug 18651: Do no LOCK/UNLOCK the table
We cannot LOCK the old_issues table here, other tables are accessed and DBIx::Class rename it with "me":
DBD::mysql::st execute failed: Table 'me' was not locked with LOCK
TABLES [for Statement "SELECT `me`.`issue_id`, `me`.`borrowernumber`,
`me`.`itemnumber`, `me`.`date_due`, `me`.`branchcode`,
`me`.`returndate`, `me`.`lastreneweddate`, `me`.`renewals`,
`me`.`auto_renew`, `me`.`auto_renew_error`, `me`.`timestamp`,
`me`.`issuedate`, `me`.`onsite_checkout`, `me`.`note`, `me`.`notedate`
FROM `old_issues` `me` WHERE ( `me`.`issue_id` = ? )" with ParamValues:
0='2'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832.
Consequence: We could have a checkin refused if there is a race, but
this is the simplest and safest way to fix it.
Jonathan Druart [Wed, 21 Jun 2017 14:05:59 +0000 (11:05 -0300)]
Bug 18651: Fix tests if no circ rule exist
The following test is failing on Jenkins:
# Subtest: Handle ids duplication
1..4
ok 1 - No account lines should exist on old issue_id
not ok 2 - Two account lines should exist on new issue_id
ok 3 - AddReturn should return the issue with the new issue_id
ok 4 - If an item is checked-in, it should be moved to old_issues even if the issue_id already existed in the table
not ok 4 - Handle ids duplication
When no circ rule exist
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 66f435149a8f2e116070ed28c34bdd5cd627a30f) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Tue, 20 Jun 2017 13:03:35 +0000 (15:03 +0200)]
Bug 18651: [QA Follow-up] Fix the MAX(issue_id) calculation
Found this by inserting the same issue_id in old_issues before checkin:
The call to ->search( )->get_column is in scalar context and will
return the number of results, i.e. always 1.
If you have an issue_id 2 in old_issues, it will crash:
DBIx::Class::Storage::DBI::_dbh_execute(): Duplicate entry '2' for key 'PRIMARY'
The fix is fairly simple: Put get_column in list context and pick the first
array entry.
NOTE: Using DBIx's get_column()->max here might look simpler here.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit ee7969d3461e6ce08b4fbfd982c90f263f19f693) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Mon, 22 May 2017 17:30:48 +0000 (14:30 -0300)]
Bug 18651: Update accountlines.issue_id is the issue_id has been changed during the move
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit be3d39c8b1e2671790ee5cb5cc7295eec3774a35) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Mon, 22 May 2017 17:26:25 +0000 (14:26 -0300)]
Bug 18651: Do not charge if the checkin failed
2. If the move fails for whatever reason (see
https://lists.katipo.co.nz/pipermail/koha/2017-May/048045.html for an
example), fines can be charged. It should not
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit acb7a717482c2a47f7da6a0d883784415bf3b8d5) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Mon, 22 May 2017 15:02:20 +0000 (12:02 -0300)]
Bug 18651: Update issue_id in AddReturn
1. AddReturn returns a $issue hashref with the old issue_id value
=> At first glance it does not affect anything, but would be good to fix
it for future uses.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit c3c9d61570b61ec49d508261f0500463a73925d6) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
David Cook [Wed, 11 Jan 2017 04:36:05 +0000 (15:36 +1100)]
Bug 17710 - C4::Matcher::get_matches and C4::ImportBatch::GetBestRecordMatch should use same logic
C4::ImportBatch::GetBestRecordMatch uses SQL to sort by score descending
then candidate_match_id descending. With C4::Matcher::get_matches, I
implement the same sort but use Perl code to do it, since we're sorting
search results.
It's a simple change, but it's in a big block of code, so I don't have
unit tests.
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6906b848a78ad4c7d52c1e7c7ce195f08cc6d2a6) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Mark Tompsett [Mon, 5 Jun 2017 22:18:07 +0000 (18:18 -0400)]
Bug 18732: Noisy t/SMS.t triggered by koha_conf.xml without sms_send_config
Upgraded systems may be lacking sms_send_config which makes t/SMS.t noisy.
This silently bypasses the problem.
Remove sms_send_config from your koha-conf.xml file
prove t/SMS.t
-- it will be noisy, but pass.
apply patch
prove t/SMS.t
-- noise gone.
run koha qa test tools.
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works correctly as indicated by the testing plan.
No "uninitialized" noise after patch is applied.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Slightly amended: turned the iif around.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f97addef42826c0007f91cace1f365de358a8b60) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Thu, 8 Jun 2017 15:19:22 +0000 (15:19 +0000)]
Bug 18752 - Automatic item modifications by age should allow 'blank' values
This patch modifies the automatic item modification by age template to
correct errors in form validation:
- Age in days should not be required
- A value should not be required in substitutions.
To test, apply the patch and clear your browser cache if necessary.
- Go to Tools -> Automatic item modification by age.
- Confirm that when editing or creating a rule the only required field
is the substitutions field name.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1bc45a470e55bcbb5e4031c001749a1ec9b35160) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marcel de Rooy [Mon, 15 May 2017 07:58:04 +0000 (09:58 +0200)]
Bug 18601: OAI/Sets.t mangles data due to truncate in ModOAISetsBiblios
This patch replaces the TRUNCATE statement in ModOAISetsBiblios by a
DELETE statement. A truncate will cause an implicit commit and will
therefore commit the transaction started in the test script.
Also simplifying the module load in the test script.
Test plan:
Do not apply this patch and observe that biblio records are added to your
database by running t/db_dependent/OAI/Sets.t.
Apply this patch, run the test again and verify that it does no longer
add records to your biblio table.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e0444e8600efbe06016ff857f23ea85893a93041) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lee Jamison [Wed, 7 Jun 2017 11:34:29 +0000 (11:34 +0000)]
Bug 18749 - xt/sample_notices.t fails
Bug Description:
When performing a unit test on xt/sample_notices.t with the command
'prove xt/sample_notices.t' 11 tests fail with the error message
"No sample notice to delete".
Cause of bug:
The failures are caused by an incorrect file path on Line 25 of
xt/sample_notices.t.
Patch Description:
This patch corrects the failures by changing $base_notices_file from
"en/default/sample_notices.sql" to "en/mandatory/sample_notices.sql"
Test Plan:
1) Drop into koha-shell and run the command 'prove xt/sample_notices.'
2) 11 unit tests fail.
3) Apply the patch.
4) Re-run 'prove xt/sample_notices.t'
5) All of the tests pass now.
6) Quit out of koha-shell
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 323cc1501fc91d67e8ecaa0a2cdf272f642d8e46) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Failed test 'ListMetadataFormats'
at t/db_dependent/OAI/Server.t line 150.
Structures begin differing at:
$got->{responseDate} = '2017-06-12T14:31:51Z'
$expected->{responseDate} = '2017-06-12T14:31:50Z'
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1b3f0c798b7770ecd7211be5998790e4a9f3999a) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lee Jamison [Sat, 10 Jun 2017 09:26:51 +0000 (09:26 +0000)]
Bug 18584: Fix trailing spaces in C4/Accounts.pm
Removed trailing spaces at line 182 of C4::Accounts.
Test plan:
1. Edit C4/Accounts.pm and verify trailing spaces
2. Apply patch
3. Verify that trailing spaces in C4/Accounts have been removed
Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a80ed84d070f81065b1fb2fa14f5ced3c25d6431)
Marc Véron [Tue, 30 May 2017 06:41:53 +0000 (08:41 +0200)]
Bug 18694: Translatability: Get rid of exposing [%% FOREACH in csv/cash_register_stats.tt
Code exposed is:
%s %s %s [%%- FOREACH field IN row; field IF !loop.last; ItemTypes.GetDescription(field) IF loop.last; sep IF !loop.last; END %%] %s TOTAL [%%- FOREACH field IN total; field; sep IF !loop.last; END %%]
Similar for: csv/orders_by_budget.tt
To test:
- Apply patch
- In staff client, verify that Cash register statistics work as before
(Home > Reports > Cash register statistics)
- Verify the same for Home > Reports > Orders by fund (triggers orders_by_budget.tt)
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
from folder misc/translator, verify that lines mentioned above do
no longer appear in aa-AA-staff-prog.po )
- Run QA tools (newest version with test for newlines in tt directives)
Rebased on top of Bug 18734 2017-12-06 / mv
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ec478e18f352d340c7a1ec4416121928229c2907) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Wed, 24 May 2017 13:46:50 +0000 (13:46 +0000)]
Bug 18656 - Require confirmation of deletion of files from patron record
This patch adds a JavaScript confirm to the deletion of files. It also
styles the file deletion link as a Bootstrap button.
To test, apply the patch and open the "Files" page for a patron who has
files attached.
- Verify that clicking any "delete" link prompts for a confirmation.
- Verify that confirming the dialog triggers the deletion of the correct
file.
- Verify that canceling the confirmation dialog aborts the deletion.
- Confirm that the "Delete" button looks correct.
Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Revision for QA: Replaced '.click(function' with '.on("click",function'
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a38ffe2d48c35029ef80ea0a4294e36b408cd1a4) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Mark Tompsett [Fri, 9 Jun 2017 23:23:49 +0000 (19:23 -0400)]
Bug 18411: Fix failing search_utf8.t tests
TEST PLAN
---------
export KOHA_INTRANET_URL=...
prove -v t/db_dependent/www/search_utf8.t
something like seen before failure:
t/db_dependent/www/search_utf8.t .. 9/66 Error GETing http://koha_16_11:8080/cgi-bin/koha/tools/background-job-progress.pl?jobID=741d649f9d4472fe75f30761ba2488c0: Bad Request at t/db_dependent/www/search_utf8.t line 170.
apply this patch
prove -v t/db_dependent/www/search_utf8.t
Now it is the marc staging that is failing.
And that is failing in master for me.
So, I don't think it is the test that is a problem at this point,
but the actual staged marc records process.
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
I'm not sure why you had problems. All 66 tests passed
after patch application and the patch also passes QA Tools.
I tested this patch on a brand new kohadevbox without issue.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bd14d2db9c6f6ac34a1dc0ea4ab741c05c22e5d3) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Julian Maurice [Wed, 7 Jun 2017 09:29:46 +0000 (11:29 +0200)]
Bug 18741: Fix loading of SQL files in web installer
Test plan:
1. Start a normal install using the web installer
2. When asked to select data to load, verify that
'message_transport_types' is checked, and check some optional data
files
3. Continue the install to the end
4. Verify that message_transport_types is not empty, and that the
optional data you checked is there
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8d2270254187b7d876d466860a76fd231b9549c2) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers [Wed, 31 May 2017 14:10:41 +0000 (16:10 +0200)]
Bug 18706 - Remove useless Javascript
Whe checking a subfield to be deleted, the code
$(this).val($(this).siblings("[name='subfield']").val());
is useless, the checkbox already contains the subfield code :
<input type="checkbox" ... name="disable_input" value="[% ite.subfield %]" />
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6bb4a0405abe0d03be3915644c6a05e2e3ee1e9f) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers [Wed, 31 May 2017 14:02:44 +0000 (16:02 +0200)]
Bug 18706 - subfields to delete not disabled anymore in batch item modification
In Tools > Batch item modification, one can click a checkbox to delete a subfield.
This click use to disable the input to change the field value.
This comes from the patch : Bug 13501: Move "Required" and checkbox after input/select
Because input is found using JQuery next().
This patch replaces with $(this).parent().find("[name='field_value']").
Test plan :
- Go to Tools > Batch item modification
- Enter a barcode and submit
- Click on a checkbox on a non-mandatory subfield
=> Without patch the input or select is not disabled
=> With patch the input or select is disabled
- Submit
=> Check that subfield is deleted
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c9273be169ca4da47059aa152f8c6ea11137a52) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 18716: Remove CGI::param warns from updatesupplier.pl
This script floods the logs with this kind of warnings.
To test:
- Run:
$ koha-plack-err
- Edit a vendor in the acquisitions module
- Save
=> FAIL: Logs show lots of warnings that look like:
CGI::param called in list context from package CGI::Compile::ROOT::home_vagrant_kohaclone_acqui_updatesupplier_2epl
- Apply this patch
- Run:
$ restart_all
$ koha-plack-err
- Edit a vendor, add/delete vendor contacts
=> SUCESS: No more warnings
- Verify editing and storing vendor contacts works as expected.
- Sign off :-D
Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c35932923407e9ec088957f877e8607289b6b914) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 18767: Remove useless diags from GetDailyQuote.t
This tests print useless debugging info.
To test:
- Run:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ prove t/db_dependent/Koha/GetDailyQuote.t
=> FAIL: Some output telling what is doing on each step is printed.
- Apply the patch
- Run
k$ prove t/db_dependent/Koha/GetDailyQuote.t
=> SUCCESS: No output, YAY!
- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 78a9f39f9a97179af3e3a38cf8cb17b3f043d88a) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marc Véron [Mon, 5 Jun 2017 04:52:58 +0000 (06:52 +0200)]
Bug 18727: System preferences loose part of values because of double quotes
System preferences do not display values of text fields properly if they
contain doulbe quotes.
To recreate:
- Go to Home > Administration > System preferences , then tab Acquisitions
- Enter values to both system preferences like proposed in the example (o=5|a="bar foo" and o=5|a="foo bar")
- Save
- Click on tab Acquisitions to reload
- Wrong result: Both preferences show a value of: o=5|a=
(parts with double quotes are truncated)
- Edit any of the email addresses (Bug 9814):
KohaAdminEmailAddress, NoticeBcc, ReplytoDefault, PayPalUser
- Set value to: "The Library" <thelibrary@example.com>
- Search for this email address syspref to re-display it
- Wrong result:
Use [ ] " autocomplete="off" /> as the email address for the
administrator of Koha.
To test:
- Apply patch
- Try to recreate issues above
- Additionally, edit other system preferences that could contain double
quotes, e.g. LibraryName or UsageStatsLibraryName
- Set value to: Bibliothek "Zur Leseratte"
(Note: patch contains a tiny fix for a typo in acquisitions.pref)
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6e7c125a56be8971ec9c9bb52373bff5004a936a) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Marc Véron [Sun, 4 Jun 2017 16:04:00 +0000 (18:04 +0200)]
Bug 18689: calendar error with double quotes in title or description of holiday
This patch fixes the calendar display with holidays having double qoutes in
title or description.
To test:
- Apply patch
- Go to Home > Tools > Calendar
- Create new holidays of each type (Day only, repeated wekly/yearly,
range, yearly repeated range and enter double qoutes in their titles and
descriptions
- Verify that calendar displays and works as expected
- Verify that you can edit the holidays
Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f1d90f205e3dc8177c0d524b208d9d4a367cf56e) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Josef Moravec [Mon, 5 Jun 2017 11:20:18 +0000 (11:20 +0000)]
Bug 18722: Fund name is not shown in received orders fund subtotals
Test plan:
1) Go to acquisition and receive some orders
2) Show the receive summary for invoice
--> without patch, the fund name in subtotal is not shown
--> with patch the name is shown as expected
Signed-off-by: Michael Cabus <michael@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6a2ef935ac63c67a4b31d8c3eb9bcb8d974d844e) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Mark Tompsett [Mon, 5 Jun 2017 16:24:07 +0000 (12:24 -0400)]
Bug 18730: Batch Mod Edit <label> HTML validation fails
[tag] [reply] [−] Description M. Tompsett 2017-06-05 16:30:21 UTC
Know the barcode of an existing item.
Home -> Tools -> Batch Item Modification
Enter the barcode
Click
View Page source
select and copy it into validator.w3.org direct input.
There will be complaints about <labels>.
Apply this patch
refresh the page.
select and copy it into validator.w3.org direct input.
There will be no complaints about <labels>.
This is intended to be a highly focused HTML bug, as the
missing form tag which will fix the <div> issues at the bottom
is corrected on bug 18710.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
(cherry picked from commit eb0a67ea10c9210dbfb42f810c280b7515b04a16) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 18766: Remove itemtype-related warnings from ArticleRequests.t
This patch fixes a small mistake on that test file (itype vs. itemtype
in itemtypes table)
To test:
- Run:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ prove t/db_dependent/ArticleRequests.t
=> FAIL: itemtype-related warning displayed
- Apply the patch
- Run
k$ prove t/db_dependent/ArticleRequests.t
=> SUCCESS: No warnings, YAY!
- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e426da4e009ce63c10923eaddd1ca271dca8005e) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>