koha.git
4 years agoUpdate release notes for the 19.05.00 release v19.05.00
Nick Clemens [Thu, 30 May 2019 15:29:07 +0000]
Update release notes for the 19.05.00 release

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoIncrement version for 19.05.00 release
Nick Clemens [Thu, 30 May 2019 13:42:23 +0000]
Increment version for 19.05.00 release

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoTranslation updates for Koha 19.05.00
Koha translators [Thu, 30 May 2019 13:28:33 +0000]
Translation updates for Koha 19.05.00

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22901: On items search fix search field change listening
Fridolin Somers [Tue, 14 May 2019 06:22:43 +0000]
Bug 22901: On items search fix search field change listening

In items search, when there is a custom field with authorised values :
when changing the conditional select AND/OR then the authorised values select disappears.
This behaviour is like when the search field is changed.

The bug is that JavaScript code meaning search field change listens on all selects instead of only search field select.

Test plan :
1) Define a custom items search field with authorised values
2) Go to items search
3) Click on 'New field'
4) On second line, select custom field
5) The authorised values select appears
6) Select 'AND' in conditional select
7) Without patch the authorised values select disappears, with patch nothing changes
8) On second line, select a non-custom field
9) The authorised values select is replaced by a text field
10) On second line, select custom field
11) The authorised values select appears

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>

4 years agoBug 22981: Remove type attribute from script tags: Catalog
Owen Leonard [Thu, 23 May 2019 18:35:31 +0000]
Bug 22981: Remove type attribute from script tags: Catalog

This patch removes the "type" attribute from <script> tags in several
catalog-related templates.

To test, apply the patch and confirm that the following work properly
without any JavaScript errors in the browser console:

 - Catalog -> Advanced search
 - Catalog -> Item search
 - Search history

Validating the HTML source of these pages should return no errors
related to the "type" attribute.

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>

4 years agoBug 22979: Remove type attribute from script tags: Authorities
Owen Leonard [Thu, 23 May 2019 15:54:07 +0000]
Bug 22979: Remove type attribute from script tags: Authorities

This patch removes the "type" attribute from <script> tags in several
authorities templates. Also removed: Obsolete "//<![CDATA[ //]]>"
markers.

To test, apply the patch and confirm that examples of affected pages
work properly without any JavaScript errors in the browser console:

 - Authorities -> Search -> View authority record
 - Authorities -> Search -> Edit authority record
 - Cataloging -> New record
   - Trigger the authority search form by clicking the plugin link next
     to a tag which has been linked to an authority type (e.g. 100a ->
     Personal name).
   - Search for an authority record.
   - Select an authority record.

Validating the HTML source of any of these pages should return no errors
related to the "type" attribute.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

https://bugs.koha-community.org/show_bug.cgi?id=22797

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22975: Remove type attribute from script tags: Acquisitions
Owen Leonard [Thu, 23 May 2019 13:50:07 +0000]
Bug 22975: Remove type attribute from script tags: Acquisitions

This patch removes the "type" attribute from <script> tags in several
acquisitions templates. Also removed: Obsolete "//<![CDATA[ //]]>"
markers.

This patch also makes minor indentation changes, so diff using the "-w"
flag.

To test, apply the patch and confirm that examples of affected pages
work properly without any JavaScript errors in the browser console:

 - Acquisitions -> Vendors -> Vendor -> Basket groups
 - Acquisitions -> Vendors -> Vendor -> Receive shipments
 - Acquisitions -> Vendors -> Vendor -> Basket:
   In the table of orders, click "Transfer." Transfer an order

Validating the HTML source of any of these pages should return no errors
related to the "type" attribute.

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>

4 years agoBug 22973: Remove type attribute from script tags: Staff client includes 2/2
Owen Leonard [Thu, 23 May 2019 12:37:45 +0000]
Bug 22973: Remove type attribute from script tags: Staff client includes 2/2

This patch removes the "type" attribute from <script> tags in several
staff client include files. Also removed: Obsolete "//<![CDATA[ //]]>"
markers.

This patch also makes minor indentation changes, so diff using the "-w"
flag.

