]> git.koha-community.org Git - koha.git/log
koha.git
5 years agoBug 22896: Missing inputs in transfer modal
Nick Clemens [Mon, 13 May 2019 15:34:47 +0000 (15:34 +0000)]
Bug 22896: Missing inputs in transfer modal

This patch restores hidden inputs to save overridden checkin date and other data

Currently we lose the list of checkouts and several settings when items with transfers are checked in

To test:
1 - Find an item from another branch
2 - Set a checkin date and click the box for the date to be remembered
3 - Check in the item
4 - Click ok or print, note the checkin date is lost
5 - Apply patch
6 - Repeat
7 - Checkin date remains

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit edb9f498f7148a0d6b2c232a8c22412e113c422b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22965: fixes typo on classification sources description on admin homepage
Henry Bolshaw [Wed, 22 May 2019 15:02:40 +0000 (15:02 +0000)]
Bug 22965: fixes typo on classification sources description on admin homepage

Removed comma from description.

Test plan:
1. Go to Admin homepage
2. Check Classification Sources description
3. Verify that comma after i.e. has gone removed

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b67462d471a54bf342295cbc5e46373d065bab7e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 15221: (QA follow-up) Fix Message.t
Marcel de Rooy [Mon, 27 May 2019 09:39:34 +0000 (09:39 +0000)]
Bug 15221: (QA follow-up) Fix Message.t

As Jonathan reported on comment11, SIP/Message.t fails now.

This is a trivial fix for that. In the first case we should just no longer
expect the alert flag. In the second case it makes more sense to toggle
the value of the checked_in_ok setting.

Test plan:
Run t/db_dependent/SIP/Message.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 533ff7ab29a1ca6d35d0e306dd97273838ad3064)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 15221: SIP server always sets the alert flag when item not returned
David Cook [Tue, 21 May 2019 01:12:44 +0000 (11:12 +1000)]
Bug 15221: SIP server always sets the alert flag when item not returned

The checked in response from the ACS always has the alert bit set to
true, even when using the checked_in_ok option.

This patch sets the alert bit to 0 when checked_in_ok is used and
the item is checked in without a preceding checkout.

To test:

0) Create patron in web interface with a cardnumber and userid of "staff" with a password
that matches the account in SIPconfig.xml. Also set their branch to CPL
(also matching SIPconfig.xml).
1) Create an item with a barcode of 'test'
2) Choose a patron to check out to and record their borrowernumber

In one terminal:
3) cd to your git directory (e.g. /home/koha/koha)
4) perl ./C4/SIP/SIPServer.pm ~/koha-dev/etc/SIPconfig.xml

In another terminal:
5) cd to your git directory (e.g. /home/koha/koha)
6) perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber>
NOTE: You need to replace <borrowernumber> with the borrowernumber from Step 2, and <password> with the password from Step 0.

Before patch:

koha@9ec653ab82ce:~/koha$ perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber>
Attempting socket connection to localhost:6001...connected!
SEND: 9300CNstaff|COStaff1|CPCPL|
READ: 941

Trying 'checkin'
SEND: 09N20190521    00310320190521    003103APCPL|AOCPL|ABtest|AC<password>|BIN|
READ: 101YNY20190521    003106AOCPL|ABtest|AQCPL|AJTest|

After patch:
koha@9ec653ab82ce:~/koha$ perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber>
Attempting socket connection to localhost:6001...connected!
SEND: 9300CNstaff|CO<password>|CPCPL|
READ: 941

Trying 'checkin'
SEND: 09N20190521    01000020190521    010000APCPL|AOCPL|ABtest|AC<password>|BIN|
READ: 101YNN20190521    010004AOCPL|ABtest|AQCPL|AJTest|

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d963a3854c962bda3361213f2ad8e7626311d20b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21831: Allow move all fields even if destination field is different
Jonathan Druart [Fri, 7 Dec 2018 17:43:18 +0000 (14:43 -0300)]
Bug 21831: Allow move all fields even if destination field is different

Tests exist in t/SimpleMARC.t to prove that it works and it is possible.
I do not remember what I wrote this limitation.

Signed-off-by: Jon Knight <j.p.knight@lboro.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 189bde4a1d043a25a0eddcc07401b7946653c3b1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22917: Fix typo in another test file
Jonathan Druart [Thu, 16 May 2019 19:07:25 +0000 (14:07 -0500)]
Bug 22917: Fix typo in another test file

It looks safe to do it here and now.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6ae2edb033ed7ebc2683026f42cf9400babd604b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22917: Fix a typo in an output_pref call
Martin Renvoize [Thu, 16 May 2019 15:55:16 +0000 (16:55 +0100)]
Bug 22917: Fix a typo in an output_pref call

Due to a type in a call to output_pref (datenonly vs dateonly) we were
comparing logactions within a minutes accuracy. Counting the logs for
the day would be sufficient for the test ;)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 04d990c71d34d0c44999cfdf80e8379959d14de8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22917: Prevent Circulation.t if tests ran too slowly
Jonathan Druart [Thu, 16 May 2019 00:46:48 +0000 (19:46 -0500)]
Bug 22917: Prevent Circulation.t if tests ran too slowly

After bug 21213 we wanted to know why Circulation.t was failing randomly on a given test.
Since it is pushed, it failed (at least) twice, with the same error:

    #   Failed test 'AddReturn must have debarred the patron'
    #   at t/db_dependent/Circulation.t line 3112.
    #          got: ''
    #     expected: '1'
    # AddReturn returned message $VAR1 = {
    #           'WasReturned' => 1
    #         };

    #   Failed test 'Test at line 1918'
    #   at t/db_dependent/Circulation.t line 3116.
    #          got: '0'
    #     expected: '1'

    #   Failed test 'Test at line 1918'
    #   at t/db_dependent/Circulation.t line 3119.
    #          got: undef
    #     expected: '2019-05-30'
    # Looks like you failed 3 tests of 21.

The test at line 3113 expects the flags 'WasReturned' and 'Debarred' to be set,
but only WasReturned is.
Which means the patron has not been debarred. It is not because the checkout has
not been detected as overdue.

If you apply only the first patch you will see that the tests are failing with
the exact same failures.
Indeed, if due_date is not passed to test_debarment_on_checkout, it is set to now (dt_from_string).
However, if the call and the test of the parameters inside the subroutine takes
more than 1 second,
then due_date will be after what we really expect. To reproduce that, we add
1 minute to due_date and we observe the tests failing.

The trick here (and we should have in all our tests) is to mock
DateTime->now to make sure dt_from_string will always return the same
value, it is what we expect from our tests (in 99.9% of the cases at
least).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6cf717e6c9e377850674ad6462480884a047145b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22917: Recreate the failure
Jonathan Druart [Thu, 16 May 2019 00:45:06 +0000 (19:45 -0500)]
Bug 22917: Recreate the failure

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 085cb4de51c528b6a50b60f591f6b5ac426efd6a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22705: Change default value of cxn_pool to 'Static'
Julian Maurice [Wed, 15 May 2019 06:41:01 +0000 (08:41 +0200)]
Bug 22705: Change default value of cxn_pool to 'Static'

'Static' is the default value of Search::Elasticsearch and for a good
reason : it works in most cases, unlike the 'Sniff' option

