]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 24147: Don't assume search_related will return ordered values
Jonathan Druart [Thu, 20 Aug 2020 12:32:43 +0000 (14:32 +0200)]
Bug 24147: Don't assume search_related will return ordered values

This test is failing randomly because it assume the order is always the
same. But it's not.

Note: Koha::Objects->search_related is never used , last use removed from
  commit 9aa724cdf29a57bc91e42b240b5bcd19e3814ada
  Bug 19599: Speed anonymise_issue_history up
We should keep it however IMO

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>
(cherry picked from commit e10dc503289e8d7e8c742af0111acb79d4d53111)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e550f25a013f43bec8c2ee1694541dafd2a84a85)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25584: Fix minor styling issue
Tomas Cohen Arazi [Thu, 27 Aug 2020 18:10:08 +0000 (15:10 -0300)]
Bug 25584: Fix minor styling issue

This patch makes the button present some space between the icon and the
text.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2a0ccf7af26236db9a3e40968cf8f43bc308f142)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 81fd27153a26154da576eaaba7274968b36f1a3f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25584: Refresh checkouts table when a return claim is added
Tomas Cohen Arazi [Thu, 27 Aug 2020 17:57:45 +0000 (14:57 -0300)]
Bug 25584: Refresh checkouts table when a return claim is added

This patch triggers a checkouts table refresh when a return claim is
added. I also noticed the same when a return claim is deleted so it is
now also refreshed.

To test:
1. Set the ClaimReturnedLostValue to some valid value (2)
2. Check something out for a patron, and choose to display all checkouts
=> SUCCES: There's the checkouts table, showing the checkout
3. Click on the 'Claim returned' button and confirm
=> SUCCESS: There's no 'Claim returned' button anymore
=> ERROR: The checkout row doesn't display anything about the claim
4. Go to the 'Claims' tab, delete resolve and delete the claim
5. Go to the Checkouts tab
=> ERROR: It doesn't reflect the changes either
6. Apply this patch and start over
=> SUCCESS: Once the claim returned is added, the checkouts table is
refreshed and the information updated
=> SUCCESS: On the Claims tab, if you delete the claim and go to the
Checkouts tab, you are presented the button again.
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7fc7427dd41ce10070a6a3d3070fb660850be511)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit def41d6231ae204022664d6d2b7de02fbb4c1414)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26324: Fix spelling resizable vs resizeable in Dopop
Jonathan Druart [Mon, 31 Aug 2020 12:26:26 +0000 (14:26 +0200)]
Bug 26324: Fix spelling resizable vs resizeable in Dopop

The correct spelling of the parameter is resizable
https://developer.mozilla.org/fr/docs/Web/API/Window/open

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>
(cherry picked from commit ce7f4d16d6acdc6a56d40e6ebd96d722f1c77387)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1475ea89e5daedf4a5fea29c09feb4ca5561aa39)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26069: Pass correct URL to twitter
Jonathan Druart [Fri, 21 Aug 2020 14:07:46 +0000 (16:07 +0200)]
Bug 26069: Pass correct URL to twitter

We don't provide the url of the detail page so the twitter JS code
retrieve the current location, with the search terms.

Test plan:
Do a search
Click on a result
Click on the twitter button and confirm that the link only contain
biblionumber=x in the parameter

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5fd8774c687c6aaf6716485ab9bd72a69a0e2f76)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 48b10b3cf5f267b15d8f2008e90e0a88d379fe1d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 17661: Trivial simplification using += operator
Jonathan Druart [Mon, 31 Aug 2020 13:25:05 +0000 (15:25 +0200)]
Bug 17661: Trivial simplification using += operator

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c96fabb8c47320dba55372e4b955fb171310adec)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 81865f77777273d96169bfe6afa760e11be0c7da)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 17661: (follow-up) Update regex to support Unicode characters
Nick Clemens [Thu, 27 Aug 2020 16:27:09 +0000 (16:27 +0000)]
Bug 17661: (follow-up) Update regex to support Unicode characters

Rather than limiting initials to [A-Z] we should test for a broad
range of uppercase letters.

The ES/Zebra changes are slightly different because of Perl vs Java regex
conventions. POerl may support either, but I found 'Uppercase' to be a bit more explicit

More info here:
https://perldoc.perl.org/perlunicode.html

TO test:
Same plan as before but use Ж. as the ending initial
Confirm the period is preserved and other punctuation removed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 224ac84aeca3b8dba87366925d83b01e0f5c1110)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f297fb819c38553899f2cde10b108ca8fa712dce)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 17661: Ending punctuation causes duplicate facets
Nick Clemens [Thu, 2 Nov 2017 16:52:53 +0000 (16:52 +0000)]
Bug 17661: Ending punctuation causes duplicate facets

The current code for facets doesn't pull strip ending punctuation from facets
This causes duplicate facets for terms that should be combined

Sometimes series can have different punctuation depending on the field they are in
Author initials punctuation should be preserved

To test:
1 - Do search and pull up some records
2 - Edit some of the records to have authors like:
    Date, C.J.
    Date, C.j.
    Date, C.J .
3 - Edit the records to have some series statments like:
    830 $aDate, C.J. ;$v5
    830 $aDate, C.J. ; $v5
    830 $aDate, C.J.; $v5
4 - Add some 490s to the record with first indicator 1 and series like:
    You wouldn't want to--
    You wouldn't want to
    You wouldn't want to..
5 - Search again and note you have 3 facets each for author and series
6 - Apply patch
7 - Repeat
8 - Now you get 2 facets for author, period not removed when following Upper case immediately, is otherwise
9 - Now you should have a single series facet
10 - Switch search engine to ES (index before applying patch)
11 - Note facets are separate again
12 - Reset mappings and reindex
   perl misc/search_tools/rebuild_elasticsearch -v -r
13 - Repeat search, facets combined as above

Signed-off-by: Sarah Cornell <sbcornell@cityofportsmouth.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e34f95a1f5eb0fce238ab442553bec5233263a9c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0bfeb9990181445a14e4858b3d61954c1daf30ce)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25958: DBRev 19.11.09.001
Aleisha Amohia [Wed, 9 Sep 2020 09:50:43 +0000 (21:50 +1200)]
Bug 25958: DBRev 19.11.09.001

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25958: (QA follow-up) Implement filter in database query instead of in loop
Kyle M Hall [Mon, 24 Aug 2020 17:13:17 +0000 (13:13 -0400)]
Bug 25958: (QA follow-up) Implement filter in database query instead of in loop

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 66382458dc46356818473935e8d5546f13f05645)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9a544a86dbaa00dfce906f683556fea5d30805fb)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25958: (QA follow-up) Add some punctuation to new DefaultLongOverdueSkipLostStatuses
Katrin Fischer [Sat, 22 Aug 2020 02:41:20 +0000 (02:41 +0000)]
Bug 25958: (QA follow-up) Add some punctuation to new DefaultLongOverdueSkipLostStatuses

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d99651efd0a9a827b91f4575ab6f1d4344c7cfb0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bd56e23748f459f983bbca07bc7b019b70192dd5)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25958: Allow LongOverdue cron to exclude specified lost values
Kyle M Hall [Tue, 28 Jul 2020 11:55:18 +0000 (07:55 -0400)]
Bug 25958: Allow LongOverdue cron to exclude specified lost values

When lost items are not marked as returned, they are still subject to
the long overdue cron, so an item that has already been marked Lost may
automatically roll to Long Overdue. In some cases, a library may not
want that lost value to change. This becomes especially important with
the introduction of Claims Returned, which uses a variety of lost.

Test Plan:
1) Set up a long overdue item that would be moved to lost by longoverdue.pl
2) Run the cronjob with the new --skip-lost-value option
3) Note the item is not altered
4) Include that value in the new system preference DefaultLongOverdueSkipLostStatuses
5) Run the cronjob *without* the new option
6) Note the item is not altered
7) Run the cronjob again with the new command line option, but set it to
a different value so the item will be affected
8) Note the item is altered as it would have been before this patch was
applied

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 48edb2947163c1e9a70b11de40a71ebed747952f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 411619f209d071a8e2250a8979f3a336827dafb5)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 21539: addorderiso2709.pl forces librarian to select a ccode and notforloan code...
Kyle M Hall [Wed, 10 Oct 2018 15:13:37 +0000 (11:13 -0400)]
Bug 21539: addorderiso2709.pl forces librarian to select a ccode and notforloan code when using MarcItemFieldsToOrder