To test, apply the patch and confirm that examples of affected pages
work properly without any JavaScript errors in the browser console:

 - Installer -> Onboarding (uses installer-strings.inc,
   validator-strings.inc)
 - Patrons -> Patron details -> Change password (uses
   password_check.inc)
 - Patrons -> Patron details -> Print summary (slip-print.inc)
 - Circulation -> Check out (strings.inc, timepicker.inc)
 - Cataloging -> New from Z39.50/SRU (z3950_search.inc)

Validating the HTML source of any of these pages should return no errors
related to the "type" attribute.

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>

4 years agoBug 20537: Added checks to remove warning from overdue_notices.pl
Hayley Mapley [Fri, 24 May 2019 18:52:58 +0000]
Bug 20537: Added checks to remove warning from overdue_notices.pl

When executing overdue_notices.pl on borrowers that lack a surname, we
see this error:
Use of uninitialized value in concatenation (.) or string at
/usr/share/koha/bin/cronjobs/overdue_notices.pl line 575.

This patch fixes this issue by setting the $borr variable
based on the information that has been defined.

To test:
1) Create a borrower and set its surname to null
2) Checkout an item to the borrower and set it to be overdue
3) Navigate to kohaclone/misc/cronjobs and enter a koha-shell
4) Run the script: ./overdue_notices.pl
5) Observe the error appears
6) Apply the patch
7) Repeat steps 3-4
8) Observe the error is gone
9) Sign off!

Sponsored-by: Catalyst IT

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22907: Add missing use statement
Jonathan Druart [Thu, 16 May 2019 18:02:29 +0000]
Bug 22907: Add missing use statement

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>

4 years agoBug 22907: Remove previous code handling the same thing
Jonathan Druart [Tue, 14 May 2019 17:27:25 +0000]
Bug 22907: Remove previous code handling the same thing

See:
  commit a71b96295fb07084e4f87ac1a471e89355f3c5a4
  Bug 12627: Fix default values

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>

4 years agoBug 22907: Fix new suggestion with strict sql modes
Jonathan Druart [Tue, 14 May 2019 17:06:24 +0000]
Bug 22907: Fix new suggestion with strict sql modes

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

Test plan:
Turn on strict_sql_modes, create a new suggestion, then edit it.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

JD: Edit after SO, remove unecessary changes (not related to this bug)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22907: Add tests
Jonathan Druart [Tue, 14 May 2019 17:05:53 +0000]
Bug 22907: Add tests

Do not use copyrightdate as it is weird to have it int

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>

4 years agoBug 22932: GetLatestSerials should not return formatted date
Owen Leonard [Fri, 17 May 2019 13:19:33 +0000]
Bug 22932: GetLatestSerials should not return formatted date

This patch updates GetLatestSerials in Serials.pm to remove date
formatting. Formatting of dates should be done in the template using
$KohaDates.

To test, apply the patch and locate a bibliographic record in the staff
client which has a subscription with issues.

 - On the bibliographic detail page for that record, view the
   "Subscriptions" tab. Dates in the table of recent issues should be
   formatted correctly.
 - View the details for the subscription in the Serials module. Create
   or edit a routing list for that serial. In the "Issue" dropdown the
   issue dates should be formatted correctly.
 - View the bibliographic detail page for the record in the OPAC. Open
   the "Subscriptions" tab. In the table of recent issues publication
   date and received date should be formatted correctly. The table
   should sort correctly on these dates.

Note: Although opac-ISBDdetail.pl calls GetLatestSerials, as far as I
can tell there is no serial-related output to update. The code appears
to be unused.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22914: Add holds column to batch item delete to fix show/hide columns behaviour
Lucas Gass [Mon, 13 May 2019 18:05:38 +0000]
Bug 22914: Add holds column to batch item delete to fix show/hide columns behaviour

The changes on 19490 caused a bug, where the show/hide column feature hides the
wrong column on the items table. The two templates share a js file, and
the data passed is the same.

Adding the column to the template brings things back into alignment,
the data is already there, we just show it.

TEST PLAN:
1. Go to Tools > Batch item deletion and enter at least one barcode.
2. Try to hide a column that is showing
3. Notice it hides the wrong column
4. apply patch
5. repeat steps 1 and 2.
6. Notice the correct column is being hidden
7. Verify the new column for number of holds on the item works correctly
   for item and record level holds

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21450: (QA follow-up) remove a couple of unused variables to make QA script happy
Liz Rea [Fri, 24 May 2019 17:56:40 +0000]
Bug 21450: (QA follow-up) remove a couple of unused variables to make QA script happy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21450: Cache authorities search using term and auth_type
Nick Clemens [Fri, 28 Sep 2018 14:58:20 +0000]
Bug 21450: Cache authorities search using term and auth_type