To test:
1 - Apply patch
2 - Edit koha-conf.xml
3 - Add '<cxn_pool>Static</cxn_pool>' to the elasticsearch stanza
4 - Restart all the things!
5 - Reindex ES, it works
6 - Set SearchEngine to ES, try searching
7 - It works!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9532a3edeacd8fb3df67e8a01ed4e89069ffc017)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22930: (QA follow-up) Add two test descriptions
Marcel de Rooy [Fri, 17 May 2019 08:35:20 +0000 (08:35 +0000)]
Bug 22930: (QA follow-up) Add two test descriptions

No more than that ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2ccc5dcdf124ff8275f58826c837fc55cfd8a9a1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22930: Make TestBuilder->build_object explodes if parameters are wrong
Jonathan Druart [Thu, 16 May 2019 17:56:07 +0000 (12:56 -0500)]
Bug 22930: Make TestBuilder->build_object explodes if parameters are wrong

This patch implements bug 15339 for build_object.
We want it to warn if the call is wrong.

Test plan:
Make sure the tests are still returning green

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 52325a771a02b603e807c29d586fe44fabebb792)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21651: (QA follow-up) Remove remaining obsolete file from German web installer
Katrin Fischer [Sat, 11 May 2019 12:59:33 +0000 (12:59 +0000)]
Bug 21651: (QA follow-up) Remove remaining obsolete file from German web installer

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 71018d4cca41c9e9eeab1d8980af4f7253a728a8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21651: Always insert notice templates related tables
Jonathan Druart [Wed, 24 Oct 2018 20:02:39 +0000 (17:02 -0300)]
Bug 21651: Always insert notice templates related tables

The 3 following files must be mandatory and insert during the install process:
- message_transport_types.sql
- sample_notices_message_attributes.sql
- sample_notices_message_transports.sql

They insert data for
- message_transport_types
- message_attributes
- message_transport_type

Otherwise the notice templates (table letter) will fail.

Moreover these 3 files are identical and are put in several places (1 per language)
to make the description translatable (using the related .txt file)

Test plan:
- Install Koha in English and in another language
- Select all the sample data
=> They all should be inserted correctly

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 990cc79ef085b74764cd68875fc0fd6dc6da8ffe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21651: Remove language specific sql file for notice templates related tables
Jonathan Druart [Wed, 24 Oct 2018 19:34:46 +0000 (16:34 -0300)]
Bug 21651: Remove language specific sql file for notice templates related tables

This patch removes the 3 following files for the different languages
- message_transport_types.sql
- sample_notices_message_attributes.sql
- sample_notices_message_transports.sql
They were all identical, only one version is kept in installer/data/mysql/mandatory

.txt files are removed as well

They inserted data for
- message_transport_types
- message_attributes
- message_transport_type

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1114ba929f0aa634d6f9c10d8931c2ca25871c7d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22875: Document verbose option in import_patrons
Colin Campbell [Thu, 9 May 2019 10:32:25 +0000 (11:32 +0100)]
Bug 22875: Document verbose option in import_patrons

Docs did not state that verbose can be repeated or that you
need more than 1 repetition to see lines that have failed

To test:
- Run ./import_patrons.pl -h
- Verify the additional documentation for -v is shown.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d9248c8802c4009ca99209da549447d13d6f686f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22847: [18.11] Correctly displayed circ rule values for max_holds
Jonathan Druart [Thu, 16 May 2019 17:31:23 +0000 (12:31 -0500)]
Bug 22847: [18.11] Correctly displayed circ rule values for max_holds

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22886: Missing space between fields from Keyword to MARC mapping in cataloguing...
Katrin Fischer [Sat, 11 May 2019 22:34:03 +0000 (00:34 +0200)]
Bug 22886: Missing space between fields from Keyword to MARC mapping in cataloguing search

If you have multiple subfields mapped to the 'subtitle' keyword,
those fields will show up without separating space.

To test:
- Add 3 subtitle entries in Keyword to MARC mapping for a framework
  - 245 b
  - 245 c
  - 245 h
- Edit a record, make sure the framework matches, add:
  - 245 b, c, h
- Search for it in cataloguing search (not catalog!)
- Verify the subtitle fields show, but are all concatenated
- Apply patch
- Search again and verify the display is improved with a separating
  space

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f00d909220ebde5162335e255e4ba938a9563bff)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20514: Use streetnumber when searching for patrons by address
Jonathan Druart [Sat, 11 May 2019 15:23:28 +0000 (10:23 -0500)]
Bug 20514: Use streetnumber when searching for patrons by address

The streetnumber field was ignored from the search.

Test plan:
Create a patron with streetnumber="12", address="rue des cerisiers"
Search for patrons using the search field "street address"
using: 12 rue des cerisiers
=> Without this patch the patron will not be returned
=> With this patch applied it will!

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 97ec0a2e4bf76cf2e67a7ddbd463d9942a4fe383)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22781: Correctly filter the emails
Jonathan Druart [Thu, 2 May 2019 01:05:30 +0000 (21:05 -0400)]
Bug 22781: Correctly filter the emails

Ho, another bug!

The email was not correctly filtered.

Test plan:
Use the evil string for an email, do a search.
=> Notice that without this patch the results never show up

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5410186f6829fc4b74a845e8954bd7eea3f19862)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22781: Does not double filter address
Jonathan Druart [Thu, 2 May 2019 00:54:02 +0000 (20:54 -0400)]
Bug 22781: Does not double filter address

Ho, a bug!
Some fields in the address where double filtered.

Test plan:
Use the evil strings in the address field and do a search, you will see
double html encoded characters without this patch.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ecb12104ffc7284089a1c8134ca8811e99e7419c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22781: Test patron's info filtering
Jonathan Druart [Thu, 2 May 2019 00:29:05 +0000 (20:29 -0400)]
Bug 22781: Test patron's info filtering

The patron's data was not correctly escaped actually.

Test plan:
This is a good value for the whole patchset: <strong>fir's"tname</strong> \123 ❤
use it for a patron's firstname, then do a search

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 35d00030ceb572822979300a5291356a32427a16)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22781: Escape cardnumber, category's description, library's name and dateexpiry
Jonathan Druart [Thu, 2 May 2019 00:28:04 +0000 (20:28 -0400)]
Bug 22781: Escape cardnumber, category's description, library's name and dateexpiry

This will fix the previous failure. Note that other fields like
borrowernumber, Price escaped values, integers, etc. could be escaped
the same way but will be useless (save polar bears).

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3a3057545c56f4f1a41fcd7643265204844cd2d3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22781: Add tests
Jonathan Druart [Thu, 2 May 2019 00:28:55 +0000 (20:28 -0400)]
Bug 22781: Add tests

Test plan:
Apply only this patch
=> The tests will fail, the library's name is not correctly escaped.

Note:
This applies for the whole patchset, when the tests fail you will need
to remove the patrons added by the tests with the following SQL query:
  delete from borrowers where surname like "test_patron_%";
We are expecting END to be called even if something goes wrong, but
DESTROY must be used instead. This will be fixed separately, on its own
bug report.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6e8ecb8c6c8cf5d5188d2ad138e4fdbd8f395b3e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22225: Correctly use invoiceincgst over listincgst
Martin Renvoize [Mon, 11 Feb 2019 14:04:01 +0000 (14:04 +0000)]
Bug 22225: Correctly use invoiceincgst over listincgst

Mistakenly, we were looking at listincgst in the templates but using
invoiceincgst in the scripts. This patch rectifies that by switching to
use invoiceincgst in the templates too.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 43047ee734e2b6b650e43710a712390433cbb2bd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22878: Do not pass layout_id on creating a layout
Jonathan Druart [Fri, 10 May 2019 17:27:40 +0000 (12:27 -0500)]
Bug 22878: Do not pass layout_id on creating a layout