There is no reason that MarcItemFieldsToOrder should force librarians
to select a ccode and notforloan value for each item.
They are both optional fields.
As with location, the first value should be an empty 'none' option.

Test Plan:
1) Set up MarcItemFieldsToOrder, do *not* set mappings for ccode and notforloan
2) Add an order record to a basket that uses MarcItemFieldsToOrder
3) Note you must choose a ccode and nfl value
4) Apply this patch
5) Reload the page
6) Note you no longer have to select values for ccode and notforloan

Signed-off-by: Daniel Gaghan <daniel.gaghan@pueblolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0c79b7d93b96434ddf91c6ddabb1570836736a15)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5f6b557599b83e0230a3dca5b527924e883d17a3)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25791: Remove win.print()
Lucas Gass [Wed, 15 Jul 2020 22:28:07 +0000 (22:28 +0000)]
Bug 25791: Remove win.print()

Test plan:
1) Turn on system preference SelfCheckReceiptPrompt
2) Check out item via /cgi-bin/koha/sco/sco-main.pl
3) Click "Finish"
4) Click 'Print receipt and end session'
5) Notice two print dialog boxes right on top of each other
6) Apply patch
7) Repeat steps 1 - 4
8) Should only get a single print dialog.
9) Test in FF/Chrome and make sure behavior is consistent

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6797f07bbdfb90c556f52bfe2f83cefdf91495f3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 59b67c3b37ed92926e9c75c0637c58af255ecec2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25903: Add unit tests
Kyle M Hall [Thu, 20 Aug 2020 11:56:12 +0000 (07:56 -0400)]
Bug 25903: Add unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 49f5200374e9a381ab7398730e42c0beefc0f2a4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 73c246238bc21aa48689a8027cd3ae01fb7f9232)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25903: Sending a SIP patron information request with a summary field flag in...
Kyle M Hall [Tue, 30 Jun 2020 18:37:21 +0000 (14:37 -0400)]
Bug 25903: Sending a SIP patron information request with a summary field flag in indexes 6-9 will crash server

The 'summary' field in the patron information request specifies if detail information should be send for holds,
overdues, fines, etc. The field is 10 characters in length (0-9). However, the SIP2 spec only defines indexes 0
though 5, leave 6 though 9 undefined. Some ILSs specify behavior for these undefined indexes. Apparently the
7th field is often used to request 'Fees', as opposed to 'Fines' in some ILS. Some software that integrate via
SIP try both the 5th and 7th indexes to ensure they get all fines and fees.

The problem is that Koha's SIP server crashes if any 'summary' index beyond 5 is flagged. We should simply
ignore flags beyond 5 and act as if no flags were sent.

Test Plan:
1) Enable SIP for your instance
2) Send a patron information request with a summary flag in any index beyond 5.
   i.e.: 6300120200617    124846      Y   AOMIDAY|AA21030050054321
3) Note the SIP server just closes the connection without a response
4) Apply this patch
5) Restart the SIP server
6) Send the same request
7) Note you get back the patron information response!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jeff Gaines <jgaine@arlingtonva.us>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fd4dbba7fb25bb73bcee152c84e704f9796664fd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b870bac520083283abb199a059ed767165ead677)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26076: (QA Follow up) Prevent error by using a fresh resultset
Kyle M Hall [Thu, 30 Jul 2020 13:35:38 +0000 (09:35 -0400)]
Bug 26076: (QA Follow up) Prevent error by using a fresh resultset

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c9887a87538b2113c48db8cd2751a4bcf2bd2168)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3a4f76b60d880fabb5bb6637839d1a83e673e1d6)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26076: Sum the amount due in the database query instead of a loop in Perl
Kyle M Hall [Tue, 28 Jul 2020 16:49:35 +0000 (12:49 -0400)]
Bug 26076: Sum the amount due in the database query instead of a loop in Perl

This appears to be a bug due to inaccuracies in floating point math. I've been unable to reproduce it on demand. Sometimes when using the "Write off selected" button, Koha will give the error that the payment is more than the amount owed, even though they are the same. The solution I've implemented is to move the summation from Perl code to the database query. This video demonstrates the issue and afterward, shows the error goes away after the patch is applied: https://monosnap.com/file/pG69HC7iI9mU9kkuoCtbkVzVTffKlE

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Verify that "Write off selected" functions as usual

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 64412969037ac9a9f81f05c69c3dd43bd3cab90b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2e3b3a23fc6c3c1183853a6b5022598930b55b0d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26233: (bug 25553 follow-up) Make date columns sortable on the edit items table
Jonathan Druart [Tue, 18 Aug 2020 08:54:43 +0000 (08:54 +0000)]
Bug 26233: (bug 25553 follow-up) Make date columns sortable on the edit items table

We were missing to pass the title-string to datatables.

Test plan:
Retest bug 26233, with appropriate dates

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit df5c9d0725dec84a3d57f97a7728cbc7e1cac9fc)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25778: Fix var scope in koha-plack for PERL5LIB and KOHA_HOME
David Cook [Fri, 14 Aug 2020 01:49:40 +0000 (01:49 +0000)]
Bug 25778: Fix var scope in koha-plack for PERL5LIB and KOHA_HOME

Currently, if a koha-plack is given multiple instances, it will create
duplicate $KOHA_HOME/installer and $KOHA_HOME/installer/lib entries
in PERL5LIB as these changes are done at the global rather than local level.

This issue can only be seen in non-dev Koha, since dev Koha installs
rewrite PERL5LIB.

This patch localizes PERL5LIB to each instance.

To test dev installs:
0. cp debian/scripts/koha-plack /usr/sbin/koha-plack
1. koha-plack --restart kohadev
2. Note that nothing breaks

To test non-dev installs:
0. Don't replace /usr/sbin/koha-plack yet
1. Create multiple non-dev installs with plack enabled and running
2. Set up one of these non-dev installs so you can use the web
UI (that is beyong the scope of this test plan)
3. koha-plack --restart test1 test2 test3
4. For test3, go to /cgi-bin/koha/about.pl
5. Note that there are duplicate /usr/share/koha/installer
and /usr/share/koha/lib/installer entries in PERL5LIB
6. cp debian/scripts/koha-plack /usr/sbin/koha-plack
7. koha-plack --restart test1 test2 test3
8. For test3, go to /cgi-bin/koha/about.pl
9. Note that there are no duplicates entries in PERL5LIB

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 89721cb42b3928c745677c70fd9061273d1848dd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 670193ad16c7d5e6f288bc6288a0a033f8e02026)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26213: Remove the use of jquery.checkboxes plugin when adding orders from MARC...
Owen Leonard [Fri, 14 Aug 2020 14:18:00 +0000 (14:18 +0000)]
Bug 26213: Remove the use of jquery.checkboxes plugin when adding orders from MARC file

This patch removes the use of the jquery.checkboxes plugin from the page
for adding orders to a basket from a staged MARC file.

This patch fixes an unreported bug wherein the "select all" and "clear
all" controls affected not only MARC record checkboxes but also the
"show inactive funds" checkboxes.

To test, apply the patch and go to Acquisitions.

- Go to Vendor -> Add to basket -> From a staged file.
- Select a staged file with multiple records.
- Test the "Select all" and "Clear all" links at the top of the "Select
  to import" tab. They should work correctly to select and deselect
  checkboxes corresponding to staged MARC records.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8344ee7b4ced266ac7bd48254f4695175fd8f19b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f681964591ba1efde4c1c8c032c344b85c1d1815)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25751: Add ORDERED in dropdown list of suggestion's statuses
Jonathan Druart [Tue, 16 Jun 2020 13:44:40 +0000 (15:44 +0200)]
Bug 25751: Add ORDERED in dropdown list of suggestion's statuses

The status "ORDERED" is missing from the pull down list of
status values when editing a suggestion, so the first
option is selected "No status".

This leads to data loss when editing a suggestion in the
status "ORDERED". Worse: the status can't be reset to
"ORDERED" and so no AVAILABLE notice can be sent to the patron.

Test plan:
- Create a suggestion, accept it, create a new order from this suggestion.
- Verify status is "ORDERED"
- Edit the suggestion
=> Without this patch the dropdown list does not have
   "Ordered", and if you save you lost the status