This is a simple fix to prevent incorrect caching of results when using
link_bibs_to_authorities

To test:
1 - Find or create a record with the same term in a subject and genre
heading
2 - Find or create authority records for the term as a subject and genre
type
3 - Run link bibs to authorities
4 - Verify both tags in the record are linked to the subject heading
5 - Aply patch
6 - Unlink the record and re-run the script (or just re-run)
7 - Each tag should be linked to correct authority

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21450: Unit tests
Nick Clemens [Wed, 23 Jan 2019 21:07:41 +0000]
Bug 21450: Unit tests

To test:
1 - Apply just this patch
2 - prove -v t/db_dependent/Linker_Default.t
3 - It fails
4 - Apply second patch
5 - prove -v t/db_dependent/Linker_Default.t
6 - It passes

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Bug 21450: Remove copyright lines

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22724: Check permissions in the script before displaying template
Nick Clemens [Thu, 16 May 2019 10:54:03 +0000]
Bug 22724: Check permissions in the script before displaying template

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22724: Allow only users with correct permissions to 'Write off selected'
Hayley Mapley [Wed, 8 May 2019 03:39:33 +0000]
Bug 22724: Allow only users with correct permissions to 'Write off selected'

Due to the addition of a 'Write off selected' button in 18.11, users without
writeoff permissions could mistakenly view and action the 'Write off
selected' option for a patron in Accounting > Make a payment (Fines > Pay fines).
The attached patch corrects this error.

Test plan:
1) Make sure that a staff user has '(writeoff) Write off fines and fees'
permission disabled
2) Bring up a patron with an unpaid fee, go to Accounting -> Make a
payment
3) Note that 'Write off selected' button is displayed.
4) Select a fee, click 'Write off selected'. Note that staff member has
access to 'Write off an amount toward selected fines'
5) Apply the patch
6) Repeat steps 1-2, and note that the button is no longer displayed
7) Bonus points, as a staff user with writeoff permissions enabled check
that all four buttons (Pay amount, Pay selected, Write off all, Write
off selected) are displayed

Sponsored-by: Catalyst IT

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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>

4 years agoBug 22904: Untranslatable strings in members-menu.js
Owen Leonard [Tue, 14 May 2019 13:43:12 +0000]
Bug 22904: Untranslatable strings in members-menu.js

This patch moves several English strings out of members-menu.js and into
str/members-menu.inc where they can be picked up by the translation
process. The following strings are affected:

"Are you sure you want to renew this patron's registration?"
"Are you sure you want to update this child to an Adult category?  This
cannot be undone."
"Dates of birth should be entered in the format 'MM/DD/YYYY'"
"Dates of birth should be entered in the format 'YYYY-MM-DD'"
"Dates of birth should be entered in the format 'DD/MM/YYYY'"
"Dates of birth should be entered in the format 'DD.MM.YYYY'"

This patch also makes a correction to members-toolbar.inc in order to
enable the presence of the "Update child to Adult" menu item.

To test:

 - Install and update a language.
 - Check the po-file for that language. You should find no msgid for
   the strings listed above.
 - Apply the patch.
 - Update the language you installed.
 - You should find entries for all the strings above.
 - Translate those messages and update the translated templates.
 - Reinstall the translation.

In the staff client:

 - Select your updated translation.
 - Open an expired patron's account and choose "Renew patron" from the
   "More" button in the toolbar. You should be prompted for confirmation
   using the translation you provided.
 - To test the "Update child" confirmation you should have only one
   patron category in the "Adult" category.
   - Open a patron record with a child category and choose "Update
     child" from the "More" menu in the toolbar. You should be prompted
     for confirmation using the translation you provided.
 - To test the date format messages: From the patrons home page, expand
   the advanced search options in the header search form. Select "Date
   of birth" under "Search fields." A correctly-translated tooltip
   should appear above the search field.

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>