Attempting to create a patron card layout with mysql strict mode on gives the following error:
  DBD::mysql::st execute failed: Incorrect integer value: '' for column 'layout_id' at row 1

Test plan:
- Turn on sql_strict_modes
- Create a new patron card
=> Must success with this patch applied

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8d53fae9494b50c0cf2dcc98b18982b0d8fc416f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22878: Add tests
Jonathan Druart [Fri, 10 May 2019 17:27:34 +0000 (12:27 -0500)]
Bug 22878: Add tests

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9f18afa7b34574cd872c94ee366a8d3e75085413)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 7862: Preventing warns when creating a notice
Aleisha Amohia [Mon, 29 Apr 2019 03:14:35 +0000 (03:14 +0000)]
Bug 7862: Preventing warns when creating a notice

To reproduce warns:
1) Go to Tools -> Notices & slips
2) Create a new notice of any module

Notice these warns:
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.
Use of uninitialized value $code in regexp compilation at
/home/vagrant/kohaclone/tools/letter.pl line 265.

CGI::param called in list context from package
CGI::Compile::ROOT::home_vagrant_kohaclone_svc_letters_get line 50, this
can lead to vulnerabilities. See the warning in "Fetching the value or
values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.
CGI::param called in list context from package
CGI::Compile::ROOT::home_vagrant_kohaclone_svc_letters_get line 50, this
can lead to vulnerabilities. See the warning in "Fetching the value or
values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.

3) Create a new notice of the Circulation module

Notice this additional warn:
Use of uninitialized value $code in pattern match (m//) at
/home/vagrant/kohaclone/tools/letter.pl line 258.

To test:
4) Apply patch and refresh page
5) Run steps 1-3 again and confirm no warns show

Sponsored-by: Catalyst IT
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 700b7dfa09e38c074cebbbb5caac64e031d5c0d5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22836: (follow-up) improve test message
Nick Clemens [Wed, 15 May 2019 12:10:15 +0000 (12:10 +0000)]
Bug 22836: (follow-up) improve test message

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 92ab7f66eb5371596d8c46e56f4fdb503ed5d81c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22836: (follow-up) Bug 22478: (QA follow-up) Make test consistent with variable...
Jonathan Druart [Fri, 3 May 2019 01:04:54 +0000 (21:04 -0400)]
Bug 22836: (follow-up) Bug 22478: (QA follow-up) Make test consistent with variable name

One occurrence was missing.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7799f4ddd1f1fe111081dc3695c9038fa500e961)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoRevert "Bug 22478: (QA follow-up) Handle category in opac-shelves like a boolean"
Jonathan Druart [Fri, 3 May 2019 00:49:45 +0000 (20:49 -0400)]
Revert "Bug 22478: (QA follow-up) Handle category in opac-shelves like a boolean"

This reverts commit 375dd35d5354d46c4c16f534494b123ce370c3f4.

https://bugs.koha-community.org/show_bug.cgi?id=22836
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7bed2a3fe61ff605b636e292e73b96947de23b29)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoRevert "Bug 22478: (QA follow-up) Update tests to check for any script tags"
Jonathan Druart [Fri, 3 May 2019 00:49:37 +0000 (20:49 -0400)]
Revert "Bug 22478: (QA follow-up) Update tests to check for any script tags"

This reverts commit d9b3b90849fd95d296b73b330c4e32ff018c81a5.

https://bugs.koha-community.org/show_bug.cgi?id=22836
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c265fcc476bc4d4fc74d5a23c0d5ef8ef21650b2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22812: Use Koha::Subscription in NewSubscription
Jonathan Druart [Fri, 10 May 2019 16:11:14 +0000 (11:11 -0500)]
Bug 22812: Use Koha::Subscription in NewSubscription

Starting to write tests I realize that we are going to add too much
specific logic which is already handled in Koha::Object->store.
The easiest and safe way is to use it :)

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b41f215bfedbae0898a9291d2f14e2a3dd560049)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22812: Fix GROUP BY in checkrouting
Jonathan Druart [Mon, 6 May 2019 18:50:54 +0000 (13:50 -0500)]
Bug 22812: Fix GROUP BY in checkrouting

On the way, let fix this error
DBD::mysql::st execute failed: Mixing of GROUP columns
(MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is
no GROUP BY clause [for Statement "SELECT count(routingid) routingids
FROM subscription LEFT JOIN subscriptionroutinglist

Test plan:
Create a routing list, search for subscriptions
In the action list you should see "Edit routing list (1)" or "New
routing list"

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 256b134a94e83b7072b5891a2d60f0e08e813583)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22812: Add tests for checkrouting
Jonathan Druart [Mon, 6 May 2019 18:50:26 +0000 (13:50 -0500)]
Bug 22812: Add tests for checkrouting

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 0759811ab629e8215ee270b4ec920f71d9bc0d25)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22812: Fix new subscription with strict sql modes
Jonathan Druart [Mon, 6 May 2019 18:34:19 +0000 (13:34 -0500)]
Bug 22812: Fix new subscription with strict sql modes

With sql_strict_modes turned on, if you try to create a new subscription
you will get:
Incorrect integer value: '' for column '$INT_COLUMN' at row 1

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e8e7ea352ef237555ee4d47c98feb879f3eb9e31)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22713: Remove unecessary $replacementprice var
Jonathan Druart [Mon, 6 May 2019 16:55:32 +0000 (11:55 -0500)]
Bug 22713: Remove unecessary $replacementprice var

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3b877cc240eb44acafaef1ed5f287eae3dfb7baa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22713: Pass replacement price in to order if defined by MarcItemFieldsToOrder
Nick Clemens [Thu, 25 Apr 2019 16:23:22 +0000 (16:23 +0000)]
Bug 22713: Pass replacement price in to order if defined by MarcItemFieldsToOrder

To test:
 1 - Have AcqCreateItems set to 'On ordering' (or set in a basket)
 2 - Define MARCItemFieldsToOrder
    homebranch: 975$a
    holdingbranch: 975$b
    itype: 975$y
    nonpublic_note: 975$x
    public_note: 975$z
    loc: 975$c
    ccode: 970$c
    notforloan: 975$7
    uri: 975$u
    copyno: 975$n
    quantity: 975$q
    budget_code: 975$h
    price: 975$g
    replacementprice: 975$p
 3 - Have a marc record with some order info defined as above, including a replacementprice
 4 - Add to basket - > from a new file
 5 - Don't check for duplicates, add the order
 6 - Note the order has no replacementprice, but the item does
 7 - Close basket, receive order, do not enter a new replacement price
 8 - Note the items replacement price is clear
 9 - Apply patch
10 - Repeat
11 - Note when order added to basket it has a replacement price
12 - Note when order is received the replacement price is populated and passed into item correctly

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 57b027734e3c1a315cd11fedbf94771fa8381a30)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 11853: Add tests
Jonathan Druart [Wed, 8 May 2019 21:37:40 +0000 (16:37 -0500)]
Bug 11853: Add tests

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 735d23c299669b40d3e3e2a4fe21b88fc6cca00f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 11853: Allow to clear the date of birth at the OPAC
Jonathan Druart [Wed, 8 May 2019 21:37:50 +0000 (16:37 -0500)]
Bug 11853: Allow to clear the date of birth at the OPAC