=> With this patch applied the dropdown list has "Ordered"
   preselected. You can save and preserve the status.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit eeb7ac6fc0d14c9e731b7759c78f37cadcfa575f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c320dfa3beef2bce10e87572ee9dd7f6849a694f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded
Alex Buckley [Sun, 14 Jun 2020 22:41:03 +0000 (22:41 +0000)]
Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded

If 'Actual cost' has not been set then it has the value of 0.00 which
Perl evaluates to true so this patchset resets it to 0, so the fallback
to ecost_tax_included/ecost_tax_excluded happens.

Test plan:
1. Add item to acquisition basket (make sure the vendor has: tax rate: 15%, 'List prices: Include tax', 'Invoice prices: Include tax')
2. Set 'Vendor price' = 10 and do not set 'Actual cost'
3. Save order
4. Observe basket.pl shows 'Total tax exc.' has a value of 0.00 and GST
column has value of -8.70

5. Jump into the database:
select tax_value_on_ordering from aqorders where
ordernumber=<ordernumber>;
[You can get the ordernumber from clicking on the 'Modify' line the item
is listed in]
6. Observe a negative value: -8.70

7. Apply patch and restart plack
8. Add a second item to the basket
9. Set 'Vendor price' = 10 and don't set 'Actual cost'
10. Save order
11. Observe basket.pl shows 'Total tax exc' has value of 8.70 and GST
has value of 1.30
12. Repeat step 5 and observe tax_value_on_ordering = 1.30
13. Run t/Prices.t unit test:
sudo koha-shell <instancename>
prove t/Prices.t

Sponsored-by: Horowhenua District Council, NZ
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7b66b90fe707e8ac650a1c85d87560fc2f4a223d)
(cherry picked from commit 3bbf6384492834055d38ac844521be6c02d503ab)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26119: Enable patron's attribute edition when PatronSelfRegistrationVerifyByEmail
Jonathan Druart [Mon, 3 Aug 2020 11:09:54 +0000 (13:09 +0200)]
Bug 26119: Enable patron's attribute edition when PatronSelfRegistrationVerifyByEmail

There is no good reason remove the ability to edit patron's attributes
if PatronSelfRegistrationVerifyByEmail is set.

We cannot have them in the self-registration form (because we don't
store patron's attributes during self-ref), but we can have them when
a patron show/edit their information.

Test plan:
0. Enable PatronSelfRegistrationVerifyByEmail and create patron's
attributes that can be edited at the OPAC
1. Create a new patron using the self-reg feature
=> You don't have the ability to fill in the patron's attribute
2. Edit your personal details (OPAC)
=> Without this patch you still don't see the patron's attribute that
can be edited at the OPAC
=> With this patch applied you can!
3. Notice the wording change on the "Modify patron attribute type" form
and confirm it makes sense

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fc22fb308bdbfc6d1bda3448e966542f2828ad76)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ae54212e7d05564332dbb28b99ed61103cdecaae)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26228: Update gulpfile to work with Node.js v12
Tomas Cohen Arazi [Mon, 17 Aug 2020 15:12:55 +0000 (12:12 -0300)]
Bug 26228: Update gulpfile to work with Node.js v12

This patch makes the gulpfile work with gulp v4 on Node v12. To test it,
make sure your dev env has Node.js v12.

It also replaces the use of 'gulp-util' (deprecated) by 'minimist' as
recommended on their site.

On both KTD and KohaDevBox edit your sources.list so the node line
points to 'node_12.x' instead of 'node_8.x'.

Once that's done:
1. On your clone run:
   $ yarn install
   $ npm install -E
2. Build the CSS:
   $ yarn build
   $ yarn build --view opac
=> SUCCESS: Things build correctly
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a7e3c12e6175e19299e7bdbe60d1bc7d41d45ce8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 65f443f22f78600979a36a422c8f1e71f580ee18)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26078: (follow-up) Use a boolean rather than changing returnbranch
Nick Clemens [Fri, 14 Aug 2020 11:30:12 +0000 (11:30 +0000)]
Bug 26078: (follow-up) Use a boolean rather than changing returnbranch

Bug 26078: (follow-up) used validTransfer instead of checking WrongTransfer message

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d8f3e0ec0dbaf73075299a88a254334cfaf1d29e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0b444c4bc0f3a677acfc2423b19a04ddea8b9dff)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26078: Prevent generating a new transfer from return policy when resolving a...
Nick Clemens [Thu, 30 Jul 2020 16:59:14 +0000 (16:59 +0000)]
Bug 26078: Prevent generating a new transfer from return policy when resolving a transfer

To test:
- Have 2+ branches
- Set your default return policy to Item returns to issuing library
- Find an item with holding branch of Branch A
- Set your library to Branch B
- Check item in
- Koha generates a transfer to Branch A. In doing so, it sets the item holding branch to Branch B
- Set your library to Branch A
- Check item in
- Koha generate a transfer to Branch B. In doing so, it sets the item holding branch to Branch A
- Set you library to Branch A
- Check the item in
 . . . Repeat indefinitely.
 Apply patch
 Repeat
 No more loop

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 47671123206a475f86de9316d8b256e14aa54bc1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8bd9c4b4fd44990c7a806de21e8628e1955a3c56)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26090: Fix "item types" report
Jonathan Druart [Thu, 30 Jul 2020 12:16:09 +0000 (14:16 +0200)]
Bug 26090: Fix "item types" report

This report was broken with SQL strict mode, but also without.

DBD::mysql::st execute failed: 'koha_kohadev.itemtypes.itemtype' isn't
in GROUP BY [for Statement "

and, if no library was selected:

DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in
'field list' [for Statement "

This patch does the minimum to make it usable, but it would need more
love.

Test plan:
To test you will need to try the 4 combinaisons:
 item-level_itypes = item or biblio
 With or without a library selected in the dropdown list

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5bca73080f89bb2f4ca83ce6ceb9fa8e3c4a7d92)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 69f16f7469c7cbbf571560d6f9389ef2dd170aa7)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25786: Holds Queue building may target the wrong item for item level requests...
Kyle M Hall [Wed, 17 Jun 2020 16:53:36 +0000 (12:53 -0400)]
Bug 25786: Holds Queue building may target the wrong item for item level requests that match holds queue priority

Bug 23934 removed the limitation that prevented item level holds from
getting local holds priority. The problem is the code has never checked
if the item level hold matches the given item! This means the wrong item
may be requested to fill an item level hold.

Test Plan:
1) Create 3 items on a record
2) Place a hold for the 2nd item you created
4) Ensure that hold would be picked up by local holds priority
5) Build the holds queue
6) Note the holds queue is asking for the wrong item!
7) Apply this patch
8) Rebuild the holds queue
9) Holds queue should now be asking for the correct item!

Signed-off-by: Kim Peine <kim@williston.lib.vt.us>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b17a04dd077bb118086ad9e4bb58eee81ade2cdd)
(cherry picked from commit c6a1277fdb84df93be2cfa5cb0fa47c950116c20)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25783: Modify calls to AddReserve to match Koha 19.11.x AddReserve prototype
Kyle M Hall [Mon, 22 Jun 2020 13:25:54 +0000 (09:25 -0400)]
Bug 25783: Modify calls to AddReserve to match Koha 19.11.x AddReserve prototype

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25783: Holds Queue treating item-level holds as bib-level
Kyle M Hall [Wed, 17 Jun 2020 15:41:21 +0000 (11:41 -0400)]
Bug 25783: Holds Queue treating item-level holds as bib-level

The holds queue builder does not honor
the new item_level_hold flag. Instead, it only item_level_request if
in the loop dealing with item level holds. This is incorrect. Item level
holds may be trapped in the local holds priority loop as well. It's
trivial to just pass though the correct item/biblio level hold flag.

I do not know how to write a reproducable test plan for these issues.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kim Peine <kim@williston.lib.vt.us>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit db235d33a4caf64387b86ebab7b658bd7759ff21)
(cherry picked from commit aa4eba6d232fd5009312286f5e3575c4ca25e9f3)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25783: Regression tests
Tomas Cohen Arazi [Wed, 17 Jun 2020 20:18:12 +0000 (17:18 -0300)]
Bug 25783: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kim Peine <kim@williston.lib.vt.us>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dd4970860d4299c89ce4a698644c08f990bc1468)
(cherry picked from commit ad6b6db41e92168a3e23d64949817fddb8927aa0)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26361: switch TableSettings to ColumnSettings
Lucas Gass [Thu, 3 Sep 2020 03:57:01 +0000 (03:57 +0000)]
Bug 26361: switch TableSettings to ColumnSettings