4 years agoBug 22908: Prevent ModSuggestion to send a notice if something wrong happened
Jonathan Druart [Tue, 14 May 2019 17:23:25 +0000]
Bug 22908: Prevent ModSuggestion to send a notice if something wrong happened

There is a return value $status_update_table that is set to 0, then we
send the alert (whatever the value of this variable). We must return
earlier if something happened!

Test plan:
Not sure how to recreate it via the interface, so just run the tests?

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>

4 years agoBug 22908: Add tests
Jonathan Druart [Tue, 14 May 2019 17:21:57 +0000]
Bug 22908: Add tests

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>

4 years agoBug 22974: Patron password update validation broken
Owen Leonard [Thu, 23 May 2019 13:29:26 +0000]
Bug 22974: Patron password update validation broken

This patch adds back an include file to the change password template
which was inadvertently removed by Bug 21964. This broke Javascript
validation of the new password fields.

To test, apply the patch and enable the RequireStrongPassword system
preference.

 - Go to Patrons -> Patron details -> Change password.
 - Try entering a weak password in the "New password" field. You should
   get a validation error: "Password must contain at least 3 characters,
   including UPPERCASE, lowercase and numbers."
 - Try entering a password in the second password field which doesn't
   match the first. You should get a validation error: "Please enter the
   same password as above."

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
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>

4 years agoBug 21662: (QA follow-up) Use commitdates over RM dates
Martin Renvoize [Fri, 17 May 2019 13:00:32 +0000]
Bug 21662: (QA follow-up) Use commitdates over RM dates

The manual maintanence of the history.txt file lead to some
discrepancies in first commit dates for many contributors. After a
discussion regarding the automation proccess (and with some of the
contributors who would be most heavily affected) we decided to update
the history file on mass to match the commite dates found in the
repository.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 15221: (QA follow-up) Fix Message.t
Marcel de Rooy [Mon, 27 May 2019 09:39:34 +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>

4 years agoBug 20436: (RM follow-up) Use Koha objects instead of mysql
Nick Clemens [Wed, 22 May 2019 14:26:41 +0000]
Bug 20436: (RM follow-up) Use Koha objects instead of mysql

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 17698: (RM follow-up) Pass lang variable so letter can be translated
Nick Clemens [Wed, 22 May 2019 14:37:53 +0000]
Bug 17698: (RM follow-up) Pass lang variable so letter can be translated

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 14385: (RM follow-up) Remove line from bad rebase
Nick Clemens [Wed, 22 May 2019 14:32:26 +0000]
Bug 14385: (RM follow-up) Remove line from bad rebase

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22896: Missing inputs in transfer modal
Nick Clemens [Mon, 13 May 2019 15:34:47 +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>

4 years agoBug 22802: Check item funds, order funds, and default funds when ordering from a...
Nick Clemens [Tue, 14 May 2019 13:17:34 +0000]
Bug 22802: Check item funds, order funds, and default funds when ordering from a file

This patch tries to centralise the logic of order funds requirements into a single routine.
If propogates defaults down into items/order as necessary, it also prevents unsetting lower values if
a default is set.

To test:
1 - Populate 'MarcItemFieldsToOrder'
2 - Add to a basket from a file
3 - Use a file containing some item records with funds defined or not
4 - Confirm if all items have funds defined, you can order
5 - Confirm that setting the default for an order populates items and you can order
6 - Confirm that setting the default for all orders populates items if present/ order if not
7 - Confirm that if defaults are set the lower levels cannot be unset
8 - Try various settings and confirm all work as expected

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>

4 years agoBug 22965: fixes typo on classification sources description on admin homepage
Henry Bolshaw [Wed, 22 May 2019 15:02:40 +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>

4 years agoBug 22962: Punctuation error in RisExportAdditionalFields
Chris Cormack [Wed, 22 May 2019 13:32:14 +0000]
Bug 22962: Punctuation error in RisExportAdditionalFields

To test
1/ Go to systempreferences search for RisExportAdditionalFields
2/ See the extra , on the first line
3/ Apply the patch
4/ See it is fixed

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22746: Fix typos in add mana comment modals again
Josef Moravec [Tue, 23 Apr 2019 10:37:10 +0000]
Bug 22746: Fix typos in add mana comment modals again

Test plan:
1) Create subscription from Mana
2) On subscription detail page: report mistake > other a modal is shown
it should be exactly 'Please enter a new commment (max 35 characters)'
3) The same in mana search results and in reports

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 15221: SIP server always sets the alert flag when item not returned
David Cook [Tue, 21 May 2019 01:12:44 +0000]
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>