A patron is not able to clear their date of birth.

When cleared tt is set to NULL in DB which means, for the patron's
modifications feature, that nothing has been changed.

Test plan:
0/ Do not apply the patch
1/ Edit your personal details at the OPAC
2/ Add a date of birth
3/ On the staff interface, approve the modification request
=> OK it is updated
4/ Edit your personal details and clear the date of birth
5/ On the staff interface
=> KO the table display is wrong, nothing is marked has changed
6/ Approve the modification requiest
=> KO it has not been cleared
7/ Apply the patch and repeat 1 to 6 and confirm that the behaviors are
now correct.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6692800794cbf403e8be8c8062608b60148c0d56)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22881: Trying to clear search history via the navbar X doesn't clear any searches
Owen Leonard [Fri, 10 May 2019 13:24:39 +0000 (13:24 +0000)]
Bug 22881: Trying to clear search history via the navbar X doesn't clear any searches

This patch undoes a mistake introduced in my patch for Bug 21479. A
"preventDefault()" was added to the search history clear button by
mistake. The "confirmDelete" function only works if the default action
of the link is allowed to complete.

To test you must have the EnableOpacSearchHistory system preference
enabled. Apply the patch and log into the OPAC as a patron who has a
search history.

Click the "X" link in the header next to the "Search history" link.
Confirm that you want to clear your search history. The page should
refresh. Navigate to your account -> Your search history to confirm that
your search history has been cleared.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6d1b7ff27eb2d53d637c169c7132a66d546c0124)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22899: DBRev 18.11.05.001
Nick Clemens [Tue, 14 May 2019 18:15:54 +0000 (18:15 +0000)]
Bug 22899: DBRev 18.11.05.001

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b90bbc125969dc0048dde2ec37531a6ef6cd2b36)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22899: (QA follow-up) Change accessor name
Martin Renvoize [Tue, 14 May 2019 12:21:55 +0000 (13:21 +0100)]
Bug 22899: (QA follow-up) Change accessor name

This patch changes pending_hold to has_pending_hold to signify that
we're returning a boolean and not a Koha::Hold object.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5c81d986212b480d9b491e46b3fb4498c0eb2c2c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22899: (QA follow-up) Ensure constraint is created
Martin Renvoize [Tue, 14 May 2019 12:17:01 +0000 (13:17 +0100)]
Bug 22899: (QA follow-up) Ensure constraint is created

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 49a6aac8b6d8fd13999638f5a6ae4d4481dbf304)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22899: Add pending_hold method to Koha::Item
Nick Clemens [Mon, 13 May 2019 20:09:05 +0000 (20:09 +0000)]
Bug 22899: Add pending_hold method to Koha::Item

To test:
 1 - Enable course reserves
 2 - Create a course
 3 - Add an item to the course
 4 - Attempt to view the course on the OPAC
 5 - Internal Server Error
 6 - Apply patch
 7 - Add an item to the holds queue by placing a hold and  running holds queue builder or:
     INSERT INTO tmp_holdsqueue (itemnumber) VALUES (###);
 8 - View the course page, note item appears 'Pending hold'
 9 - Remove the holdsqueue line
10 - View the course page, note item appears 'Available'
11 - prove -v t/db_dependent/Koha/Item.t

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
I see Jonathan's comments about small improvements, but will sign off as
everything works as expected here.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f21ebad7d298f25e44771e5833d1d1d4d6d8f777)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22899: Database update
Nick Clemens [Mon, 13 May 2019 20:08:06 +0000 (20:08 +0000)]
Bug 22899: Database update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit af1067f3d466cf3bd32c4747c4a00dd7542c1fe0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22433: Use Data::Dumper instead of Data::Printer
Jonathan Druart [Fri, 10 May 2019 17:32:23 +0000 (12:32 -0500)]
Bug 22433: Use Data::Dumper instead of Data::Printer

Data::Printer is not in our deps

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b5b64e7900fd61bd525409ee869deafde7b8c50a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22433: Add debug statement to Transaction.t
Jonathan Druart [Thu, 9 May 2019 18:04:38 +0000 (13:04 -0500)]
Bug 22433: Add debug statement to Transaction.t

Hard to know what's going on here without more info. Adding this output
may help to investigate more.

Test plan:
Make sure the tests still pass

If it fails, please paste the output!!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 63a8e27f2e087b698e986e026dc9fa511b2afbfe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21709: Replace 'no popup' plugin links with a span
Jonathan Druart [Thu, 1 Nov 2018 16:31:31 +0000 (13:31 -0300)]
Bug 21709: Replace 'no popup' plugin links with a span

Test plan:
Edit a bibliographic record
Notice that the icons next to fields linked with a plugin can be a link
or not. The browser displays a pointer or not.

It will remove the ambiguity to display an icon that is clickable but
does nothing when clicked.
We could also have another icon to disociate both behaviors.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9fa97774ae6b3c84028b15f8c768460a012320ea)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22782: DBIC update for SocialData
Nick Clemens [Fri, 10 May 2019 12:10:42 +0000 (12:10 +0000)]
Bug 22782: DBIC update for SocialData

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5ecbe281aff13e53d4fbc5064714de9209410358)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22895: (bug 22650 follow-up) Correct itemnumber call in placerequest.pl
Nick Clemens [Mon, 13 May 2019 15:07:41 +0000 (15:07 +0000)]
Bug 22895: (bug 22650 follow-up) Correct itemnumber call in placerequest.pl

Backport of 22650 makes an object call to an item hashref retrieved by get item:

  94             if ( CanItemBeReserved($borrower->{'borrowernumber'}, $item->itemnumber, $branch)->{status} eq 'OK' ) {

Should be $item->{itemnumber}

To test:
1 - Try to place an item level hold
2 - It fails
3 - Aply patch
4 - Try again
5 - It works!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 15524: (RMaint followup) Missing Sponsor Attribution
Martin Renvoize [Thu, 9 May 2019 11:44:49 +0000 (12:44 +0100)]
Bug 15524: (RMaint followup) Missing Sponsor Attribution

Sponsored-by: Northeast Kansas Library System, NEKLS (http://nekls.org/)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22357: (RMaint follow-up) Mana does not exist in 18.11.x
Martin Renvoize [Wed, 8 May 2019 18:13:46 +0000 (19:13 +0100)]
Bug 22357: (RMaint follow-up) Mana does not exist in 18.11.x

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22816: OPAC detail holdings table should now look a bit better
Liz Rea [Wed, 1 May 2019 00:31:15 +0000 (00:31 +0000)]
Bug 22816: OPAC detail holdings table should now look a bit better

This patch sets the "autowidth" option to "false" for the OPAC
holdings DataTable on opac-detail.pl. This gives the table a fluid
width rather than having the width be "hard-coded" by DataTables upon
first page render.

To test, apply the patch and view the detail page for a bibliographic
record with some items. Under the "Holdings" tab, the table of
holdings should fill the width of the tab container.

Resize the browser window and confirm that the table width adjusts
accordingly.

Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: arthur <arthur.bousquet@inlibro.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 604c7b818b63b93c66bb751ceb9d99bc1c109be9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21036: Remove odd number of elements warnings from AuthoritiesMarc.pm
Marcel de Rooy [Thu, 5 Jul 2018 10:10:26 +0000 (12:10 +0200)]
Bug 21036: Remove odd number of elements warnings from AuthoritiesMarc.pm

Like this one (16.11 line number):
Odd number of elements in anonymous hash at C4/AuthoritiesMarc.pm line 1070.

We need to add a scalar to some MARC::Field::subfield calls. In list context
an empty list returned affects the hash built around it.

Test plan:
Could reproduce this warning easily from OPAC authority search.
opac-authorities-home.pl calling BuildSummary.

Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 88b37330abaee6372ec999c1a81fd216d66a1379)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21036: Fix warnings from C4/Biblio
Marcel de Rooy [Thu, 5 Jul 2018 07:53:57 +0000 (09:53 +0200)]
Bug 21036: Fix warnings from C4/Biblio

Use of uninitialized value $isbn in string ne at /usr/share/koha/prodclone/C4/Biblio.pm line 1794. (16.11 line number)
Trivial edit.

And these warnings from TransformHtmlToXml (with 16.11 line numbers):
Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2527.
Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2528.
substr outside of string at /usr/share/koha/prodclone/C4/Biblio.pm line 2528.
Indicator in 952 is empty at /usr/share/koha/prodclone/C4/Biblio.pm line 2534.

The last warning is not needed and can be removed.
Note that the code used the construct @$indicator[$j] for $$indicator[$j].
The first is an array slice. This worked in list context. But apparently
the second was meant to be used. And can be rewritten as $indicator->[$j]
which generally is considered more readable.
The code around indicator1/2 and ind1/2 is simplified. This change is applied
twice in the same sub.

Test plan:
Read the changes.
Run t/Biblio/TransformHtmlToXml.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 295e9b1054386cf188c5fc1eb4fd590e5c451513)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21036: Fix uninitialized value within @itemnumber in string ne
Marcel de Rooy [Wed, 4 Jul 2018 14:49:38 +0000 (16:49 +0200)]
Bug 21036: Fix uninitialized value within @itemnumber in string ne