Test Plan:
-Be on 20.05.x
-Go to returns.tt
-See the error Uncaught SyntaxError: expected expression, got keyword 'var'.
-Apply patch
-Reload returns.tt, no error

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2b6b7cb265acc77f8925eec9a9f315f249a85348)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25005: (bug 22868 follow-up) Fix suggestions pending on main page
Jonathan Druart [Tue, 7 Apr 2020 11:32:51 +0000 (13:32 +0200)]
Bug 25005: (bug 22868 follow-up) Fix suggestions pending on main page

There is a "Suggestions pending approval" link on the main page that is
displayed if there are new suggestions and the logged in user has the
permission to manage them.

On bug bug 22868 the permission changed from
acquisition.suggestions_manage to suggestions.suggestions_manage

But in the template, one occurrence has not been replaced correctly
(certainly because it was already wrong actually).

Test plan:
Create a suggestion at the OPAC
Create a patron with the suggestions permission
Use this patron to login at the staff interface
=> Without this patch the link does not appear on the main page
=> With this patch applied the link appears

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26270: Fix ThingISBN after a change in behaviour
Jonathan Druart [Fri, 21 Aug 2020 12:00:51 +0000 (14:00 +0200)]
Bug 26270: Fix ThingISBN after a change in behaviour

This is just a guess! One of our tests is failing since today and we
don't modify anything in this area.
My guess is that the service is now returning the normalized version of
the ISBN

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26136: Prevent double submit on checkin-form
Nick Clemens [Tue, 4 Aug 2020 13:13:43 +0000 (13:13 +0000)]
Bug 26136: Prevent double submit on checkin-form

To test:
 1 - Browse to Circulation->Check-in
 2 - Type a barcode into the Check in box
 3 - Hit Enter as many as times as you can
 4 - Check the statistics table:
    SELECT * FROM statistics WHERE itemnumber={itemnumber} AND DATE(datetime)=CURDATE();
 5 - Note you have multiple lines for the same item at the same time
 6 - Apply patch
 7 - Reload the page
 8 - Type the barcode
 9 - Press Enter even more fast and more furiously
10 - Check the statistics table
11 - Only one entry, huzzah!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 44f54aac602ae99d83d954a2f102d77ff93ecfa7)
(cherry picked from commit 9d85636bf0db1350fb4f7e83e6cca2fcc0b1038b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoUpdate release notes for 19.11.09 release v19.11.09
Aleisha Amohia [Tue, 18 Aug 2020 21:16:44 +0000 (09:16 +1200)]
Update release notes for 19.11.09 release

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoMerge branch 'new/security-release-19.11.09' into 19.11.x
Aleisha Amohia [Tue, 18 Aug 2020 19:11:07 +0000 (07:11 +1200)]
Merge branch 'new/security-release-19.11.09' into 19.11.x

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24663: [19.11.x] Handle special cases for recovery password and selfreg
Jonathan Druart [Mon, 17 Feb 2020 15:44:37 +0000 (16:44 +0100)]
Bug 24663: [19.11.x] Handle special cases for recovery password and selfreg

The password recovery and self-registration features need to be
accessible at the OPAC even if not public.

Test plan:
Self register a new account, then ask for a new password with OpacPublic
turned off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24663: [19.11.x] Force authentication in svc/records/preview (?)
Jonathan Druart [Mon, 17 Feb 2020 12:31:38 +0000 (13:31 +0100)]
Bug 24663: [19.11.x] Force authentication in svc/records/preview (?)

Was this wrong?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24663: [19.11.x] Force auth in adveditorshortcuts.pl
Jonathan Druart [Mon, 17 Feb 2020 12:31:17 +0000 (13:31 +0100)]
Bug 24663: [19.11.x] Force auth in adveditorshortcuts.pl

This was wrong!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24663: [19.11.x] Remove authnotrequired if set to 0
Jonathan Druart [Mon, 17 Feb 2020 12:20:48 +0000 (13:20 +0100)]
Bug 24663: [19.11.x] Remove authnotrequired if set to 0

It defaults to 0 in get_template_and_user

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24663: [19.11.x] Test OpacPublic for all OPAC scripts
Jonathan Druart [Mon, 17 Feb 2020 12:16:48 +0000 (13:16 +0100)]
Bug 24663: [19.11.x] Test OpacPublic for all OPAC scripts

Prior to this patchset there were 3 different calls to
get_template_and_user (or checkauth) with the authnotrequired param:
 * authnotrequired => 0
 * authnotrequired => 1
 * authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 )

The first one says that an unauthenticated user can access the page, the
second that the user has to be authenticated, and the last one that it
depends on the OpacPublic syspref.
Actually we must replace the first one with the third one, if the OPAC
is not public, the authentication must be forced.

To do so we are going to remove the "authnotrequired => 0" occurrences,
and check the OpacPublic syspref's value in C4::Auth

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25360: (follow-up) Remove the https FIXME in Auth.pm
Marcel de Rooy [Wed, 5 Aug 2020 13:48:59 +0000 (13:48 +0000)]
Bug 25360: (follow-up) Remove the https FIXME in Auth.pm

The FIXME is no longer valid since we fixed the X-Forwarded headers
for Plack. And since we do not even use using_https anymore in
the templates (see bug 21094).

Test plan:
Run Auth.t
Git grep for using_https

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25360: Use secure flag for CGISESSID cookie when using HTTPS
David Cook [Mon, 4 May 2020 01:12:26 +0000 (11:12 +1000)]
Bug 25360: Use secure flag for CGISESSID cookie when using HTTPS

This patch adds the secure flag to the CGISESSID cookie when using HTTPS.
This prevents the cookie being used again over a normal HTTP
request.

Bug 25360: [Follow-up] Test for "on" or "ON" value for HTTPS env var

This patch tests for HTTPS "on" or "ON" before setting the secure
cookie.

Bug 25360: [Follow-up] Fix typo in C4/InstallAuth.pm

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Amended number of tests in Context.t
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 23634: (QA follow-up) Our PUT is really a PATCH
Tomas Cohen Arazi [Mon, 13 Jul 2020 15:25:13 +0000 (12:25 -0300)]
Bug 23634: (QA follow-up) Our PUT is really a PATCH

This patch makes the controller not expect that there will always be all
the email fields. So it now checks if an email field was passed, and
changed, and renders the error if that stands.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Tests written by Nick highlight a problem
2. Apply this patch
3. Repeat 1
=> SUCCESS: Problems solved
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 23634: (QA follow-up) Adjust tests
Nick Clemens [Mon, 13 Jul 2020 10:33:11 +0000 (10:33 +0000)]
Bug 23634: (QA follow-up) Adjust tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 23634: (QA follow-up) Catch all email cases in API
Martin Renvoize [Fri, 10 Jul 2020 08:38:31 +0000 (09:38 +0100)]
Bug 23634: (QA follow-up) Catch all email cases in API

The API was only catching the primary email change case, but we need to
catch email, emailpro and B_email.

We were also not accounting for any of the emails (on PUT or from the
DB) being undefined.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 23634: (follow-up) Prevent updates on POST
Martin Renvoize [Tue, 19 Nov 2019 16:59:06 +0000 (16:59 +0000)]
Bug 23634: (follow-up) Prevent updates on POST

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 23634: Secure the email on the API
Tomas Cohen Arazi [Tue, 19 Nov 2019 16:16:16 +0000 (13:16 -0300)]
Bug 23634: Secure the email on the API

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 23634: Prevent non-superlibrarians from editing superlibarian emails
Martin Renvoize [Tue, 19 Nov 2019 14:51:50 +0000 (14:51 +0000)]
Bug 23634: Prevent non-superlibrarians from editing superlibarian emails