4 years agoBug 21831: Allow move all fields even if destination field is different
Jonathan Druart [Fri, 7 Dec 2018 17:43:18 +0000]
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>

4 years agoBug 22917: Fix typo in another test file
Jonathan Druart [Thu, 16 May 2019 19:07:25 +0000]
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>

4 years agoBug 22917: Fix a typo in an output_pref call
Martin Renvoize [Thu, 16 May 2019 15:55:16 +0000]
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>

4 years agoBug 22917: Prevent Circulation.t if tests ran too slowly
Jonathan Druart [Thu, 16 May 2019 00:46:48 +0000]
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>

4 years agoBug 22917: Recreate the failure
Jonathan Druart [Thu, 16 May 2019 00:45:06 +0000]
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>

4 years agoBug 22046: Simplify and unify the code for get_matches
Nick Clemens [Mon, 24 Dec 2018 12:52:53 +0000]
Bug 22046: Simplify and unify the code for get_matches

To test:
1 - Stage some records for import
2 - Manage the records
3 - Use several different matching rules and note the results
4 - Apply patch
5 - Try several matching rules again and note the results have not
changed
6 - Try under both search engines (Zebra and ES)

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>

4 years agoBug 22934: Add missing use statement
root [Fri, 17 May 2019 12:30:47 +0000]
Bug 22934: Add missing use statement

Also fixes a typo

To test:
1 - Add a subscription to a record
2 - Add an additional field in the admin section
3 - Edit the subscription and define the additional field
4 - Ensure you can view the record in the staff client and opac
5 - Without patch ,in the subscription detail page,click the link of the record title. => software error.
6 - Apply the patch. => no error anymore.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Fixed another typo on L21

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22705: Change default value of cxn_pool to 'Static'
Julian Maurice [Wed, 15 May 2019 06:41:01 +0000]
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>

4 years agoBug 22905: (QA follow-up) remove bad warn
Liz Rea [Thu, 16 May 2019 18:38:23 +0000]
Bug 22905: (QA follow-up) remove bad warn

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>

4 years agoBug 22905: Fix update of suggestion's status if branchcode filter is 'all'
Jonathan Druart [Thu, 16 May 2019 18:20:53 +0000]
Bug 22905: Fix update of suggestion's status if branchcode filter is 'all'

Because of the "Library" filter on the left of the "Suggestions management" screen, there is something wrong happening:

1. Create a suggestion from library A, login from library B
2. Go to  Home › Acquisitions › Suggestions management
=> The suggestion does not appear - OK
3. In the filter on the left, select "all library"
=> The suggestion appears on the pending tab - KO
4. Select the suggestion and mark is as 'Accepted'
=> The suggestion still appears on the pending tab - Failure