Line from 16.11 log:
Use of uninitialized value within @itemnumber in string ne at /usr/share/koha/prodclone/reserve/modrequest.pl line 70.

Test plan:
Read the change. Not 100% identical (numeric zero) but should be enough.
This line is probably not needed at all.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4560d9623663e9fd0b60f9a39ec53082cdd90f24)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22800: (bug 22550 follow-up) Do not raw filter when not necessary (OPAC suggestions)
Jonathan Druart [Mon, 29 Apr 2019 02:09:39 +0000 (22:09 -0400)]
Bug 22800: (bug 22550 follow-up) Do not raw filter when not necessary (OPAC suggestions)

This is a follow-up for bug 22550, we do not need to use the $raw
filter.

Test plan:
Same as bug 22550:
Test plan:
Test plan:
1. OPAC->login->your purchase suggestions->New purchase suggestion
2. Click button "Submit your suggestion" directly without filling in any field.
   Empty suggestion record was added succeffully.
3. Apply the patch.
4. Click button "Submit your suggestion" directly without filling in any field.
   The required fields should be labeled in red.
   (you can change the mandatory fields by preference
   'OPACSuggestionMandatoryFields')

Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b9bff787ca863a45128cbd3a05a109e8f66d4fdf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22791: Unify calculation between aqui-home and ordered.pl
Nick Clemens [Fri, 26 Apr 2019 19:58:05 +0000 (19:58 +0000)]
Bug 22791: Unify calculation between aqui-home and ordered.pl

To test:
1 - Enable order price rounding
2 - Order an example with 8 * 16,99 and 42% discount, 19.45% tax.
3 - Check ordered page - 94.17 is total
4 - Check aqui-home - 94.16 is total
5 - Apply patch
6 - Verify numbers now match

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 100b1e3eecb4de27f6a85095196019f6b36251c0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22527: (RM follow-up) Add filter
Nick Clemens [Tue, 7 May 2019 15:57:35 +0000 (15:57 +0000)]
Bug 22527: (RM follow-up) Add filter

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d38d78bcf4cc62d34aa953864cf6da87bef93c80)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22527: web installer links to outdated DB manual
Liz Rea [Tue, 16 Apr 2019 06:55:36 +0000 (06:55 +0000)]
Bug 22527: web installer links to outdated DB manual

To reproduce:
1. Use MySQL or MariaDB for your Koha installation
2. Create an empty database and point $KOHA_CONF to this database name.
3. Grant SELECT privilege to your database user, e.g.
grant select on koha3.* to 'koha'@'%' identified by 'koha';
4. Go to step 2 of web installer where it checks database
connection
5. Observe the following message

     User koha doesn't have enough privilege on database koha.

     Ask for or make a change in the user's privileges. User koha must
     have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on
     database koha2.

     Need help? See manual for PostgreSQL

6. Note "See manual for PostgreSQL" is wrong. Should now read Need help?
For help with granting permissions, please search online for "[%
dbms %] manual grant permissions" of course the dbms should be the dbms
you are using.
7. Apply patch, restart all
8. Refresh page and observe it now displays correct link

Test plan and original patchset by Lari Taskula <lari.taskula@hypernova.fi>

Sponsored-by: Hypernova Oy
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 22527: Remove extra space after '?'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit abd4445cd2b86fe601de20b403bb621115b27c83)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22787: Add mapping of letters "ů" and "Ů" to zebra definitions
Josef Moravec [Mon, 29 Apr 2019 12:18:43 +0000 (14:18 +0200)]
Bug 22787: Add mapping of letters "ů" and "Ů" to zebra definitions

Test plan:
0) Do not apply the patch
1) Add some word with character "ů" into metadata, for example author "Martinů, Bohuslav"
2) Try to search it with "Martinu" and you'll see you can't find it
3) Apply the patch
4) Copy file etc/zebradb/etc/word-phrase-utf.chr to your /etc/koha directory
    sudo cp etc/zebradb/etc/word-phrase-utf.chr /etc/koha/zebradb/etc/
5) koha-zebra --restart kohadev
6) koha-rebuild-zebra -f kohadev
6) try to search "Martinu" again - you should be able to find your record

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d57239ca78e7719f4c04865e8c493919c6362c15)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21671: Prevent Modifications.t to fail randomly
Jonathan Druart [Mon, 12 Nov 2018 18:20:33 +0000 (15:20 -0300)]
Bug 21671: Prevent Modifications.t to fail randomly

If repeatable is set to 0 by TestBuilder, the tests will fail with:
t/db_dependent/Koha/Patron/Modifications.t .. 1/6     # Looks like you planned 20 tests but ran 9.

 #   Failed test 'approve tests'
 #   at t/db_dependent/Koha/Patron/Modifications.t line 259.
[repeatable not set for attribute type and tried to add a new attribute for the same code]# Looks like your test exited with 255 just after 5.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 914f23970de536df3972ebd75b280ee8eec98955)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22813: (follow-up) Add missing condition
Tomas Cohen Arazi [Tue, 30 Apr 2019 18:48:14 +0000 (15:48 -0300)]
Bug 22813: (follow-up) Add missing condition

This patch restores a missing condition. $patron gets renamed to make
it obvious that it related to the logged in user.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 45b1ff8dfa1054590544caff200b307144bd02cf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22813: remove repetitive queries inside two nested loops in searchResults
Tomas Cohen Arazi [Tue, 30 Apr 2019 15:30:25 +0000 (12:30 -0300)]
Bug 22813: remove repetitive queries inside two nested loops in searchResults

This patch moves a query on Koha::Patrons and then the related
Koha::Patron::Category that needlessly happens inside two nested loops
(all items of all MARC records in the resultset).