This patchset prevents a non-superlibrarian user from editing a
superlibrarians email address via memberentry.  This is to prevent a
privilege escalation vulnerability whereby a user could update a
superlibrarians contact details to match their own and then request a
password reset via the OPAC.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 23634: Add tests for is_superlibrarian
Tomas Cohen Arazi [Tue, 19 Nov 2019 16:22:18 +0000 (13:22 -0300)]
Bug 23634: Add tests for is_superlibrarian

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 23634: Add is_superlibrarian method to Koha::Patron
Martin Renvoize [Tue, 19 Nov 2019 14:11:34 +0000 (14:11 +0000)]
Bug 23634: Add is_superlibrarian method to Koha::Patron

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoIncrement version for 19.11.09 release
Aleisha Amohia [Mon, 24 Aug 2020 21:52:50 +0000 (09:52 +1200)]
Increment version for 19.11.09 release

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoFixing po files for 19.11.09
Aleisha Amohia [Mon, 24 Aug 2020 21:39:58 +0000 (09:39 +1200)]
Fixing po files for 19.11.09

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoTranslation updates for Koha 19.11.09
Koha translators [Mon, 24 Aug 2020 21:26:37 +0000 (18:26 -0300)]
Translation updates for Koha 19.11.09

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25641: [19.11.x] Fix XSLT_Handler.t failures on U20
Jonathan Druart [Wed, 19 Aug 2020 12:50:23 +0000 (14:50 +0200)]
Bug 25641: [19.11.x] Fix XSLT_Handler.t failures on U20

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26162: [19.11] Fix DT info label
Jonathan Druart [Wed, 19 Aug 2020 05:25:06 +0000 (07:25 +0200)]
Bug 26162: [19.11] Fix DT info label

There is an inconsistency in 19.11:
% grep Showing koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc koha-tmpl/intranet-tmpl/prog/js/datatables.js
koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc:    var MSG_DT_INFO = _("Showing _START_ to _END_ of _TOTAL_");
koha-tmpl/intranet-tmpl/prog/js/datatables.js:        "sInfo"             : window.MSG_DT_INFO || "Showing _START_ to _END_ of _TOTAL_ entries",

The "entries" is not always displayed.

datatables.inc has been removed from 20.05 by
Bug 24662: Remove global variables MSG_* from datatables.inc

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26162: Don't fall into an infinite loop
Jonathan Druart [Wed, 19 Aug 2020 05:19:09 +0000 (07:19 +0200)]
Bug 26162: Don't fall into an infinite loop

If something went wrong we do want to stop the script!

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26000: Make exception_holidays cache with branch in key
Nick Clemens [Fri, 17 Jul 2020 11:31:29 +0000 (11:31 +0000)]
Bug 26000: Make exception_holidays cache with branch in key

In light of 25723 offering a simpler solution here.
This would just let us avoid backporting larger changes, but this can be
marked as a duplicate if 25723 is preferred to this change

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26000: Unit test
Nick Clemens [Thu, 16 Jul 2020 19:30:28 +0000 (19:30 +0000)]
Bug 26000: Unit test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26012: Correctly format "paid for" info on the item details view
Jonathan Druart [Wed, 29 Jul 2020 14:49:14 +0000 (16:49 +0200)]
Bug 26012: Correctly format "paid for" info on the item details view

The string is built controller side, which does not let the template
format the info nicely.
We want to display patron's info using patron-title.inc and the date
with the KohaDates plugin

Test plan:
- Make sure there is a replacement cost in the item
- check it out
- Mark it lost
- Pay the lost item fee
- Go to the detail page and look on the items tab for the item
- It will show an entry with "Paid for?" label
The patron's info and date must be correctly formatted

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ed4fc5889467bde858cfd4ac573cd40a5b4279c5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f16934384efe502a6247b1c4cb981d2684e6dee3)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26165: Fix duplication of large saved reports
Jonathan Druart [Fri, 7 Aug 2020 10:44:28 +0000 (12:44 +0200)]
Bug 26165: Fix duplication of large saved reports

If the combined character length of a saved report's
title, notes and SQL is too long then pressing the
'duplicate' button will lead to an error:

"Request-URI Too Long
The requested URL's length exceeds the capacity limit
for this server."

Test plan:
1. Create a simple SQL report and add a lot of text
   into the notes field (the combined URL lenth must be
   >8225 characters)
2. Save the report
3. Press the duplicate the report from the saved reports 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>
(cherry picked from commit 81f06881a45d7647481aa8a21354a772f3daff88)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 50cbaa3262b11f9b4541464371477200ed84ca8a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 23542: Fix SRU import encoding
Fridolin Somers [Mon, 29 Jun 2020 13:07:10 +0000 (15:07 +0200)]
Bug 23542: Fix SRU import encoding

When importing records from a SRU server, the diacritics have bad encoding.
I reproduce with BNF server so it may be a UNIMARC issue.

Tests show that difference between Z39.50 server and SRU is that leader contains 'a' at postion 9.
Looking at MARC::Record->encoding() shows that encoding depends on leader even for UNIMARC.
So this patch adds a call to MARC::Record->encoding('UTF-8') in case of a SRU server in C4::Breeding.

Same use exists in Koha::MetadataRecord::Authority::get_from_breeding().

In case of import via Z3950, MarcToUTF8Record() is called,
 which calls SetMarcUnicodeFlag(),
 which calls MARC::Record->encoding('UTF-8')

Test plan :
1) Use a UNIMARC database
2) Configure a connexion to a UNIMARC SRU, for example BNF,
   see https://doc.biblibre.com/koha/autour_de_koha/serveurs_z3950_sru#serveur_de_la_bnf
3) Go to cataloguing module
4) Click on 'New from Z39.50/SRU'
5) Choose only the SRU target
6) Search for ISBN 2266072889
7) Confirm you see good encoding : diacritic on 'a' of title 'Strate-a-gemmes'
8) Click on 'Marc preview'
9) Confirm you see good encoding
10) Click import
11) Confirm you see good encoding
12) Check also Authorities import via SRU
13) Check also SRU imports on a MARC21 database

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Removed change to new_from_xml call. We should respect syntax.
But the added MARC::Record encoding does the tric! Which is implicit
for Z3950 targets where MarcToUTF8Record does the same.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 19d9ba176dea6b7816a33b014a5f9e309af53dc0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 79855e9f5bdbcb3bdaedd33bed574b35eee5501d)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25882: Remove phr indicator from limits when processing
Nick Clemens [Fri, 26 Jun 2020 13:19:47 +0000 (13:19 +0000)]
Bug 25882: Remove phr indicator from limits when processing

We assume all limits from advanced search to be a phrase and quote them
when doing this we should remove the phrase marker to avoid doulbe quoting

To test:
 1 - Have koha using ES
 2 - Go to advanced search
 3 - Limit by a single itemtype that exists
 4 - Get some results
 5 - Limit by a different itemtype that exists
 6 - Get some results
 7 - Limit by both itemtypes
 8 - Get only the results for the second itemtype
 9 - Enable DumpTemplateVarsIntranet and DumpSearchQueryTemplate
10 - Repeat search
11 - View page source and find 'search_query'
12 - See limit looks like itype:("("BK")" OR "("CR")")
13 - Apply patches
14 - Restart all the things
15 - Repeat search for both itemtypes
16 - Note results now include both types

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a2b2426de842ac86048cbf71e3760b6483fc0b3c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 455acf686d7e74aa5582bc700e856935e852573a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25882: Unit test
Nick Clemens [Fri, 26 Jun 2020 13:19:32 +0000 (13:19 +0000)]
Bug 25882: Unit test

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1a2d7f1eacc0722ea0723577823ee6a477a46b0a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dbc7f861d4695a8538602b01d0e9402dff01ff02)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25336: Show checkouts/fines to guarantor is in the wrong section of the patron...
David Roberts [Sun, 3 May 2020 23:48:09 +0000 (23:48 +0000)]
Bug 25336: Show checkouts/fines to guarantor is in the wrong section of the patron file

This patch moves the "Show checkouts to guarantor" and "Show fines to
guarantor" data to display under the Contact information block

To test:

1) Enable the AllowStaffToSetCheckoutsVisibilityForGuarantor and AllowStaffToSetFinesVisibilityForGuarantor system preferences to Allow
2) View a patron record.
3) The "Show checkouts to guarantor" and "Show fines to guarantor" field
will be on the right hand side of the screen under the Library use
block.
4) Apply patch
5) Check that this data has now moved to the Contact information block
on the left hand side of the patron record.