The log says:
DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`suggestions`, CONSTRAINT `suggestions_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE) [for Statement "UPDATE `suggestions` SET `accepteddate` = ?, `branchcode` = ?, `currency` = ?, `manageddate` = ?, `price` = ?, `reason` = ?, `suggesteddate` = ?, `total` = ? WHERE ( `suggestionid` = ? )" with ParamValues: 0='2019-05-14T15:48:18', 1="", 2="CAD", 3='2019-05-14T15:48:18', 4="0.00", 5="", 6='2019-05-14T00:00:00', 7="0.00", 8=3] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836.

Let forget what could have happened earlier in the script and do it the regular
way, from $input. Then call ModSuggestion with only what we need.

Test plan:
Confirm that the steps described before work as expected once this patch is applied

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

https://bugs.koha-community.org/show_bug.cgi?id=22907

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21626: (QA follow-up) Remove duplicate roles
Martin Renvoize [Tue, 14 May 2019 14:52:29 +0000]
Bug 21626: (QA follow-up) Remove duplicate roles

The teams file contains all roles so we don't need to also list them in
the contributors file. This patch removes them from contributors.yaml
and relies only on the merging of teams.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21626: (QA follow-up) Embed teams.yaml for debian packages
Martin Renvoize [Tue, 14 May 2019 14:39:01 +0000]
Bug 21626: (QA follow-up) Embed teams.yaml for debian packages

Like history.txt we need to tell some debian/ files to copy
teams.yaml
Also pick it for the `make install` process (Makefile.PL)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21626: (QA follow-up) Don't crash on missing teams file
Martin Renvoize [Tue, 14 May 2019 14:34:44 +0000]
Bug 21626: (QA follow-up) Don't crash on missing teams file

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21626: (follow-up) Template corrections for arrayref
Martin Renvoize [Mon, 13 May 2019 19:53:05 +0000]
Bug 21626: (follow-up) Template corrections for arrayref

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21626: Corrections to typos
Martin Renvoize [Mon, 13 May 2019 19:11:45 +0000]
Bug 21626: Corrections to typos

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21626: Add release dates to team
Martin Renvoize [Fri, 3 May 2019 10:56:48 +0000]
Bug 21626: Add release dates to team

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>

4 years agoBug 21626: (follow-up) Performance Improvement
Martin Renvoize [Fri, 3 May 2019 09:10:04 +0000]
Bug 21626: (follow-up) Performance Improvement

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>

4 years agoBug 21626: (follow-up) Changes based on feedback
Martin Renvoize [Fri, 3 May 2019 05:41:44 +0000]
Bug 21626: (follow-up) Changes based on feedback

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>

4 years agoBug 21626: Use teams.yaml for teams section
Martin Renvoize [Thu, 11 Apr 2019 13:33:30 +0000]
Bug 21626: Use teams.yaml for teams section

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>

4 years agoBug 21626: Add teams.yaml to /docs
Martin Renvoize [Thu, 11 Apr 2019 13:17:54 +0000]
Bug 21626: Add teams.yaml to /docs

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>

4 years agoBug 22928: Add selenium tests
Jonathan Druart [Thu, 16 May 2019 17:22:13 +0000]
Bug 22928: Add selenium tests

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>

4 years agoBug 22928: (bug 20226 follow-up) Fix display of 'Update child to adult' link
Jonathan Druart [Thu, 16 May 2019 14:42:32 +0000]
Bug 22928: (bug 20226 follow-up) Fix display of 'Update child to adult' link

Looks like it is caused by bug 20226, however I am pretty sure it works when I wrote the patch.

[% IF Categories.scalar.all(category_type => 'A').count > 0 %]

is always wrong.

It must be, either:
  [% IF Categories.all(category_type => 'A').size > 0 %]
or
  [% SET adult_categories = Categories.scalar.all(category_type => 'A') %]
  [% IF adult_categories.count > 0 %]

In the first case we are getting an array whereas in the later, a
Koha::Patrons which is preferable.

Test plan (from 20226):
- Remove all your adult categories (categories.category_type='A')
- Create a patron with a child category
- Try to update to adult category
=> The entry does no longer appears! (This is a change in the behaviour)
- Create one adult category
- Update to adult category
=> There is a JS confirmation message, if you accept the patron will
be updated to the adult category
- Create (at least) another adult category
- Create another child
- Update to adult category
=> No more confirmation message but a popup to select the adult category
- Pick one
=> The patron has been updated to the adult category

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>

4 years agoBug 22930: (QA follow-up) Add two test descriptions
Marcel de Rooy [Fri, 17 May 2019 08:35:20 +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>

4 years agoBug 22930: Make TestBuilder->build_object explodes if parameters are wrong
Jonathan Druart [Thu, 16 May 2019 17:56:07 +0000]
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>

4 years agoBug 22657: (QA follow-up) Restore previous version of regex
Owen Leonard [Thu, 9 May 2019 17:52:26 +0000]
Bug 22657: (QA follow-up) Restore previous version of regex

This patch restores the previous version of the regular expression which
parses the OPACSuggestionMandatoryFields system preference value.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22657: Remove JavaScript from OPAC suggestion validation of required fields
Owen Leonard [Wed, 20 Mar 2019 18:58:02 +0000]
Bug 22657: Remove JavaScript from OPAC suggestion validation of required fields

This patch modifies the OPAC suggestion form so that it doesn't require
JavaScript for form validation. This change doesn't alter the behavior
of the form for users but does fit with the general goal of progressive
enhancement for the OPAC.

The patch adds "required" labels to required fields to better identify
required fields.

To test, apply the patch and make sure there are required fields
specified in the OPACSuggestionMandatoryFields system preference.

 - Log in to the OPAC and go to Your purchase suggestions -> New
   purchase suggestion.
 - Verify that the fields specified in OPACSuggestionMandatoryFields are
   highlighted and marked "required."
 - Verify that you can't submit the form without filling out these
   fields.

Signed-off-by: Bin Wen <bin.wen@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 4833: (QA follow-up) Add budgetname to SearchSuggestion
Katrin Fischer [Sat, 11 May 2019 21:01:51 +0000]
Bug 4833: (QA follow-up) Add budgetname to SearchSuggestion

This patch adds the budgetname to the return of SearchSuggestion
to improve performance.

To test:
- Same test plan as for the first patch
- Verify fund names show in the table
- Run t/db_dependent/Suggestions.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 4833: Show acq information when selecting suggestion for order
Katrin Fischer [Mon, 11 Mar 2019 07:47:43 +0000]
Bug 4833: Show acq information when selecting suggestion for order

When adding an order line to a basket using the 'from a suggestion'
feature, the list of accepted suggestions doesn't show any information
from the acquisition are of the suggestions.

This patch adds new columns to the list for:
- library
- fund
- price
- quantity
- total

To test:
- Create several suggestions with
  - Empty acq values
  - A specific library, any library
  - Set acq values (fund, price, quantity)
  - Accept your suggestions
- Create a new basket/order
  - Add an order line from accepted suggestions
  - Verify the list displays nicely with the new columns
  - Verify filters etc. still work ok

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 21651: (QA follow-up) Remove remaining obsolete file from German web installer
Katrin Fischer [Sat, 11 May 2019 12:59:33 +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>

4 years agoBug 21651: Always insert notice templates related tables
Jonathan Druart [Wed, 24 Oct 2018 20:02:39 +0000]
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>

4 years agoBug 21651: Remove language specific sql file for notice templates related tables
Jonathan Druart [Wed, 24 Oct 2018 19:34:46 +0000]
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>

4 years agoBug 22742: ILS-DI - Fix datetime format returned by RenewLoan
Arthur Suzuki [Fri, 19 Apr 2019 09:48:31 +0000]
Bug 22742: ILS-DI - Fix datetime format returned by RenewLoan

Test plan :
Call RenewLoan a few times and check the date returned is correct (minute wise).

Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>

https://bugs.koha-community.org/show_bug.cgi?id=22472

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22889: Fix typos librairies and libaries
Katrin Fischer [Sat, 11 May 2019 21:33:32 +0000]
Bug 22889: Fix typos librairies and libaries

Fixes 2 typos.

Test:
- Review patch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22875: Document verbose option in import_patrons
Colin Campbell [Thu, 9 May 2019 10:32:25 +0000]
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>

4 years agoBug 22892: Remove warning from rebuild_es if --processes not passed
Jonathan Druart [Mon, 13 May 2019 00:46:58 +0000]
Bug 22892: Remove warning from rebuild_es if --processes not passed

Use of uninitialized value $processes in numeric lt (<) at
misc/search_tools/rebuild_elasticsearch.pl line 199.

We want the number of processes to be set to 1 by default, and then
assign it to $slice_count

Test plan:
Run the script with and without --processes and confirm that the warning
went away.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22886: Missing space between fields from Keyword to MARC mapping in cataloguing...
Katrin Fischer [Sat, 11 May 2019 22:34:03 +0000]
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>

4 years agoBug 20514: Use streetnumber when searching for patrons by address
Jonathan Druart [Sat, 11 May 2019 15:23:28 +0000]
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>

4 years agoBug 22781: Correctly filter the emails
Jonathan Druart [Thu, 2 May 2019 01:05:30 +0000]
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>

4 years agoBug 22781: Does not double filter address
Jonathan Druart [Thu, 2 May 2019 00:54:02 +0000]
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>

4 years agoBug 22781: Test patron's info filtering
Jonathan Druart [Thu, 2 May 2019 00:29:05 +0000]
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>

4 years agoBug 22781: Escape cardnumber, category's description, library's name and dateexpiry
Jonathan Druart [Thu, 2 May 2019 00:28:04 +0000]
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>

4 years agoBug 22781: Add tests
Jonathan Druart [Thu, 2 May 2019 00:28:55 +0000]
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>

4 years agoBug 22225: Correctly use invoiceincgst over listincgst
Martin Renvoize [Mon, 11 Feb 2019 14:04:01 +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>

4 years agoBug 22850: Do no longer use set_userenv in tests (SharedContent.t)
Jonathan Druart [Sat, 4 May 2019 16:31:05 +0000]
Bug 22850: Do no longer use set_userenv in tests (SharedContent.t)

Since bug 21817 we should use the mock_userenv subroutine instead.

Test plan:
The tests must pass after 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>

4 years agoBug 22878: Do not pass layout_id on creating a layout
Jonathan Druart [Fri, 10 May 2019 17:27:40 +0000]
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>

4 years agoBug 22878: Add tests
Jonathan Druart [Fri, 10 May 2019 17:27:34 +0000]
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>

4 years agoBug 7862: Preventing warns when creating a notice
Aleisha Amohia [Mon, 29 Apr 2019 03:14:35 +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>

4 years agoBug 22836: (follow-up) improve test message
Nick Clemens [Wed, 15 May 2019 12:10:15 +0000]
Bug 22836: (follow-up) improve test message

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 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]
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>

4 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]
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>

4 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]
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>

4 years agoBug 22891: (bug 21206 follow-up) Fix RenewHold (ILS-DI)
Jonathan Druart [Sun, 12 May 2019 16:51:28 +0000]
Bug 22891: (bug 21206 follow-up) Fix RenewHold (ILS-DI)

From
  commit 31c29fd31f557306233e6a2936148a5bb10b89a1
  Bug 21206: Replace C4::Items::GetItem

A missing 'unless' test made RenewHold return prematurely:
  return $issue;
should have been
  return unless $issue;

Test plan:
Hit /cgi-bin/koha/ilsdi.pl?service=RenewLoan&patron_id=51&item_id=756

With different situations:
1. Item is checked out to the patron
2. Item is not checked out to the patron
3. Item does not exist
4. Patron does not exist

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22891: Add tests
Jonathan Druart [Sun, 12 May 2019 16:48:11 +0000]
Bug 22891: Add tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22812: Use Koha::Subscription in NewSubscription
Jonathan Druart [Fri, 10 May 2019 16:11:14 +0000]
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>

4 years agoBug 22812: Fix GROUP BY in checkrouting
Jonathan Druart [Mon, 6 May 2019 18:50:54 +0000]
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>

4 years agoBug 22812: Add tests for checkrouting
Jonathan Druart [Mon, 6 May 2019 18:50:26 +0000]
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>

4 years agoBug 22812: Fix new subscription with strict sql modes
Jonathan Druart [Mon, 6 May 2019 18:34:19 +0000]
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>

4 years agoBug 22713: Remove unecessary $replacementprice var
Jonathan Druart [Mon, 6 May 2019 16:55:32 +0000]
Bug 22713: Remove unecessary $replacementprice var

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22713: Pass replacement price in to order if defined by MarcItemFieldsToOrder
Nick Clemens [Thu, 25 Apr 2019 16:23:22 +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>

4 years agoBug 11853: Add tests
Jonathan Druart [Wed, 8 May 2019 21:37:40 +0000]
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>

4 years agoBug 11853: Allow to clear the date of birth at the OPAC
Jonathan Druart [Wed, 8 May 2019 21:37:50 +0000]
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>

4 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]
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>

4 years agoBug 22893: Embed contributors.yaml for debian packages
Jonathan Druart [Mon, 13 May 2019 00:26:41 +0000]
Bug 22893: Embed contributors.yaml for debian packages

Like history.txt we need to tell some debian/ files to copy contributors.yaml
Also pick it for the `make install` process (Makefile.PL)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22893: Do not crash if contributors.yaml does not exist
Jonathan Druart [Mon, 13 May 2019 00:22:54 +0000]
Bug 22893: Do not crash if contributors.yaml does not exist

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

4 years agoBug 22899: DBRev 18.12.00.075
Nick Clemens [Tue, 14 May 2019 18:15:54 +0000]
Bug 22899: DBRev 18.12.00.075

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>