The Koha::Patron and Koha::Patron::Category are always the same as it is
fetched from C4::Context->userenv each time.

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/Search.t
=> SUCCESS: Tests pass
- Apply this patch
- Run:
 k$ prove t/db_dependent/Search.t
=> SUCCESS: Tests still pass!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 10efe4e3f239c47b847c53f06f82245e07d54759)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22453: Make TestBuilder generates dates taking into account the timezone
Jonathan Druart [Mon, 4 Mar 2019 21:12:56 +0000 (18:12 -0300)]
Bug 22453: Make TestBuilder generates dates taking into account the timezone

I have no idea why this only appears today but TestBuilder generates dates using DateTime->now,
which does not take into account the timezone.

It has been highlights by a failing test today on U18.
Why today whereas this patch was pushed few weeks ago?
Why U18 and not D9?

The output of the test is:
koha_1       |     #   Failed test 'With BorrowerLogs and TrackLastPatronActivity we should not spam the logs'
koha_1       |     #   at t/db_dependent/Koha/Patrons.t line 1421.
koha_1       |     #          got: '2'
koha_1       |     #     expected: '1'
koha_1       |     # Looks like you failed 1 test of 4.
koha_1       |
koha_1       | #   Failed test 'BorrowersLog tests'
koha_1       | #   at t/db_dependent/Koha/Patrons.t line 1422.
koha_1       | # Looks like you failed 1 test of 33.
koha_1       | [19:51:44] t/db_dependent/Koha/Patrons.t

Actually there are 2 logs, one for the cardnumber that is expected, and on for updated_on:
   "updated_on" : {
      "after" : "2019-03-04 21:10:00",
      "before" : "2019-03-04 18:10:00"
   }
Apart from the fact that we may want to remove this updated_on field from MODIFY,
the before/after dates differ from 3 hours.
Here it's currently 18:10 and in UTC-3

To prevent such behaviors in tests (create stuffs in the future...), we should
use our Koha::DateUtils::dt_from_string method that takes care of the timezone
used in other places of Koha.

Test plan:
prove t/db_dependent/Koha/Patrons.t
May fail without this patch.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This patch is fine in itself, but there may still be an issue around
the failing test for TrackLastPatronActivity. Reopened bug 22741.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c1513a10c35f721e3c519d5ab3c38c7154b7fa1c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22808: Move Cache.t to db_dependent
Mirko Tietgen [Tue, 30 Apr 2019 08:56:20 +0000 (10:56 +0200)]
Bug 22808: Move Cache.t to db_dependent

Cache.t fails during package build. Moving it to db_dependent fixes
the problem.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6509d73d7925fe5d317d6f2baa1d1565d8d36220)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22420: Remove wrong calculation on approved tags
Tomas Cohen Arazi [Wed, 27 Feb 2019 10:09:12 +0000 (07:09 -0300)]
Bug 22420: Remove wrong calculation on approved tags

Before the patch from bug 14385, the passed structure (that is returned
by get_approval_rows() looks like:

\ [
    [0] {
        approved           1,
        approved_by        51,
        approved_by_name   undef,
        date_approved      "2019-02-26 15:36:42",
        term               "another",
        weight_total       3
    },
    [1] {
    ...

After the introduced 'filtering', we loose the information about the
term weight!:

\ [
    [0] {
        approved               1,
        author                 "Heylin, Clinton.",
        biblionumber           1,
        borrowernumber         51,
        date_created           "2019-02-26 15:36:37",
        language               undef,
        subtitle               [],
        tag_id                 1,
        term                   "word",
        time_created_display   "15:36:37",
        title                  "E Street shuffle :",
        visible                1,
        XSLTBloc               "
            <<<BUNCH OF GENERATED HTML HERE>>>
    ...

The code even calls GetMarcBiblio. This needs to be reverted as it is
plain wrong. If it was worth removing *some* biblios from the
weight_total value, then this calculation should be done somewhere else,
without fetching the MARC data again.

Signed-off-by: Claudio <costalc@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 28bcc5aa68733e41d50a6a801088b06857968f42)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22010: Check preferences for ebook integration
Nick Clemens [Mon, 17 Dec 2018 13:35:09 +0000 (13:35 +0000)]
Bug 22010: Check preferences for ebook integration

To test:
1 - Enable OverDrive and RecordedBooks (you can put anything in the
        prefs)
2 - Search on the opac - verify you get results (or search error) on
first page of results'
3 - Go to second page of results - OD and RB are not searched
4 - Apply patch
5 - Verify nothing has changed

If you have valid credentials:
1 - Enable RB prefs
2 - Sign in with an account that has an email matching your registered
account for recordedbooks
3 - Confirm you RB account loads on opac-user.pl

Otherwise:
Read the patches, verify it all makes sense

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7a44c9edb969cd92db4de0223a2c9db06d576451)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22357: Do not duplicate report rows if several reports exist
Jonathan Druart [Mon, 29 Apr 2019 01:40:21 +0000 (21:40 -0400)]
Bug 22357: Do not duplicate report rows if several reports exist

At the moment every time you run runreport.pl with the --store-results
option another line will appear for your report in the saved
reports table. This is not a data, but a display problem as the
report is still only stored once.

1) Create a report and note the report number
2) Run from command line (replace X by report number) :
    misc/cronjobs/runreport.pl X --format=csv --csv-header --store-results
3) Go to saved reports table
4) Look at the table, each run of the cronjob will create a new row
   in the table instead of just updating the saved results column.
5) Apply patch
6) Veriy the table displays correctly again and there are no regressions

QA: Run t/db_dependent/Reports/Guided.t

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4ca1d8e3b3f60722321f9f4b5f1f0caa461beecb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22717: (bug 20287 follow-up) Fix Google OpenId auto registration
Jonathan Druart [Sat, 27 Apr 2019 00:49:14 +0000 (20:49 -0400)]
Bug 22717: (bug 20287 follow-up) Fix Google OpenId auto registration

Silly bug caused by:
  commit ef410fd62f279a10687636a4f26babb2c91ecadc
  Bug 20287: Replace occurrences of AddMember with Koha::Patron->new->store->borrowernumber

Constructors take a hashref!

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 59b740613e7a72bf6e5283c2876bad9444a7ef6a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoUpdate release notes for 18.11.05 release v18.11.05
Martin Renvoize [Mon, 29 Apr 2019 11:33:38 +0000 (12:33 +0100)]
Update release notes for 18.11.05 release

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoIncrement version for 18.11.05 release
Martin Renvoize [Mon, 29 Apr 2019 11:07:23 +0000 (12:07 +0100)]
Increment version for 18.11.05 release

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoTranslation updates for Koha 18.11.05
Koha translators [Mon, 29 Apr 2019 09:48:15 +0000 (06:48 -0300)]
Translation updates for Koha 18.11.05

(cherry picked from commit d20e811b71fa536aaf5b9e34c4804dd899875a81)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22542: Force back button to display personal data
Jonathan Druart [Thu, 21 Mar 2019 17:45:37 +0000 (14:45 -0300)]
Bug 22542: Force back button to display personal data

This is a follow-up of bug 5371

The following command must not return anything:
grep ^output_html_with_http_headers `git grep -l -P "authnotrequired\s*=>\s*0" opac`|grep -v force_no_caching