Works for me!

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3abc4fb8584e0df2b71dd9d38f033e34b205e829)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2478ba03f064b70e03da9c6ca3667c8b5fd37403)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25853: Fix file permissions for update_patrons_category script
Katrin Fischer [Sat, 18 Jul 2020 01:53:34 +0000 (01:53 +0000)]
Bug 25853: Fix file permissions for update_patrons_category script

The permissions for this were -rw-r--r-- and need to be -rwxr-xr-x.

To test:
- Verify the file permissions before and after applying the patch.

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e7661a37e657141b994d74398dd8e1b96d1da117)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 74354d414467e4cba61a1114bc777ad37174ae8b)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26009: (QA follow-up) It does not harm to test more
Josef Moravec [Thu, 6 Aug 2020 19:15:44 +0000 (19:15 +0000)]
Bug 26009: (QA follow-up) It does not harm to test more

Test plan:
prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t
--> should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d08ce1d9406feca7bc7e5ab0be58efea94c7a2e5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 877cc214f0be2aa7df5a066f34ef543db8e72ab2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26009: Add facet size to home/holdingbranch
Nick Clemens [Fri, 17 Jul 2020 16:23:42 +0000 (16:23 +0000)]
Bug 26009: Add facet size to home/holdingbranch

To test:
0 - Set DisplayLibraryFacets to 'both' and FacetMaxCount to 20
1 - Have more than 10 branches
2 - Have items in each of those branches
3 - Enable ES, set system preference SearchEngine to Elasticsearch
4 - Search for '*'
5 - Expand homebranch/holdingbranch facets
6 - Note you only get 10
7 - Apply patch
8 - Repeat search
9 - Now you get all your facets

Signed-off-by: Michael Springer <mspringer@mylakelibrary.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4dd1672c1b2f15e0b6be6071b6915c927c3a2ecc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 18215fbc575c62d4f6410743fe82d199abd0c69f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25683: (follow-up) Use COALESCE instead of IFNULL
Nick Clemens [Tue, 4 Aug 2020 18:28:42 +0000 (18:28 +0000)]
Bug 25683: (follow-up) Use COALESCE instead of IFNULL

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e1509855d3aa2729127ac352525be62505d752f9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6bea771b8048282c61b260699e1b62d8944a7f90)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25683: Fix grouping of results
Nick Clemens [Wed, 10 Jun 2020 12:26:06 +0000 (12:26 +0000)]
Bug 25683: Fix grouping of results

DBIX doesn't seem to work as I expected - if trying to group by we can only
get the columns we grouped by, otherwise the queries are much more complicated
and come out wrong

This patch removes the 'amountoutstanding' from the query. Note that we do return patron
object, however, to access all the columns we must discard_changes (or refetch)

Also fixes a typo 'verbosse'

To test:
1 - charge a $1 fine to a patron
2 - pay off the fine
3 - perl misc/cronjobs/update_patrons_category.pl -f J -t J -fu=5 -v
4 - Note the patron is returned twice
5 - export DBIC_TRACE=1
6 - repeat 3 - view the SQL query and see how odd it is
7 - Apply this patch
8 - repeat 3 - simpler query
9 - patron returned only once

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c7ae33f60c18d2874370e7c2d2f3042fe1331e0e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 41f73194c42d306f3aa9893a01d01938489546bd)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25683: Patron with no accountlines should have 0 outstanding (not NULL)
Nick Clemens [Tue, 9 Jun 2020 10:52:26 +0000 (10:52 +0000)]
Bug 25683: Patron with no accountlines should have 0 outstanding (not NULL)

Test plan:
- Have a patron with nothing in accountlines
- run update_patron_categories to find patrons with fines under $5 (-fu=5)
  - Your patron is not found
  - Give your patron a manual charge of $1
  - rerun the cron, your patron is found
  - pay off your patron's fine, putting their balance at $0
  - rerun the cron, your patron is found

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 09146f4a995d50206c7f1c2d80e797b3cb1175c5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6ae42c8c3c7e402db20f424d16950a6162951ac1)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26098: Fix JS error on the fund list view when no fund displayed
Jonathan Druart [Thu, 30 Jul 2020 08:51:26 +0000 (10:51 +0200)]
Bug 26098: Fix JS error on the fund list view when no fund displayed

TypeError: this.data(...) is undefined
in jquery.treetable.js

Test plan:
Go to the fund list view
Select a filter that will return no result
=> With this patch applied there is no JS error in the console

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b6cb3c2ba54c0e10c27f37a0d2dec4f2875f2ddd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 052d5d5568190396d096df528bdc5aed7558e38c)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25893: Use wildcards when searching logs
Nick Clemens [Mon, 29 Jun 2020 18:15:39 +0000 (18:15 +0000)]
Bug 25893: Use wildcards when searching logs

The restores the wildcards that were used in the past

To test:
 0 - Ensure cataloguing logs and issues logs are enabled
 1 - Edit an item
 2 - Circulate that same item
 3 - Browse to tools-> log viewer
 4 - Put the itemnumber in the 'info' box
 5 - You see only the circulation
 6 - Put the itemnumber in the object box
 7 - You see only the cataloging modification
 8 - Apply patch
 9 - Put itemnumber in info box
10 - you see both actions
11 - Put the itemnumber in the object box
12 - You see only the catalogiong modification

Signed-off-by: Jason Robb <jrobb@sekls.org>
Bug 25893: Don't wildcard object

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 25893: (follow-up) Undo unrelated changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bb0abf99c451113e8649c494d3a8b99f3916f942)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 30229e383cd3c2f92894449598a1433f52072c24)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26162: Wait for the table to be refreshed
Jonathan Druart [Mon, 10 Aug 2020 09:59:58 +0000 (11:59 +0200)]
Bug 26162: Wait for the table to be refreshed

The previous patch did not work as expected. We still got a
StaleElementReference exception.
But this time on
10:43:47 selenium_1   | Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//*[@id=\"branchname\"]"}
Because we found the one that existed on the page, not the one sent back
in AJAX.

The idea of this patch is to search for the "Showing 1 to X of Y entries" info and wait for X == Y

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 70ff3bafa05a30944962747953c70bb8dc3c1ab8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ce8a819b5fb77a8df59f131b4af96e24106bd32e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26162: Make Selenium click action more robust
Jonathan Druart [Thu, 6 Aug 2020 13:08:48 +0000 (15:08 +0200)]
Bug 26162: Make Selenium click action more robust

See
https://stackoverflow.com/questions/12967541/how-to-avoid-staleelementreferenceexception-in-selenium
https://www.selenium.dev/exceptions/
https://developer.mozilla.org/en-US/docs/Web/WebDriver/Errors/StaleElementReference

This patch will fix the following failure we get under D11:
18:47:07 selenium_1   | 09:47:07.478 WARN - Exception: Element not found in the cache - perhaps the page has changed since it was looked up
18:47:07 selenium_1   | For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html
18:47:07 selenium_1   | Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
18:47:07 selenium_1   | System info: host: '78b9a07f51f2', ip: '192.168.16.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.0-9-amd64', java.version: '1.8.0_91'
18:47:07 selenium_1   | Driver info: driver.version: unknown
18:47:07 koha_1       |
18:47:07 koha_1       | STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
18:47:07 koha_1       |  /usr/local/share/perl/5.26.1/Selenium/Remote/Driver.pm:353 in Try::Tiny::try
18:47:07 koha_1       |  (eval 1571):1 in Selenium::Remote::Driver::__ANON__
18:47:07 koha_1       |  (eval 1573):2 in Selenium::Remote::Driver::__ANON__
18:47:07 koha_1       |  (eval 1546):17 in Selenium::Remote::Driver::_execute_command
18:47:07 koha_1       |  /usr/local/share/perl/5.26.1/Selenium/Remote/WebElement.pm:63 in Selenium::Remote::WebElement::_execute_command
18:47:07 koha_1       |  /kohadevbox/koha/t/lib/Selenium.pm:184 in Selenium::Remote::WebElement::click
18:47:07 koha_1       |  /kohadevbox/koha/t/lib/Selenium.pm:172 in t::lib::Selenium::click_when_visible
18:47:07 koha_1       |  t/db_dependent/selenium/administration_tasks.t:131 in t::lib::Selenium::click

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a96433446e87c03ac6e253a54eb067ac93a33575)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d8ead7bac5642ba1d98691d1fd48c266403451df)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26143: Make the API handle per_page=-1
Tomas Cohen Arazi [Wed, 5 Aug 2020 15:09:40 +0000 (12:09 -0300)]
Bug 26143: Make the API handle per_page=-1

