]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 26336: Add hint before and remove select after staging with no items
Nick Clemens [Tue, 1 Sep 2020 16:36:43 +0000 (16:36 +0000)]
Bug 26336: Add hint before and remove select after staging with no items

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5cdae4c64b7da609ddeb94d77ffa5bdbb4cb8ca1)

3 years agoBug 26336: Disable 'Item processing' dropdown if no item
Jonathan Druart [Tue, 1 Sep 2020 13:47:27 +0000 (15:47 +0200)]
Bug 26336: Disable 'Item processing' dropdown if no item

If there is no item to process and they have been ignored during the
stage step, we should not let the user modify the dropdown value

Test plan:
0 - Check the count of import_items
    SELECT COUNT(*) FROM import_items;
1 - Import a marc file with items , process the items
2 - Check the count of import items, it has increased
3 - Stage the file again, do not process items
4 - Count of import_items has not increased
5 - Manage the stage batch
Confirm that you cannot modify the "Item processing" value

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cee2e630b4e26ebfaef6cf3f41a79df3cf697b01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26976: Display 0 if renewalsallowed is not defined
Jonathan Druart [Fri, 20 Nov 2020 10:27:45 +0000 (11:27 +0100)]
Bug 26976: Display 0 if renewalsallowed is not defined

If the circulation rule "renewalsallowed" is not set (or an empty
string) then the checkout list displays
(0 of  renewals remaining)
It should display "0 of 0"

Test plan:
Set renewalsallowed to an empty string
Check an item out
Notice the change

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 01a7dc70670801fab021ba7e4f782542c744bbee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27128: (bug 25728 follow-up) Don't prefill av's code
Fridolin Somers [Tue, 1 Dec 2020 15:22:15 +0000 (16:22 +0100)]
Bug 27128: (bug 25728 follow-up) Don't prefill av's code

Bug 25728 patch "Don't prefill av's code" does not work.
Calling empty val() retruns the attribut.
Should be val('').

Test plan :
1) Without patch
2) Edit a record
3) Edit a subfield with AV
4) Enter a new value to create it
5) You see the modal popup, edit and save
6) Enter another new value to create it
7) You see the modal popup => value is prefilled
8) Re-do test plan with patch (+ clear JS cache) => value is empty

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c6263d078e9374b1712d7b2a452a1ccb614deaef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 26665: (bug 20168 follow-up) Fix path to bootstrap js file
Jonathan Druart [Wed, 2 Dec 2020 13:34:18 +0000 (14:34 +0100)]
Bug 26665: (bug 20168 follow-up) Fix path to bootstrap js file

20168 moved it to /opac-tmpl/bootstrap/lib/bootstrap/js/bootstrap.bundle.min.js

It fixed the OAI-PMH view

Test plan:
Hit <OPACBaseURL>/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marc21
and confirm that you can click "Metadata" and it opens

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 61f1f02dd791ee587d545d71e3c08fc5eb35c770)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27003: Item creation log must be done after the item is created
Jonathan Druart [Wed, 2 Dec 2020 08:56:04 +0000 (09:56 +0100)]
Bug 27003: Item creation log must be done after the item is created

Otherwise we don't have its itemnumber yet!

Test plan:
Add and modify an item and confirm that the action logs are created
correctly

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b3b3781ea3745a382cd38e808a2846a6fd933f3c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 27144: Fix syntax error that prevents deleting patrons
Joonas Kylmälä [Thu, 3 Dec 2020 13:23:22 +0000 (15:23 +0200)]
Bug 27144: Fix syntax error that prevents deleting patrons

To test:
 1) In staff interface open up a patron record
 2) Click More -> Delete, and then "Yes, delete"
 3) Notice 500 error
 4) Apply patch
 5) Notice error is now gone when deleting

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 08c34b33e4f9bf8f4f515ca769ed923999d3991f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 23475: Unset the storage if the values do not exist
Nick Clemens [Fri, 20 Nov 2020 19:53:51 +0000 (19:53 +0000)]
Bug 23475: Unset the storage if the values do not exist

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 44be943feda8ffc0425219f11af8bdaa6d358036)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoBug 23475: Use localStorage to preserve simple search values
Nick Clemens [Mon, 19 Aug 2019 19:38:52 +0000 (19:38 +0000)]
Bug 23475: Use localStorage to preserve simple search values

To test:
1 - Enable IntranetCatalogSearchPulldown
2 - Perform a search that brings you to a single title
3 - Note the search is not displayed on the details page
4 - Apply patch
5 - Repeat
6 - Note the search is retained on details page
7 - Try with different dropdown values and search terms
8 - Test search terms including accented characters etc

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Bug 23475: (follow-up) Fix selectors and stray use statements

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 45400055e443b991953e81248424cec0a8663b9a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoCorrect Ubuntu versions in release notes - md
Jonathan Druart [Mon, 30 Nov 2020 10:19:16 +0000 (11:19 +0100)]
Correct Ubuntu versions in release notes - md

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit be9f64b638335cac7465ca302e187c7914534fbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agoCorrect Ubuntu versions in release notes
Jonathan Druart [Mon, 30 Nov 2020 10:14:27 +0000 (11:14 +0100)]
Correct Ubuntu versions in release notes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1e5d4ab20568d96f8dd2c49282d24bad9a36c4d3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
3 years agov20.11.00 v20.11.00
Jonathan Druart [Fri, 27 Nov 2020 16:36:04 +0000 (17:36 +0100)]
v20.11.00

Previous commit was pushed without the tag (git push remote master),
and now git rejects a git push v20.11.00
So, adding another commit with the tag!

3 years agoKoha 20.11.00 is here!
Jonathan Druart [Fri, 27 Nov 2020 12:19:16 +0000 (13:19 +0100)]
Koha 20.11.00 is here!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoAdd release notes for Koha 20.11.00
Jonathan Druart [Fri, 27 Nov 2020 15:41:21 +0000 (16:41 +0100)]
Add release notes for Koha 20.11.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27108: Add 21.05 release team to teams.yaml
Martin Renvoize [Fri, 27 Nov 2020 14:08:24 +0000 (14:08 +0000)]
Bug 27108: Add 21.05 release team to teams.yaml