This must be a test somehwere to prevent further regressions.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22478: (RMaint follow-up) source t::lib::Mocks
Martin Renvoize [Fri, 26 Apr 2019 16:24:06 +0000 (17:24 +0100)]
Bug 22478: (RMaint follow-up) source t::lib::Mocks

In 18.11.x the t::lib::Mocks module is not yet sourced for the relevant
test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22478: (QA follow-up) Update tests to check for any script tags
Martin Renvoize [Mon, 29 Apr 2019 12:30:09 +0000 (13:30 +0100)]
Bug 22478: (QA follow-up) Update tests to check for any script tags

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22478: (QA follow-up) Make test consistent with variable name
Martin Renvoize [Fri, 26 Apr 2019 18:56:43 +0000 (19:56 +0100)]
Bug 22478: (QA follow-up) Make test consistent with variable name

We were adding data to category 1 (private lists) and testing against
that, but we named the variable 'publist_lists'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22478: (QA follow-up) Handle category in opac-shelves like a boolean
Marcel de Rooy [Fri, 12 Apr 2019 07:02:06 +0000 (07:02 +0000)]
Bug 22478: (QA follow-up) Handle category in opac-shelves like a boolean

The category parameter should be restricted to 1 or 2 (private/public). In
order to keep same behavior, no parameter means 1 (private).
Note: Adding the same line in intranet counterpart.

Test plan
[1] Check for category empty, '1a', '11' etc. And with script ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22478: Fix POD
Katrin Fischer [Wed, 10 Apr 2019 02:06:37 +0000 (02:06 +0000)]
Bug 22478: Fix POD

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22478: Add tests
Jonathan Druart [Fri, 15 Mar 2019 16:41:27 +0000 (13:41 -0300)]
Bug 22478: Add tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22478: Prevent XSS vulnerabilities when pagination appears
Jonathan Druart [Thu, 14 Mar 2019 22:42:50 +0000 (19:42 -0300)]
Bug 22478: Prevent XSS vulnerabilities when pagination appears

This is a bad one as we thought we were XSS safe since bug 13618.

The html code generated in C4::Output::pagination_bar must escape the
variables and values correctly.

This patch needs to be widely tested, everywhere the pagination appears,
to make sure we will not introduce regressions.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22692: Check for patron using cardnumber and userid
Nick Clemens [Fri, 12 Apr 2019 01:23:34 +0000 (01:23 +0000)]
Bug 22692: Check for patron using cardnumber and userid

TO test:
1 - Set failed login attempts to 1
2 - Attempt a login with a userid and bad password, no success
3 - Attempt a login with userid and correct password, prevented because
locked
4 - Attempt a login with cardnumber and right password, you are logged
in
5 - Log out, try again with userid and correct password, prevented
because locked?
6 - Apply patch
7 - Repeat 1-3 to lock account
8 - Attempt logging in with cardnumber, you are prevented

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22692: Unit tests
Nick Clemens [Fri, 12 Apr 2019 01:11:19 +0000 (01:11 +0000)]
Bug 22692: Unit tests

1 - Apply just this patch
2 - prove -v t/db_dependent/Auth.t
3 - Failure
4 - Apply second patch
5 - prove -v t/db_dependent/Auth.t
6 - Success

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22464: Pass forward parameters
Andrew Isherwood [Wed, 6 Mar 2019 14:07:50 +0000 (14:07 +0000)]
Bug 22464: Pass forward parameters

This patch ensures that parameters that are present are passed forward
when accepting the copyright notice.

Test plan:

- Clone the latest version of the FreeForm backend from:
  https://github.com/PTFS-Europe/koha-ill-freeform
- Ensure the ILLModuleCopyrightClearance syspref is populated
- Create an OpenURL in order to pre-populate the FreeForm form, a suitable URL would be:

<your_koha_instance>/cgi-bin/koha/opac-illrequests.pl?openurl=true&backend=FreeForm&method=create&opac=1&atitle=Theater%20careers.%20%5Belectronic%20resource%5D%20%3A%20a%20realistic%20guide.&aulast=Donahue%2C%20Tim&date=2012&genre=article&isbn=978123123123&issn=1234-5678&issue=34&pages=12-34&sid=EBSCO%3AAthlone%20Institute%20of%20Technology%3Aait.101326&title=article%20title%20here&volume=12

- Log in
- Accept the copyright notice
=> TEST: Observe that the FreeForm form is pre-filled with the metadata
supplied in the OpenURL

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5e20e438e80465fcd6f1c2af5e6138a639dec5f3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22621: Fix filters on subscription search results
Jonathan Druart [Wed, 24 Apr 2019 02:49:46 +0000 (22:49 -0400)]
Bug 22621: Fix filters on subscription search results

Caused by
  commit 4e698f7b478a094d7b32ebfeaa917bca05ebcc5b
  Bug 18426: Allow to edit subscriptions in batch

There is a shift caused by a hidden column, which make the filters
searching on the previous column.

Test plan:
- Add 1+ searchable additional field for subscription
- Create a new subscription
- Search for subscriptions
- Use the column filters to filter the results
=> The results must be filtered accordingly

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1d6e9ff44c19379a41e9ce688685a24788583e0c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 21589: Series link formed from 830 field is incorrect
Kyle M Hall [Wed, 17 Oct 2018 18:43:11 +0000 (14:43 -0400)]
Bug 21589: Series link formed from 830 field is incorrect

Bug 13692 corrected the series link for records using a 490/800 combination

When a record has a 490/830 conbination for series, the link is malformed (title is used as author, title is blank)

Test Plan:
1) Catalog two or more records with 830 fields
2) Note the series links are broken
3) Apply this patch
4) Reload the record details page
5) The series link should now work
6) Repeat for the OPAC

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 20496bc78b7830d812fda454a0fe243fae9c465c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22715: Remove extraneous html filter
Nick Clemens [Thu, 25 Apr 2019 17:47:14 +0000 (17:47 +0000)]
Bug 22715: Remove extraneous html filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7e85754083bd66f45009f55a01e9dec9eda81504)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22715: Searching for patrons with "" in the circulation note hangs patron search
Kyle M Hall [Tue, 16 Apr 2019 14:34:56 +0000 (10:34 -0400)]
Bug 22715: Searching for patrons with "" in the circulation note hangs patron search

To replicate:
Edit a patron to have a circ note, include quoted text in it, such as "this is quoted string"
Go to the patron search, search for a set of results that would include the patron with the quotes in the note
Enjoy looking at "Processing" for forever.

Test Plan:
1) Apply this patch
2) Attempt to replicate using the steps above

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
I took this a step further and used <script>"something in
quotes"</script> for my test note and this worked just fine. YAY.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6e641c5bcb7370556326fb64838fce1eefbc2c18)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20692: Extreme toggle checking for plack
Mark Tompsett [Mon, 28 May 2018 16:45:29 +0000 (16:45 +0000)]
Bug 20692: Extreme toggle checking for plack

TEST PLAN
---------
sudo koha-plack --disable
sudo koha-plack --disable
sudo koha-plack --enable

sudo koha-plack --disable
echo $?
sudo koha-plack --disable
echo $?
sudo koha-list --noplack
echo $?
sudo koha-plack --enable
echo $?
sudo koha-plack --enable
echo $?
sudo koha-list --plack
echo $?

git bz apply 20692
sudo perl ~/misc4dev/cp_debian_files.pl
then repeat the test.

It should also be noted, because the enable
and disable are now split, if for some reason
they become out of sync, an enable or disable
should correct them.