This patch introduces handling for per_page=-1 and actually adds a
missing feature to the API: being able to request all resources on a
route.

To test this:
1. Visit the libraries admin page
2. On the table, choose to display 'All' rows
=> FAIL: it doesn't refresh, the browser console displays a 500 error
code and so the logs
3. Apply the tests patches
4. Run:
   $ kshell
  k$ prove t/Koha/REST/Plugin/Pagination.t \
           t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail loudly
5. Apply this patch
6. Restart plack
7. Repeat 2
=> SUCCESS: choosing to display all, works
8. Repeat 4
=> SUCCESS: Tests pass now!
9. 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 e4cae99f7ec76e40a57e4066e088b9b01caed744)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 72bcf69f425a92ce4adfb4919a412d7797a82df2)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26143: Regression tests
Tomas Cohen Arazi [Wed, 5 Aug 2020 15:04:47 +0000 (12:04 -0300)]
Bug 26143: Regression tests

This patch introduces tests for the per_page=-1 handling use case. From
now on per_page=-1 means 'all resources'.

On writing this I noticed that we always paginate results no matter
what, but there was a weird condition under which on pagination headers
were sent back to the API consumer. This is highlighted in the precedent
patch, which is not the -1 situation this one tries to tackle.

Both pagination and searching are broken with per_page=-1, which is a
standard, and we actually didn't explicitly set a way to request all
resources.

To verify this:
1. Apply the previous tests patch and this one
2. Run:
   $ kshell
  k$ prove t/Koha/REST/Plugin/Pagination.t \
           t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Things are damn broken

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d20bc39d759bc9321b1b7accb952f90351a14caa)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9a4910812f03fade73d27db8ce975dc0a15fe9e7)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26143: The API is always paginated
Tomas Cohen Arazi [Wed, 5 Aug 2020 14:55:28 +0000 (11:55 -0300)]
Bug 26143: The API is always paginated

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 61e8dc8c7d489329c27aca3b6b10137c289161cb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd3c09e8486eb79f709dd5ea484f1c09c1805289)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26043: Fix random failure from Holds.t
Jonathan Druart [Wed, 22 Jul 2020 12:11:03 +0000 (14:11 +0200)]
Bug 26043: Fix random failure from Holds.t

 #   Failed test 'Test ModReserveMinusPriority()'
 #   at t/db_dependent/Holds.t line 202.
 #          got: undef
 #     expected: '1605'
 # Looks like you failed 1 test of 66.

It is coming from Koha::Patron->holds that is ordering by reservedate,
so "sometimes" they are ordered in reverse (at least it's my
understanding of the problem).

Test plan:
Run the test file several times (from 20 to 60x), it must never fail
with this patch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 80a611797bf67b263b6b84a6e931833ea336b6a5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c98a283d118bb936dc44db1b73cfeb8e45f89a22)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25762: Typo in linkitem.tt
Owen Leonard [Wed, 29 Jul 2020 12:21:29 +0000 (12:21 +0000)]
Bug 25762: Typo in linkitem.tt

This patch corrects the same typo in two different templates:

&rsquo; -> &rsaquo;

If you want to test beyond examining the patch, apply the patch
and go to Tools -> Rotating collections.