This patch update the docs/teams.yaml file to add the elected 21.05
release team and update the include to reflect the minor change of
structure.

Test plan.
1/ Apply the patch
2/ Update Koha.pm to state 20.11.00.000
3/ Update preferences to Version to 20.1100000
4/ Navigate to the about page
5/ Note that the 20.11 team is shown on the left and the new 21.05 team
is shown on the right.
6/ Pay particular attention to the 'Packaging manager' on the left and
'Packaging team' on the right. (We have not had a team of packaging
people before, so the template had to be updated to allow for an array
of packaging people).
7/ Signoff.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27108: (QA follow-up) Fix Agustin and Documentation manager

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoAdjust history and contributors list
Jonathan Druart [Fri, 27 Nov 2020 13:21:54 +0000 (14:21 +0100)]
Adjust history and contributors list

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoFix translation issues
Jonathan Druart [Fri, 27 Nov 2020 11:53:17 +0000 (12:53 +0100)]
Fix translation issues

sudo apt-get install translate-toolkit
junitmsgfmt misc/translator/po/*.po

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoTranslation updates for Koha 20.11.00
Koha translators [Fri, 27 Nov 2020 15:09:13 +0000 (12:09 -0300)]
Translation updates for Koha 20.11.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoFix some updatedatabase.pl issues
Jonathan Druart [Fri, 27 Nov 2020 12:15:28 +0000 (13:15 +0100)]
Fix some updatedatabase.pl issues

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Add 'experimental' info to koha-core and koha-full descriptions
Mason James [Fri, 27 Nov 2020 12:16:10 +0000 (01:16 +1300)]
Bug 26672: Add 'experimental' info to koha-core and koha-full descriptions

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27103: Remove from fr-FR
Jonathan Druart [Fri, 27 Nov 2020 11:59:51 +0000 (12:59 +0100)]
Bug 27103: Remove from fr-FR

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27103: Remove HOLD_CANCELLATION notice
Martin Renvoize [Fri, 27 Nov 2020 09:24:46 +0000 (09:24 +0000)]
Bug 27103: Remove HOLD_CANCELLATION notice

We are really close to release, and the 'proper' fix to make the sending
of hold cancellation notices optional will introduce string changes.

This patch takes the alternative approach of removing the default notice
template there by disabling the feature for 20.11.00 release and giving
us time to properly impliment a solution and re-instate the default
notice template for the 20.11.01 release.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27079: Floating point comparison correction
Martin Renvoize [Wed, 25 Nov 2020 12:58:56 +0000 (12:58 +0000)]
Bug 27079: Floating point comparison correction

We cannot compare calculated values directly as those calculations may
have introduced floating point differences.  We have the
Koha::Number::Price->round function to consistently round the floating
point number to a decimal with 2 points precission for comparison.

Test plan
1/ Set a circ rule to have a .15 per day fine and enable finesMode
syspref.
2/ Issue an item of this type to a borrower (making it 12 days overdue
   by setting the due date to 12 days in the past)
3/ Run the fines job:
4/ Pay the fine for the patron
5/ Check in the item
6/ Note that the patron does not have an 'Overpayment refund' of $0.00

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 27079: (QA follow-up) Round both sides for clarity

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27079: Unit tests
Martin Renvoize [Wed, 25 Nov 2020 14:10:34 +0000 (14:10 +0000)]
Bug 27079: Unit tests

Add a unit test to check for floating point errors in UpdateFine
relating to catching matching CalcFine amounts compared to DB amount
values.

Test plan
1/ Run the unit test and confirm it fails
2/ Apply the second patch in the series
3/ Run the unit test and confirm it passes

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25534: Add missing td in tfoot in pendingreserves
Jonathan Druart [Fri, 27 Nov 2020 08:25:56 +0000 (09:25 +0100)]
Bug 25534: Add missing td in tfoot in pendingreserves

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Add deps to koha-core, via debian/rules file
Mason James [Thu, 26 Nov 2020 09:18:46 +0000 (22:18 +1300)]
Bug 26672: Add deps to koha-core, via debian/rules file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Remove unrequired default-mysql-* references
Mason James [Wed, 25 Nov 2020 15:29:44 +0000 (04:29 +1300)]
Bug 26672: Remove unrequired default-mysql-* references

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27092: Remove note about "synced repo" from README.md
Jonathan Druart [Wed, 25 Nov 2020 15:31:58 +0000 (16:31 +0100)]
Bug 27092: Remove note about "synced repo" from README.md

Now it's displayed on our git.k-c.org by gitea.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Add koha-core and koha-full definitions to debian/control files
Mason James [Thu, 15 Oct 2020 01:21:13 +0000 (01:21 +0000)]
Bug 26672: Add koha-core and koha-full definitions to debian/control files

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26672: Add additional koha-core and koha-full files to ./debian
Mason James [Wed, 25 Nov 2020 12:04:27 +0000 (01:04 +1300)]
Bug 26672: Add additional koha-core and koha-full files to ./debian

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: (QA follow-up) Expect warnings, don't supress them
Nick Clemens [Mon, 23 Nov 2020 12:09:47 +0000 (12:09 +0000)]
Bug 26518: (QA follow-up) Expect warnings, don't supress them

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: Move BiblioAutoLink within the transaction
Jonathan Druart [Mon, 12 Oct 2020 13:01:22 +0000 (15:01 +0200)]
Bug 26518: Move BiblioAutoLink within the transaction

We don't want the authorities to be created if the biblio insert fails
later

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: Hide expected DBI warnings
Jonathan Druart [Fri, 9 Oct 2020 10:09:08 +0000 (12:09 +0200)]
Bug 26518: Hide expected DBI warnings

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: Raise exception if the insert failed
Jonathan Druart [Tue, 29 Sep 2020 11:29:49 +0000 (13:29 +0200)]
Bug 26518: Raise exception if the insert failed

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26518: Use Koha::Biblio[item] in AddBiblio
Jonathan Druart [Tue, 29 Sep 2020 11:29:33 +0000 (13:29 +0200)]
Bug 26518: Use Koha::Biblio[item] in AddBiblio

Bug 26518: Does not return from the catch block

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27026: (bug 24159 follow-up) Add a tooltip to explain the values of "Days mode"
Jonathan Druart [Tue, 17 Nov 2020 15:22:59 +0000 (16:22 +0100)]
Bug 27026: (bug 24159 follow-up) Add a tooltip to explain the values of "Days mode"

There was a tooltip for values of the existing rules, but not the only
you were editing.

Now there is the same tooltip (title) on the option elements of the
dropdown list.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 27026: Use meaningful descriptions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25942: Fix batch report operations for cardnumbers and biblionumbers
Nick Clemens [Wed, 18 Nov 2020 13:29:33 +0000 (13:29 +0000)]
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers

This patch moves the processing for these to a block and adds a comment
in place of whitespace and uses template directives to chomp newlines to improve readability

To test:
 1 - Create a report like:
    SELECT biblionumber FROM biblio
 2 - Run it
 3 - Try the various options from the 'Batch operations' button
    (You will need to define a marc modification template)
 4 - The operations don't find the biblios
 5 - Create a report like:
    SELECT cardnumber FROM borrowers
 6 - Run it
 7 - Test the batch operations
 8 - They fail
 9 - Apply patch
10 - Run each report again and test batch operations
11 - They work!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 25942: (follow-up) fix filters

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27070: Add cross_fields type to our searches
Nick Clemens [Fri, 20 Nov 2020 19:11:10 +0000 (19:11 +0000)]
Bug 27070: Add cross_fields type to our searches

This patch adds the 'cross_fields' type to our searches:
https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-query-string-query.html#query-string-syntax

Without this patch the search terms seem to all require being in the same field when using Elasticsearch 6

To test:
0 - Set QueryAutoTruncate to 'only if * is added'
1 - Find a record with a title and publisher
2 - Search for a word form the title and confirm the record is returned
3 - Search for a work from the title and the publisher's name
4 - The record is not returned
5 - Apply patch
6 - Repeat #3
7 - The record is returned

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27082: uncertainprice.pl does not handle pagination
Blou [Tue, 24 Nov 2020 22:03:32 +0000 (17:03 -0500)]
Bug 27082: uncertainprice.pl does not handle pagination

To reproduce:
1- create a basket
2- add more of 20 orders with uncertain price
3- click on uncertain price button
4- on page 1 of list, uncheck uncertain box of an order
5- click on save button
6- orders who were on page 2 are not display anymore in page uncertainprice.pl
7- return to basket view acqui/basket.pl
8- orders who were on page 2 have "rvcd" label and quantity is null

The data in page 2 and beyond is not transmitted, but the code doesn't
handle that.  This patch makes sure that all that (empty) data is not (wrongly) processed.

Sponsored by: CCSR

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26819: (QA follow-up) Fix branchtransfers.tt
Kyle M Hall [Mon, 23 Nov 2020 14:43:58 +0000 (09:43 -0500)]
Bug 26819: (QA follow-up) Fix branchtransfers.tt

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26819: (QA follow-up) authorized_value should be authorised_value
Kyle M Hall [Mon, 23 Nov 2020 14:42:06 +0000 (09:42 -0500)]
Bug 26819: (QA follow-up) authorized_value should be authorised_value

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt
Kyle M Hall [Mon, 2 Nov 2020 15:34:35 +0000 (10:34 -0500)]
Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt

Test Plan:
1) In the staff interface go to course reserves.
2) Add a new course.
3) Add a reserve (Add reserves > add a valid barcode > submit).
4) Go to the list of courses and select the course you added the item to.
5) An error trace log is generated
6) Apply this patch
7) Reload the page
8) No errors!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27072: Don't process staff interface CSS with rtlcss
Owen Leonard [Mon, 23 Nov 2020 14:15:14 +0000 (14:15 +0000)]
Bug 27072: Don't process staff interface CSS with rtlcss

This patch changes Koha's gulpfile to add a check for the "OPAC" context
before using rtlcss to automatically build right-to-left versions of
CSS.

To test, apply the patch and test the process of building CSS for both
the OPAC and staff client:

- "yarn css --view opac" : This should build unminified CSS for the
    OPAC, including map files in bootstrap/css/maps

- "yarn build --view opac" : This should build minified CSS for the
  OPAC and generate the RTL versions.

- "yarn css" : This should build unminified CSS for the staff
  interface, including map files in prog/css/maps.

- "yarn build" : This should build minified CSS for the
   staff interface, with no creation of RTL versions.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27044: Mark the PayPal integration as deprecated on the user interface
Tomas Cohen Arazi [Tue, 17 Nov 2020 17:48:39 +0000 (14:48 -0300)]
Bug 27044: Mark the PayPal integration as deprecated on the user interface

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18267: (QA follow-up) fix typo: overriden => overridden
Victor Grousset/tuxayo [Fri, 20 Nov 2020 15:44:04 +0000 (16:44 +0100)]
Bug 18267: (QA follow-up) fix typo: overriden => overridden

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26922: Regression tests
Tomas Cohen Arazi [Fri, 20 Nov 2020 14:04:04 +0000 (11:04 -0300)]
Bug 26922: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26922: Better error handling in SendAlerts
Tomas Cohen Arazi [Thu, 19 Nov 2020 16:09:47 +0000 (13:09 -0300)]
Bug 26922: Better error handling in SendAlerts

This patch makes SendAlerts display a better error message when sending
fails.

To test:
1. Set KohaAdminEmailAddress to admin@example.org
2. Edit a vendor, set a valid email address
3. Create a new basket, a new order. Send the basket
=> FAIL: As you did not configure a valid SMTP server, the email is not sent and logs displayed "unable to establish SMTP connection to (localhost) port 25", with the stracktrace.
4. Apply this patch and reload all
5. Repeat 3
=> SUCCESS: A simpler message is displayed, the stacktrace remains in
the logs
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26557: (bug 23463 follow-up) Fix Batch import when incoming records contain itemn...
Jonathan Druart [Thu, 19 Nov 2020 14:16:36 +0000 (15:16 +0100)]
Bug 26557: (bug 23463 follow-up) Fix Batch import when incoming records contain itemnumber

Prior to ug 23463 AddItemFromMarc where calling AddItem, that did not
take into account the itemnumber field.
Now that we are using Koha::Item, we need to remove the items.itemnumber
field from the MARC record

Test plan:
1 - find an existing bib in your system with just one item
2 - export that bib with the item attached
3 - delete the barcode from your item in Koha
4 - stage your exported marc file for reimport, match on biblionumber, set it to Always Add Items
5 - confirm that the bib matches and the incoming 952 is parsed
6 - click "Import this batch into the catalog"

=> Without this patch you get (in the logs, or hidden)
manage-marc-import.pl: DBD::mysql::st execute failed: Duplicate entry '23' for key 'PRIMARY' [for Statement "INSERT INTO `items` ( `barcode`, `biblioitemnumber`, `biblionumber`, `ccode`, `cn_sort`, `cn_source`, `damaged_on`, `dateaccessioned`, `datelastborrowed`, `datelastseen`, `holdingbranch`, `homebranch`, `itemcallnumber`, `itemlost_on`, `itemnumber`, `itype`, `location`, `more_subfields_xml`, `onloan`, `permanent_location`, `replacementpricedate`, `timestamp`, `withdrawn_on`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, current_timestamp, ? )" with ParamValues: 0="BC_23", 1=8, 2=8, 3="REF", 4='CN__23', 5=undef, 6=undef, 7="2014-09-04", 8=undef, 9="2014-09-04", 10="FPL", 11="FPL", 12="CN_23", 13=undef, 14="23", 15="BK", 16="GEN", 17=undef, 18=undef, 19="GEN", 20="2014-09-04", 21=undef] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836.
manage-marc-import.pl: DBIx::Class::Storage::DBI::_dbh_execute(): Duplicate entry '23' for key 'PRIMARY' at /kohadevbox/koha/Koha/Object.pm line 169
manage-marc-import.pl: {UNKNOWN}: Transaction aborted: Duplicate ID. Rollback failed: DBIx::Class::Storage::txn_rollback(): Refusing to roll back without a started transaction at /kohadevbox/koha/tools/manage-marc-import.pl line 253 at /kohadevbox/koha/tools/manage-marc-import.pl line 253

=> With this patch applied, the new item must be added to the existing bibliographic record

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25548: (follow-up) Remove those rewrite redirects in koha-httpd.conf
Fridolin Somers [Wed, 30 Sep 2020 12:54:57 +0000 (14:54 +0200)]
Bug 25548: (follow-up) Remove those rewrite redirects in koha-httpd.conf

In etc/koha-httpd.conf for dev install, those rewrite redirects are already commented.
Just remove them.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25548: Remove Apache rewrite directives that trigger redirects
David Cook [Wed, 20 May 2020 05:08:05 +0000 (15:08 +1000)]
Bug 25548: Remove Apache rewrite directives that trigger redirects

Historically, we have used Apache rewrite directives to strip
query parameters with no arguments from the query
string (e.g. PARAM=&), and then redirect to the new URL.

However, this slows down user activity, and depending on your
HTTPS and proxy setup can cause suboptimal HTTP downgrades and
upgrades.

Test Plan:
0) Apply patch
1) Build Debian package
2) Install Debian package and reload Apache
3) Open developer tools on your favourite browser
4) Go to Network tab in developer tools
5) Go to /cgi-bin/koha/opac-main.pl
6) Search for "test"
7) Note a 200 status for "opac-search.pl?idx=&q=test"

If you got a 302 status for "opac-search.pl?idx=&q=test"
followed by a 200 status for "opac-search.pl?q=test", you
will know that your Apache configuration wasn't updated.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 7607: (follow-up) Address OPAC and limits
Nick Clemens [Wed, 18 Nov 2020 13:15:04 +0000 (13:15 +0000)]
Bug 7607: (follow-up) Address OPAC and limits

This patch adds the same function to the OPAC and adds support for limits

I adjust the class on staff side to match the one already existing on OPAC

On the OPAC when you click the back button the fields are not enabled - on the staff side they are,
I leave this problem for someone else to solve

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 7607: (follow-up) Disable rather than remove inputs
Nick Clemens [Thu, 5 Nov 2020 19:00:32 +0000 (19:00 +0000)]
Bug 7607: (follow-up) Disable rather than remove inputs

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 7607: Remove empty inputs when submitting search form
Nick Clemens [Tue, 3 Nov 2020 11:19:23 +0000 (11:19 +0000)]
Bug 7607: Remove empty inputs when submitting search form

This patch surrounds the operator, index, and query fields on the advanced search
page wtih a 'search_set' class.

This allows us to process them as a group and confirm the query is populated before submitting
the other parts to the form

TO test:
1 - Go to advanced search
2 - Use search boxes to search like:
    Title: (leave blank)
    Author: clinton
    keyword: shuffle
3 - Perform search
4 - Note no results as you searched for title:clinton etc.
5 - apply patch
6 - refresh and repeat
7 - search is now correct
8 - Try vaeious searches with 'more options' and selecting different operators

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25514: Try to fix random failure from REST/Plugin/Objects.t
Jonathan Druart [Tue, 10 Nov 2020 10:56:31 +0000 (11:56 +0100)]
Bug 25514: Try to fix random failure from REST/Plugin/Objects.t

It's causing a "Premature connection close" error

https://docs.mojolicious.org/Mojolicious/Guides/FAQ#What-does-Premature-connection-close-mean

This is just a guess but maybe it would help to have the Test::Mojo
object initiated just before the get?

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27062: Fix pickup_location tests when existing libraries exist
Jonathan Druart [Fri, 20 Nov 2020 09:31:33 +0000 (10:31 +0100)]
Bug 27062: Fix pickup_location tests when existing libraries exist

If there are existing libraries in the DB, the tests will fail.

There were several changes related to those tests recently, this bug report is a follow-up for them.

bug 26984, bug 27002 and bug 26963.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27007: Don't call GetMarcSubfieldStructure with unsafe in tests
Jonathan Druart [Fri, 13 Nov 2020 08:32:50 +0000 (09:32 +0100)]
Bug 27007: Don't call GetMarcSubfieldStructure with unsafe in tests

It does not feel correct to call GetMarcSubfieldStructure with the unsafe flag set in tests:
   my $mss = C4::Biblio::GetMarcSubfieldStructure( '', { unsafe => 1 } );

Some tests are failing is run twice

Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314.
[x~10]
Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314.

    #   Failed test 'Value is mapped correctly for column biblionumber'
    #   at t/db_dependent/Koha/Item.t line 115.
    #          got: undef
    #     expected: '483'
[etc.]

Test plan:
Run the tests twice, without the patch it fails, with the patch it
passes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22343: (follow-up) Correctly handle password on editing
Jonathan Druart [Thu, 19 Nov 2020 16:15:32 +0000 (17:15 +0100)]
Bug 22343: (follow-up) Correctly handle password on editing

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26938: Compiled CSS
Jonathan Druart [Thu, 19 Nov 2020 16:25:14 +0000 (17:25 +0100)]
Bug 26938: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26984: (follow-up) Don't delete patrons and checkouts in Objects.t
Nick Clemens [Tue, 17 Nov 2020 12:11:21 +0000 (12:11 +0000)]
Bug 26984: (follow-up) Don't delete patrons and checkouts in Objects.t

Rather than counting all and assuriing we get 10, we can count all, add 10, and ensure the numbers still match

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26984: Make tests pass if AnonymousPatron is set
Jonathan Druart [Thu, 12 Nov 2020 12:11:13 +0000 (13:11 +0100)]
Bug 26984: Make tests pass if AnonymousPatron is set

There is only 1 place where it can be tricky to not remove them as we
want exactly 10 patrons to be present in the DB

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26992: Fix serial issue and related items deletion on serial collection page
Frédéric Demians [Tue, 10 Nov 2020 16:00:09 +0000 (17:00 +0100)]
Bug 26992: Fix serial issue and related items deletion on serial collection page

serial-collection.pl uses C4::Items::DelItemCheck() function which is obsolete.

Test plan:

1. Create a subscription with items created when receiving.
2. Receive several issues, and create corresponding items.
3. On Serial collection page (serial-collection.pl), select several issues.
4. Click on button Delete selected issues
5. A confirmation page is displayed. Enable "Delete associated items?".
   Then click on "Yes, delete" button.

   You get this error: Undefined subroutine &C4::Items::DelItemCheck

6. Apply the patch an repeat steps 3-5.
   Check that issues and related items are deleted.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26854: Remove log of STDERR
Jonathan Druart [Thu, 19 Nov 2020 10:13:34 +0000 (11:13 +0100)]
Bug 26854: Remove log of STDERR

See discussion on comments 12-20

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26854: Close STDERR when forking stage-marc-import.pl
David Cook [Thu, 29 Oct 2020 04:24:31 +0000 (04:24 +0000)]
Bug 26854: Close STDERR when forking stage-marc-import.pl

We need to close STDERR when forking stage-marc-import.pl,
or else the CGI session with Apache httpd does not properly
finish. This leads to unexpected behaviour across different httpd
versions, operating systems, etc.

This patch closes the STDERR file handle when forking a child
process to do MARC imports, and it re-opens STDERR to a log file
in the logdir directory to catch any import errors.

Test plan:
1. Apply the patch
2. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
3. Upload a MARC file with a large number of records (e.g. 30,000 records)
4. Open F12 dev tools
5. Click on "Network" tab
6. Clear all existing network logs
7. Click "Stage for import"
8. After ~30 seconds, the request to stage-marc-import.pl should return a 200 code
9. Immediately, calls to background-job-progress.pl should start, and the "Job progress"
bar should update at a maximum rate of every .5 seconds
(or more realistically 1-2 seconds)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26031: Remove the failing tests and the diag
Jonathan Druart [Thu, 19 Nov 2020 13:24:59 +0000 (14:24 +0100)]
Bug 26031: Remove the failing tests and the diag

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26031: Remove 4 failing tests from t/db_dependent/www/search_utf8.t
Mason James [Thu, 19 Nov 2020 13:10:28 +0000 (02:10 +1300)]
Bug 26031: Remove 4 failing tests from t/db_dependent/www/search_utf8.t

to test...
1/ apply patch
2/ run test
3/ observe PASS

root@kohadevbox:/kohadevbox/koha# export KOHA_INTRANET_URL="http://kohadev-intra.myDNSname.org:8081"
root@kohadevbox:/kohadevbox/koha# export KOHA_OPAC_URL="http://kohadev.myDNSname.org:8080"
root@kohadevbox:/kohadevbox/koha# prove -v  ./t/db_dependent/www/search_utf8.t
1..87
ok 1 - connect to intranet
ok 2 - login to staff interface
ok 3 - load main page
ok 4 - open tools module
ok 5 - go to stage MARC
ok 6 - uploaded file
ok 7 - upload succeeded
ok 8 - reopen stage MARC page
ok 9 - stage MARC
ok 10 - have job ID
ok 11 - job was completed
ok 12 - reopen stage MARC page at end of upload
ok 13 - stage MARC
ok 14 - view batch
ok 15 - imported records into catalog
ok 16 - got search on intranet
ok 17 - got search on intranet
ok 18 - Base is like "(?^u:search.pl\?advsearch=1&idx=kw&q=%CE%91%CE%B8%CE%AE%CE%BD%CE%B1)"
ok 19 - UTF-8 are multi-byte. Good
ok 20 - UTF-8 chars are correctly present. Good
ok 21 - got opac
ok 22 - got opac
ok 23 - Base is like "(?^u:opac-search.pl\?(idx=&)?q=%CE%91%CE%B8%CE%AE%CE%BD%CE%B1)"
ok 24 - Base does not contain an idx
ok 25 - UTF-8 are multi-byte. Good
ok 26 - UTF-8 chars are correctly present. Good
ok 27 - view and clean batch
ok 28 - biblio on intranet
ok 29 - biblio deleted
ok 30 - connect to intranet
ok 31 - login to staff interface
ok 32 - load main page
ok 33 - open tools module
ok 34 - go to stage MARC
ok 35 - uploaded file
ok 36 - upload succeeded
ok 37 - reopen stage MARC page
ok 38 - stage MARC
ok 39 - have job ID
ok 40 - job was completed
ok 41 - reopen stage MARC page at end of upload
ok 42 - stage MARC
ok 43 - view batch
ok 44 - imported records into catalog
ok 45 - got search on intranet
ok 46 - got search on intranet
ok 47 - Base is like "(?^u:search.pl\?advsearch=1&idx=kw&q=Ram%C3%B2n)"
ok 48 - UTF-8 are multi-byte. Good
ok 49 - UTF-8 chars are correctly present. Good
ok 50 - got opac
ok 51 - got opac
ok 52 - Base is like "(?^u:opac-search.pl\?(idx=&)?q=Ram%C3%B2n)"
ok 53 - Base does not contain an idx
ok 54 - UTF-8 are multi-byte. Good
ok 55 - UTF-8 chars are correctly present. Good
ok 56 - view and clean batch
ok 57 - biblio on intranet
ok 58 - biblio deleted
ok 59 - connect to intranet
ok 60 - login to staff interface
ok 61 - load main page
ok 62 - open tools module
ok 63 - go to stage MARC
ok 64 - uploaded file
ok 65 - upload succeeded
ok 66 - reopen stage MARC page
ok 67 - stage MARC
ok 68 - have job ID
ok 69 - job was completed
ok 70 - reopen stage MARC page at end of upload
ok 71 - stage MARC
ok 72 - view batch
ok 73 - imported records into catalog
ok 74 - got search on intranet
ok 75 - got search on intranet
ok 76 - Base is like "(?^u:search.pl\?advsearch=1&idx=kw&q=%F0%A0%BB%BAtomasito%F0%A0%BB%BA)"
ok 77 - UTF-8 are multi-byte. Good
ok 78 - UTF-8 chars are correctly present. Good
ok 79 - got opac
ok 80 - got opac
ok 81 - Base is like "(?^u:opac-search.pl\?(idx=&)?q=%F0%A0%BB%BAtomasito%F0%A0%BB%BA)"
ok 82 - Base does not contain an idx
ok 83 - UTF-8 are multi-byte. Good
ok 84 - UTF-8 chars are correctly present. Good
ok 85 - view and clean batch
ok 86 - biblio on intranet
ok 87 - biblio deleted
ok
All tests successful.
Files=1, Tests=87, 127 wallclock secs ( 0.06 usr  0.02 sys +  3.00 cusr  0.99 csys =  4.07 CPU)
Result: PASS

real    2m6.709s
user    0m3.124s
sys     0m1.032s

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24083: (follow-up) Assign renewals remaining string to content
Nick Clemens [Thu, 19 Nov 2020 13:58:07 +0000 (13:58 +0000)]
Bug 24083: (follow-up) Assign renewals remaining string to content

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26939: Add missing filters
Jonathan Druart [Wed, 18 Nov 2020 14:09:14 +0000 (15:09 +0100)]
Bug 26939: Add missing filters

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25313: (QA follow-up) DelAuthority tests
Tomas Cohen Arazi [Tue, 11 Aug 2020 12:32:10 +0000 (09:32 -0300)]
Bug 25313: (QA follow-up) DelAuthority tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25313: Add skip_merge to ModAuthority
Marcel de Rooy [Wed, 29 Apr 2020 14:19:00 +0000 (16:19 +0200)]
Bug 25313: Add skip_merge to ModAuthority

Sometimes you know that the merge is useless, since the reporting
tag did not change.
Might be handy in batch processing of authority records.

Test plan:
Pick an authority with a few linked biblio recs (so that it will
immediately merge; lower than MergeLimit).
Open authority record and save it.
Verify that a linked biblio record was merged. Check time in 005.
You proved that this patch does not break the regular process.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25313: Regression tests
Tomas Cohen Arazi [Tue, 11 Aug 2020 12:26:50 +0000 (09:26 -0300)]
Bug 25313: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26337: Pass skip_merge to DelAuthority when removing unsused authorities
Nick Clemens [Tue, 1 Sep 2020 13:32:46 +0000 (13:32 +0000)]
Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities

This script checks that an authority is not being used before deleting it.
We do not need to check biblios for the authority id as we have already verified it is unused.

TO test:
 1 - Reset db to koha test database
 2 - perl misc/migration_tools/remove_unused_authorities.pl -t
 3 - Note a number of unsued authorities
 4 - perl misc/migration_tools/remove_unused_authorities.pl -c
 5 - Note authorities are removed
 6 - Reset db
 7 - Apply patch
 8 - perl misc/migration_tools/remove_unused_authorities.pl -t
 9 - Note results are the same
10 - perl misc/migration_tools/remove_unused_authorities.pl -c
11 - Note results are the same

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26944: Point help link to automatic item mod in manual
Andrew Fuerste-Henry [Thu, 5 Nov 2020 20:28:11 +0000 (20:28 +0000)]
Bug 26944: Point help link to automatic item mod in manual

To test:
1 - go to automatic item mod, click help, end up at manual homepage
2 - apply patch, restart, reload page
3 - click link again, go to auto item mod in manual

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26846: Fix regressions - Preselect expected and late serials
Jonathan Druart [Tue, 10 Nov 2020 11:32:04 +0000 (12:32 +0100)]
Bug 26846: Fix regressions - Preselect expected and late serials

This is a follow-up for bug 17674. Expected and late serials must be
checked by default.

Test plan:
Have some serial collection and notice that the checkboxes are checked
for expected and late serials
/serials/serials-collection.pl?subscriptionid=42

Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26939: Use AV description in sales table display
Martin Renvoize [Tue, 3 Nov 2020 09:57:32 +0000 (09:57 +0000)]
Bug 26939: Use AV description in sales table display

Content should use the description rather than the code

Test plan
1/ Enable 'UseCashRegisters'
2/ Make some payments against a cash register
3/ Navigate to the cash register summary page via tools > cashup
registers > register name
4/ Note that the payment type you selected at payment time appears as
the code of the authorized value as aposed to the description.
5/ Apply patch
6/ Refresh page
7/ The payment type should now contain the description

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26938: Prevent flash of unstyled sales table
Martin Renvoize [Tue, 3 Nov 2020 09:47:12 +0000 (09:47 +0000)]
Bug 26938: Prevent flash of unstyled sales table

On the registers page the table has come complex data structures
embedded to allow for all the functionality we bring into the datatable.

We should hide the table on page load and only display it at DataTables
init time once the weird content has been beautified by DataTables.

Test plan
1/ Enable 'UseCashRegisters' and 'EnablePointOfSale'
2/ Add a cash register and make some transactions against it.
3/ Navigate to the 'Register details' page
4/ Note that some 'funky' JSON strings appear in the table briefly
before it is restyled when DataTables loads.
5/ Apply the patch
6/ Rebuild the CSS from the SCSS files
7/ Reload the page (hard reload to get the CSS changes)
8/ Note that the table now only appears once the nice formatting that
DataTables adds is applied.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26986: Prevent Selenium's StaleElementReferenceException
Jonathan Druart [Tue, 10 Nov 2020 10:37:55 +0000 (11:37 +0100)]
Bug 26986: Prevent Selenium's StaleElementReferenceException

This is a follow-up bug for bug 26162

By finding the element before the click I hope to get the good element,
even if the page changed in the meanwhile.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration
Jonathan Druart [Tue, 10 Nov 2020 11:55:17 +0000 (12:55 +0100)]
Bug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration

The assumption on bug 26119 was wrong. We actually store patron's
attributes during self-registration if
PatronSelfRegistrationVerifyByEmail is not enabled.

Test plan:
Test the different combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
Confirm that the patron's attributes appears during self-registration if
PatronSelfRegistrationVerifyByEmail is not set.
Confirm that the patron's attributes are stored when they are displayed
on the self-registration form
Confirm that you can edit the patron's attributes in any cases (if they
are marked as editable at the OPAC)

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26903: Pass record ids and records through to update_index when passed to index_r...
Nick Clemens [Fri, 13 Nov 2020 16:33:40 +0000 (16:33 +0000)]
Bug 26903: Pass record ids and records through to update_index when passed to index_records

When both a record and record_id are passed to index_records the data should be passed through
to update_index. We missed copying over the record ids to the variable we use as a check.

To test:
1 - Set searchEngine system preference to Elasticsearch
2 - Reindex your db
3 - Search authorities
4 - Edit a record and add 'testwaffle' to the main heading
5 - Search authorities for 'testwaffle' - no results
6 - Apply patch
7 - Edit the record again, change 'testwaffle' to 'testpancake'
8 - Search authorities for 'testpancake' - result!
9 - Confirm imported authorities and authorities added via Z39 are correctly indexed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26903: Unit tests
Nick Clemens [Fri, 13 Nov 2020 16:33:12 +0000 (16:33 +0000)]
Bug 26903: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: (QA follow-up) Unit tests
Tomas Cohen Arazi [Mon, 16 Nov 2020 15:54:13 +0000 (12:54 -0300)]
Bug 26988: (QA follow-up) Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27002: Update callers for changed return
Martin Renvoize [Fri, 13 Nov 2020 13:53:15 +0000 (13:53 +0000)]
Bug 27002: Update callers for changed return

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27002: Update Koha::Biblio->pickup_locations to return a resultset
Martin Renvoize [Thu, 12 Nov 2020 08:09:56 +0000 (08:09 +0000)]
Bug 27002: Update Koha::Biblio->pickup_locations to return a resultset

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26516: Don't accept incorrect values for copyrightdate/publicationyear
Nick Clemens [Wed, 23 Sep 2020 14:42:40 +0000 (14:42 +0000)]
Bug 26516: Don't accept incorrect values for copyrightdate/publicationyear

The previous patch rejects incorrect values when saving to the db specifically for copyrightdate
An error is thrown for the int conversion when it fails

Rather than catching things when saving we can fix the value when generated, simply returning null when parsing
the record

To test:
1 - Add a new record to Koha making sure data is valid except 260$c:
    198-
2 - Save the record
3 - It fails
4 - Apply this patch
5 - Restart all the thigns
6 - Repeat
7 - Success!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27021: Make chaining ->empty always return an empty resultset
Tomas Cohen Arazi [Fri, 13 Nov 2020 18:54:32 +0000 (15:54 -0300)]
Bug 27021: Make chaining ->empty always return an empty resultset

This patch borrows the implementation Martin did on bug 27002, to
woraround this issue, and implements it properly on the
Koha::Objects->empty method.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Objects.t
=> FAIL: Tests fail! The resultset should be empty and it isn't!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27021: Regression tests
Tomas Cohen Arazi [Fri, 13 Nov 2020 18:47:39 +0000 (15:47 -0300)]
Bug 27021: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18267: Refactored Edifact Price Calculations
Colin Campbell [Thu, 12 Nov 2020 11:42:05 +0000 (11:42 +0000)]
Bug 18267: Refactored Edifact Price Calculations

Refactored the price calculations for Quotes and Invoices
This takes in to account various combinations used by different
vendors. Makes the extraction of basic price, quantity and tax
information more reliable. Tests are in Edifact.t and EdiInvoice.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25761: (QA follow-up) Consistent flag names
Martin Renvoize [Fri, 13 Nov 2020 12:12:20 +0000 (12:12 +0000)]
Bug 25761: (QA follow-up) Consistent flag names

This follow-up updates the config flag to be consistent with bug 24449
and updates the debian template file to match too.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25761: Implementation of too_many_overdue has unintended consequences
Kyle M Hall [Mon, 15 Jun 2020 16:26:14 +0000 (12:26 -0400)]
Bug 25761: Implementation of too_many_overdue has unintended consequences

Bug 24449 implemented the too_many_overdue SIP flag ( position 6 of the
patron status flags ). This has had unintended consequences as
many library use SIP2 for validation to eresource vendors ( Overdrive,
Hoopla, etc ), but do not want overdue checkouts to block the
use of these resources.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Find a patron with overdue items
4) Run a SIP2 patron information request
5) Note the "too many overdue" flag is set
6) Set the new SIP config option "disable_too_many_overdue" for the
account you used for testing
7) Restart the SIP server
8) Run the same patron information request
9) Notice the "too many overdue" flag is no longer set!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27012: Fix incorrect SQL syntax in hold merging
Joonas Kylmälä [Fri, 13 Nov 2020 10:07:22 +0000 (12:07 +0200)]
Bug 27012: Fix incorrect SQL syntax in hold merging

If you merge two records with holds in them following error happens
without this patch:

[WARN] DBD::mysql::st execute failed: called with 4 bind variables when 3 are needed [for Statement "SELECT * FROM reserves WHERE biblionumber = ? AND (found <> ? AND found <> ? OR found is NULL) ORDER BY reservedate ASC" with ParamValues: 0=Null!, 1=Null!, 2=Null!] at /kohadevbox/koha/C4/Reserves.pm line 2002.

To test:
   1) Notice prove t/db_dependent/Reserves.t fails with above error
   2) Apply patch
   3) Notice prove t/db_dependent/Reserves.t passes

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27012: Add test for C4::Reserves::MergeHolds
Joonas Kylmälä [Fri, 13 Nov 2020 11:41:16 +0000 (13:41 +0200)]
Bug 27012: Add test for C4::Reserves::MergeHolds

This does a basic check whether a hold gets moved to another biblio
when MergeHolds() is called.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: Adjust for bug 26963
Nick Clemens [Fri, 13 Nov 2020 13:15:29 +0000 (13:15 +0000)]
Bug 26988: Adjust for bug 26963

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: No need to check if hold is linked to a patron
Jonathan Druart [Fri, 13 Nov 2020 10:07:53 +0000 (11:07 +0100)]
Bug 26988: No need to check if hold is linked to a patron

Holds are deleted along with patrons.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: (follow-up) Change event to focus
Agustin Moyano [Wed, 11 Nov 2020 15:22:20 +0000 (12:22 -0300)]
Bug 26988: (follow-up) Change event to focus

Click event on select element if Firefox does not work as expected, so
this patch changes the event to focus for it to work seamlessly in both
browsers.

https://bugs.koha-community.org/show_bug.cgi?id=26899
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: (follow-up) Fix filter and encode api values and escape rendered values
Nick Clemens [Wed, 11 Nov 2020 03:11:56 +0000 (03:11 +0000)]
Bug 26988: (follow-up) Fix filter and encode api values and escape rendered values

This patch makes the QA tools happy and follows correct procedures for passing data to
and rendering data from the api

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: (follow-up) Adjust code to use api field names
Nick Clemens [Wed, 11 Nov 2020 02:53:46 +0000 (02:53 +0000)]
Bug 26988: (follow-up) Adjust code to use api field names

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: (QA follow-up) Make the API return proper library objects
Tomas Cohen Arazi [Tue, 10 Nov 2020 20:38:26 +0000 (17:38 -0300)]
Bug 26988: (QA follow-up) Make the API return proper library objects

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: Make ->patron prefetchable
Tomas Cohen Arazi [Tue, 10 Nov 2020 20:37:21 +0000 (17:37 -0300)]
Bug 26988: Make ->patron prefetchable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26988: Add API route to fetch hold pickup locations and use it in the holds table
Nick Clemens [Tue, 10 Nov 2020 13:35:14 +0000 (13:35 +0000)]
Bug 26988: Add API route to fetch hold pickup locations and use it in the holds table

To test:
1 - Place a number of holds on a record
2 - Have different pickup locations for the holds
3 - Have some libraries that are not pickup locations
4 - Load the holds tab for the record and note libraries not pickup locations are not in dropdowns
5 - Apply patch and restart all things
6 - Reload the holds table
7 - Click on a dropdown, note the spinner, should load successfully
8 - Confirm the dropdown matches the options before the patch
9 - Confirm updating the hold location works

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: Ignore existing libraries
Jonathan Druart [Fri, 13 Nov 2020 08:23:51 +0000 (09:23 +0100)]
Bug 26963: Ignore existing libraries

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26963: (QA follow-up) Fix up tests and cover case of undefined ccode
Nick Clemens [Wed, 11 Nov 2020 13:26:58 +0000 (13:26 +0000)]
Bug 26963: (QA follow-up) Fix up tests and cover case of undefined ccode

While this technically shouldn't happen, if a library creates itemtype limits, then flips the pref, those rules are still in the db until a ccode rule is saved.

To be extra safe, when checking for rules of one type, we should make sure the other type is undef - i.e. if looking for ccode rules, we should confirm the itype is undef for those rules

Additionally, we shouldn't set the barcode now that we are not deleting all items, so we use copynumber for our item identification field as it doesn't need to be unique in the DB

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>