Because these are bash scripts, the test tool
(/home/vagrant/qa-test-tools/koha-qa.pl)
does not apply.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit de20398db303a1ee45b62f9aa51f124597ed0cd8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22551: Stray "//" appears at bottom of opac-detail.tt
phette23 [Mon, 8 Apr 2019 23:00:47 +0000 (16:00 -0700)]
Bug 22551: Stray "//" appears at bottom of opac-detail.tt

Removes a couple stray "//<![CDATA[" like comments which are artifacts of other
code that since been removed. One of the comments causes two forward slashes to
appear at the bottom of each OPAC detail page.

Testing plan:

- enable SocialNetworks
- visit any OPAC detail page, observe "//" at bottom of page
- apply patch
- revisit page, slashes should be gone

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit eb8f5c86fe5f3e1e20bea73fa8b646cdc092513a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22413: Improve query string and desc creation for Elasticsearch
Ere Maijala [Tue, 5 Mar 2019 09:04:55 +0000 (11:04 +0200)]
Bug 22413: Improve query string and desc creation for Elasticsearch

Test plan:

After each of the following steps, verify that the results and query description looks ok.

1. Do a simple keyword query
2. Change sort order
3. Click a facet
4. Do an advanced search with title and author
5. Change sort order
6. Click a facet

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit aba8b130f8b96e5000e8a1eccecfb53d7b371c30)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22339: DBRev 18.11.04.004
Nick Clemens [Thu, 25 Apr 2019 10:36:36 +0000 (10:36 +0000)]
Bug 22339: DBRev 18.11.04.004

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ed6228de83dc57e624c3b3dc30632775df972277)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22339: Fix search field mappings of MARC fixed fields
Ere Maijala [Thu, 14 Mar 2019 11:31:34 +0000 (13:31 +0200)]
Bug 22339: Fix search field mappings of MARC fixed fields

Fixes handling of /0 selector in addition to several fixed field positions. Note that ff7-01-02 is in fact 00-01 in Zebra and that has been replicated here.

Test plan:
1. Before applying a patch, check from Elasticsearch (e.g. localhost:9200/koha_biblios/_search?q=_id:123) what is indexed in Elasticsearch for a record for date-entered-on-file, ff7-00, ff7-01, ff7-02 and lleader.
2. Apply the patch, update database and save the record again.
3. Verify that the contents of the forementioned fields is now correct in Elasticsearch.
4. Verify that tests pass:  prove -v t/Koha/SearchEngine/Elasticsearch.t

Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 0047ede37e46a3334c9c47d7ebaed848907b6890)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20891: Escape html then JSON
Jonathan Druart [Fri, 8 Jun 2018 15:19:41 +0000 (12:19 -0300)]
Bug 20891: Escape html then JSON

To my understanding we need to escape first html chars then to JSON.

If this patch works we will need to rethink the 'To' TT plugin.
It was originally designed to have several escape methods, but with
these changes it will not make sense to name it 'To' if used only to
escape JSON

IIRC we should keep the 2 different ways to use it:
 * [% To.json( string ) %]
 * [% string | $To %]
otherwise it will be hard to use it when called in argument of
patron-title.inc (`git grep To.json`)

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bdf0d85c1de9cbb37cc8a40b0b4a2e86633d3aaf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 20891: Escape list's names in JSON
Jonathan Druart [Thu, 7 Jun 2018 15:17:26 +0000 (12:17 -0300)]
Bug 20891: Escape list's names in JSON

When someone uses \ in the description of a list, the datatable in staff
won't load and keeps processing.

Test plan:
- Create a list named "<script>alert('hola');</script>"
- Create another list named "k\o\h\a"
- Hit /cgi-bin/koha/virtualshelves/shelves.pl

=> Without this patch the lists will not be displayed, JSON is
malformated
=> With this patch everything is ok

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2be0195895628ec491ee1f25368e60181c4f1eb2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22650: Prevent multiple holds on individual items
Nick Clemens [Wed, 24 Apr 2019 15:12:17 +0000 (15:12 +0000)]
Bug 22650: Prevent multiple holds on individual items

This patch corrects a missing id on the holds_to_place field and adds code to disable the box when an item is checked

Additionally script login now places a single hold if an itemnumebr is passed and checks for holdability of the specific item

To test:
 1 - Allow multiple holds per record in circ rules
 2 - In staff client, go to place a hold on a record
 3 - Select a patron
 4 - Increase the number of holds
 5 - Then select a specific item to hold
 6 - Patron now has multiple holds on a single item
 7 - Apply patch
 8 - Repeat, notice that count is disabled when item checked
 9 - Confirm count is enabled when 'Hold next available item' is checked
10 - Set number to more than 1
11 - Check an item and submit
12 - Confirm only one item is reserved
13 - Hit the script directly (with valid info):
     http://localhost:8081/cgi-bin/koha/reserve/placerequest.pl?biblionumber=1&checkitem=1&holds_to_place_count=2&borrowernumber=5
14 - Confirm only one hold is placed
15 - Confirm multiple hits of the url do not generate further holds

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ef5adaff5ac045000b90c4b2b121d8c2ce2d5c59)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 19241: Waiting items show as available in the cart
Nick Clemens [Tue, 16 Apr 2019 17:21:01 +0000 (17:21 +0000)]
Bug 19241: Waiting items show as available in the cart

The cart uses the same item-status.inc that the details page uses, however, we don't
set the waiting or reserved flags. This patch adds those flags to the script

To test:
1 - Find an item on the opac
2 - Place a hold on the item
3 - Check in the item to confirm the hold
4 - Note the details page on OPAC shows 'On hold'
5 - Add the item to a basket
6 - Note the basket shows 'Available'
7 - Apply patch
8 - Check the cart, should show as 'On hold'

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e2fa6d97ef45efb902086aa3a3d232137c054afa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22743: Add password modal to overdrive results page
Nick Clemens [Fri, 19 Apr 2019 11:25:43 +0000 (11:25 +0000)]
Bug 22743: Add password modal to overdrive results page

This patch also removes a line abotu ratings which was throwing an error.
Confirm stars rating for OD results are still shown as expected

To test:
 1 - Enable overdrive circulation with password required
 2 - Sign in to OPAC but not overdrive
 3 - Perform a search that returns overdrive results
 4 - Click in to results page
     http://localhost:8080/cgi-bin/koha/opac-overdrive-search.pl?q=cats
 5 - Note 'Login to OverDrive account' link
 6 - Click it
 7 - Nothing happens!
 8 - Apply patch
 9 - Repeat
10 - Success!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7be176cf1da5adb5f264bb9668667dfeb1d9a2ae)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
5 years agoBug 22739: Test SelfCheckInTimeout <> 0, not just defined
Tomas Cohen Arazi [Fri, 19 Apr 2019 12:28:35 +0000 (09:28 -0300)]
Bug 22739: Test SelfCheckInTimeout <> 0, not just defined

On sci-main.pl the preference value is tested for 'defined'. This patch
tests it is different than empty string too. This was causing a
JavaScript syntax error, that made it display a wrong message.

To test:
1 - Blank the syspref SelfCheckInTimeout
2 - Attempt to checkin something via sci
=> FAIL: The 'Your request included no check-ins.' message is printed.
3 - Apply this patch, reload the sci-main.pl page
4 - Attempt to checkin something via sci
=> SUCCESS: The UI correctly stacks the scanned barcodes
5 - Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c1949cda9b2847bc6ecf7e1dbc07990c4055b69a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>