- Add an item to a rotating collection.
- In the browser's title bar (or the tab title if the title bar isn't
  shown) the separator between the rotating collection name and "Add or
  remove items" should be ">" instead of "`"
- Enable the EasyAnalyticalRecords system preference.
- View the detail page for a bibliographic record.
- From the "Edit" menu, choose "Link to host record"
- Check the title bar as you did previously.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 19f9bc0528ec0f5cdf000b5120138652b3ece57c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a8a7d8667edbe6d8b9ab19c33a6cd4ce1a8ca4f6)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25873: Ignore malformed data for Elasticsearch integer fields
Julian Maurice [Thu, 25 Jun 2020 07:25:41 +0000 (11:25 +0400)]
Bug 25873: Ignore malformed data for Elasticsearch integer fields

If we try to put malformed data into an integer field, Elasticsearch
rejects the whole document.
Setting 'ignore_malformed' to true allows to ignore malformed data and
process the other fields of the document normally

https://www.elastic.co/guide/en/elasticsearch/reference/7.8/ignore-malformed.html

Test plan:
* Without the patch
  1. In search engine configuration, change the type of a text field to
  'Number' (for instance 'title')
  2. misc/search_tools/rebuild_elasticsearch.pl -d -b
  3. See that the index is empty (unless you have titles consisting only
  of digits)
* With the patch
  1. misc/search_tools/rebuild_elasticsearch.pl -d -b
  2. Now records are correctly indexed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cb5acdc6702cef4668921ccf2537797358981fff)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 056eb8c74e0b01386a0a1127ed5fff5ef59390b1)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26111: Add "Serials" (SER) to the reports dictionnary
Jonathan Druart [Fri, 31 Jul 2020 09:53:53 +0000 (11:53 +0200)]
Bug 26111: Add "Serials" (SER) to the reports dictionnary

It's missing in the template

Test plan:
Go go Home › Reports › Guided reports wizard › Dictionary
At step 2, notice that with this patch you have "Serials" in the
dropdown list (instead of an empty entry)

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b0eee4d2e1359050cee3dd23a121e75195b0ce11)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3c6155b669e9891307e417cf7b73cd63b57fb624)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25887: Keep library filter on the fund list view
Jonathan Druart [Thu, 30 Jul 2020 08:57:53 +0000 (10:57 +0200)]
Bug 25887: Keep library filter on the fund list view

The problem:
When filtering funds by library, the pull down for libraries resets to "empty" when the page is reloaded,
although the filter criteria is visible in the URL.

Test plan:
Create a fund for library A
Create a fund for library B
Go to the fund list view
=> All funds are listed
Select library A in the library filter, click "Go"
=> Funds for library A are listed
=> Library filter has "library A" selected
Edit fund for library B
=> The edit form has "library B" selected

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 09ed4c0dd7277931c1e631c5b1329463fc9751e5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd86d4fe7f2953057f8b608cf8c3893585ab1dde)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25852: Add tests
Jonathan Druart [Thu, 30 Jul 2020 09:59:44 +0000 (11:59 +0200)]
Bug 25852: Add tests

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.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>
(cherry picked from commit e330e4ec222f8ac3a04339a020509e30aa0bf3ab)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 57e3f2ed7b69e815743d817ac094600d3a40bec8)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25852: Improve C4::Creators::Lib reliability under plack
Jonathan Druart [Thu, 30 Jul 2020 10:00:03 +0000 (12:00 +0200)]
Bug 25852: Improve C4::Creators::Lib reliability under plack

This is certainly a major issue that leads to many side-effects.
Under plack, the structure of the default values are not handled
correctly.
Package variables are used to store stuff like the "layout type". They
are complex structures (arrays of hashes) and returned without being
copied.
When the caller (the controller script) retrieve them then modify the
returned structures, it actually modifies the package's variables.

One of the issue is:
Create a new layout
The script retrieve a structure with all "selected" flags are set to 0
It select the first one as default (BAR as selected => 1)
The user creates the new layout and will selected BIBBAR (for instance)
If you then edit this new layout, the script will retrieve the
"label_types" and set "selected" for BIBBAR. However BAR is still
selected!
The UI receives 2 selected and display the first selected one that has
the selected option.

Test plan:
1. Create a layout type for Barcode/Biblio
2. Choose fields to print and size of font
3. Save
4. Edit existing Layout
=> Withtout this patch "Barcode" is the preselected option
=> With this patch applied, the correct "Barcode/Biblio" option is
selected

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0a9d3f17d9e44b5326a42d14420d30243031629d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e2c9fdb5bd702e358aa5b7f86e1ddf80525a4128)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25599: Fix default value placeholders for UseACQFrameworkForBiblioRecords
Jonathan Druart [Tue, 26 May 2020 08:50:31 +0000 (10:50 +0200)]
Bug 25599: Fix default value placeholders for UseACQFrameworkForBiblioRecords

The feature was there but a condition disabled it.

Test plan:
- modify the default value for 008@ or another subfield in the ACQ framework using one or more of the placeholders above
- activate UseACQFrameworkForBiblioRecords
- create a basket
- create an order from a new record
- verify the values have been replaced

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b16e463173e8125396eaef3159d08df5d0d2cfb6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 34b5cd5267243867042325550ba50bd7a0ee46aa)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26070: DBRev 19.11.08.003
Aleisha Amohia [Fri, 7 Aug 2020 02:22:05 +0000 (14:22 +1200)]
Bug 26070: DBRev 19.11.08.003

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 26070: Remove GoogleIndicTransliteration system preference
Owen Leonard [Mon, 27 Jul 2020 19:16:07 +0000 (19:16 +0000)]
Bug 26070: Remove GoogleIndicTransliteration system preference

The Google Transliterate API was deprecated on May 26, 2011. This patch
removes the feature and associated system preference.

To test, apply the patch and run the database update process.

 - Go to Administration -> System preferences and search for
   'GoogleIndicTransliteration.' There should be no results.
 - Search the Koha codebase for references to
   'GoogleIndicTransliteration.' There should be no current references..

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9b9e8fd32852acceb10cfc54d4a5a3acc0f6e232)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cde498344dcb2739bd703b53bdbcdf728d5b5f0a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25982: OPAC shelves RSS link output is xml
Didier Gautheron [Sun, 12 Jul 2020 12:09:15 +0000 (14:09 +0200)]
Bug 25982: OPAC shelves RSS link output is xml

Output rss feed as text/xml

Test plan:
1) have books entered
2) log in create a list
3) add books to list
4) display list in OPAC
5) click the RSS link button.
   -- output is displayed as html text
6) apply patch
7) repeat steps 4&5
   -- output is displayed as xml tree

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3d0da68d5ada37b40099fbc11b63202ccf7a48b2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 549cc995b2796b9e413c2860fe2d09fef5d97778)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js
Owen Leonard [Thu, 18 Jun 2020 13:10:35 +0000 (13:10 +0000)]
Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js

This patch adds the necessary JavaScript includes to the OPAC to
enable translation of strings in JavaScript. It also updates the
translation of cart-related strings by removing the strings from
opac-bottom.inc and putting them in basket.js where they are used.

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

 - Update a translation:

   > cd misc/translator
   > perl translate update fr-FR

 - Open the corresponding .po file for the strings pulled from
   JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
 - Locate strings pulled from bootstrap/js/basket.js for
   translation, e.g.:

   #: koha-tmpl/opac-tmpl/bootstrap/js/basket.js:89
   msgid "Your cart is currently empty"
   msgstr ""

 - Edit the "msgstr" string however you want (it's just for testing)
 - Install the updated translation:

   > perl translate install fr-FR

In the OPAC, switch to the language you're testing. Confirm that your
translated string appears. In the above example, by clicking the "Cart"
icon in the header when there are no items in the cart.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c8276bf0e64a2dc90af4aab0d6e78893edc12b1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 46710cfc0018d7107a68a1e6da847262bfb2470c)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25499: Fix fund code column when closing a budget
Katrin Fischer [Fri, 22 May 2020 23:12:22 +0000 (01:12 +0200)]
Bug 25499: Fix fund code column when closing a budget

When closing a budget the fund code column in the table is
always empty. This is due to a TT variable not being correct.

To test:
- Create a budget and fund
- Order anything, leave basket open or not, but don't receive
- Duplicate your existing budget
- Close the first budget in order to move the pending orders
- Verify the fund code is not showing in the table
- Apply patch and reload the patch
- Verify fund codes are now showing correctly

Bonus: Changes the column heading Fund id to Fund ID.

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ab015f04dcd4956ca1ccd610d085e8b0c17ca733)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6ad9baace2099650a14c0ee478130ca3c01c673a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 25920: Add liblocale-codes-perl package to fix ubuntu-stable (focal)
Mason James [Fri, 3 Jul 2020 11:42:02 +0000 (23:42 +1200)]
Bug 25920: Add liblocale-codes-perl package to fix ubuntu-stable (focal)

to test on ubuntu-20...

1/ install koha-common pkg
 $ sudo apt install koha-common

2/ confirm liblocale-codes-perl pkg is not installed :(
 $ apt-cache policy  liblocale-codes-perl | grep Installed
 Installed: (none)

3/ apply patch

4/ build and install new koha-common pkg

5/ confirm liblocale-codes-perl pkg is now installed :)
 $ apt-cache policy  liblocale-codes-perl | grep Installed
 Installed: 3.62-1

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 58be086a18e39068fd12dfeef677f982ae735a73)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 43aa7f36bf40692e2f71ebea6b122079a73522bd)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24379: Fix failing tests
Jonathan Druart [Mon, 20 Jul 2020 13:16:29 +0000 (15:16 +0200)]
Bug 24379: Fix failing tests

kohadev-koha@kohadevbox:/kohadevbox/koha$ prove t/db_dependent/Koha/Patrons/Import.t
t/db_dependent/Koha/Patrons/Import.t .. 2/159
 #   Failed test 'No warning raised by import_patrons'
 #   at t/db_dependent/Koha/Patrons/Import.t line 171.
 # found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
 # found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
 # didn't expect to find a warning
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
t/db_dependent/Koha/Patrons/Import.t .. 152/159 # Looks like you failed 1 test of 159.
t/db_dependent/Koha/Patrons/Import.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/159 subtests

Test Summary Report
-------------------
t/db_dependent/Koha/Patrons/Import.t (Wstat: 256 Tests: 159 Failed: 1)
  Failed test:  39
  Non-zero exit status: 1
Files=1, Tests=159,  3 wallclock secs ( 0.04 usr  0.01 sys +  2.11 cusr  0.24 csys =  2.40 CPU)
Result: FAIL

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 545e03c173c789241eb21773a939b4ab7dcc6da4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c0e665aeccbc028f4289e7b1c144f844c05b5198)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24379: DBIC
Aleisha Amohia [Wed, 5 Aug 2020 00:08:00 +0000 (12:08 +1200)]
Bug 24379: DBIC

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24379: DBRev 19.11.08.002
Aleisha Amohia [Wed, 5 Aug 2020 00:07:40 +0000 (12:07 +1200)]
Bug 24379: DBRev 19.11.08.002

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24379: Make login_attempts not nullable
Nick Clemens [Wed, 8 Jan 2020 20:59:38 +0000 (20:59 +0000)]
Bug 24379: Make login_attempts not nullable

While the column defaults to 0 in Koha::Object->store we set to NULL if NULLABLE

When trying to reset a patrons password we check that the account is not administratively locked:
login_attempts != -1

This query does not return rows where login_attempts IS NULL. It will return accounts where login_attempts = 0

Let's default to 0 like we intend

To test:
1 - Create a new patron
2 - Note their login_attempts is NULL
    SELECT login_attempts FROM borrowers ORDER BY borrowernumber DESC LIMIT 1
3 - Enable  OpacResetPassword
4 - Attempt to reset password before logging in, you cannot
5 - Apply patch, updatedatabase, restart_all, update schema
6 - Create another patron
7 - Their login attempts should be 0
8 - Attempt to reset password, it works!

Bug 24379: Fix the test

First we create a patron using TestBuilder to get a hashref of valid
info. Then we delete it and create a new patron using Koha::Patron->new
Once stored, we should call discard_changes to make the calculated
values available in the currenct object.

Bug 24379: Don't drop default of 0 for login attempts

When moving the column we drop the default, this means that DBs upgraded form earlier versions
get the wrong values set

To test:
1 - Checkout 16.11.x
2 - Reset all
3 - Checkout master
4 - updatedatabase
5 - SHOW CREATE TABLE borrowers;
6 - Note the column login_attempts defaults to NULL
7 - Apply patch(es)
8 - Repeat
9 - Now it defaults ot 0 (and has NOT NULL if applied all)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7bb31cffae27dc398a7b4a4decf3623ec65478ac)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6d675b61ad2dfd8fa6cfd0f58a9ebb8d534bd358)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 20882: DBIC
Aleisha Amohia [Wed, 5 Aug 2020 00:00:37 +0000 (12:00 +1200)]
Bug 20882: DBIC

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
4 years agoBug 24640: DBIC
Aleisha Amohia [Tue, 4 Aug 2020 23:55:20 +0000 (11:55 +1200)]
Bug 24640: DBIC

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>