Commit Graph

37551 Commits

Author SHA1 Message Date
Victor Grousset/tuxayo 3fe4e8ee91 Fix translations for Koha 19.11.14
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-23 01:21:02 +01:00
Koha translators 3956039baf Translation updates for Koha 19.11.14
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-23 01:20:46 +01:00
Jonathan Druart e8ea682d49 Bug 27196: [20.05.x] Don't explode if item that is waiting if checked in by SIP
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: David Cook <dcook@prosentient.com.au>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 5f1bcdf49a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-23 01:19:42 +01:00
Christophe Croullebois 20f5c6dfff Bug 27090: Opac basket: fix the 'In transit from' and 'to'
To see the 'In  transit from' and 'to' fields in an Opac basket we have :

<span class="item-status intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %]
    to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span>

But in koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc we have no :

[% USE Branches %]

This patch just corrects this lack

Test plan:
1° find an item in a transit status or create one with this status
2° put it in an Opac basket
3° note that in the location column of the Opac basket the 'In transit from' and 'to' fields are empty.
4° apply the patch
5° check again and validate that the 2 fields are now filled

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 7be57c6608)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b9750c8f9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 0c9ce94c25)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-22 02:40:33 +01:00
Jonathan Druart b05239fceb Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl
To prevent
DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1588, <GEN45> line 1.

Test plan:
1 - Export more than 100 records
2 - Use bulkmarcimport (with -commit=10) to import them
    perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10
3 - Modify a record to make the import fail (for instance having a too long
lccn)
4 - Use bulkmarcimport (with -commit=10) to import them
    perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10
5 - Notice that the import stops but that the imported record are imported (apart from the last batch of 10)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4a90c0b647)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f0dadd169b)
(cherry picked from commit d26a4df948)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-22 02:00:12 +01:00
Aleisha Amohia 7a9b5605db Bug 27137: Correctly show biblio title after successfully moving item
In Bug 11529 we changed the variable that was passed to the template but
missed updating the template.

This patch ensures we correctly access the variable to show the title of
the biblio.

To test:
1) Create two biblios (Biblio A and Biblio B)
2) Add an item to Biblio A (Item A)
3) Go to Biblio B
4) In the cataloguing toolbar, click Edit, then Attach item
5) Enter the barcode for Item A and submit
6) Notice the item has successfully moved by Biblio B's title does not
show
7) Apply patch
8) Go to Biblio A
9) In the cataloguing toolbar, click Edit, then Attach item
10) Enter the barcode for Item A and submit
11) Confirm Biblio A's title shows correctly

Sponsored-by: Toi Ohomai Institute of Technology

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4817f8ee4f)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-22 00:13:27 +01:00
Jonathan Druart fdc4853201 Bug 25826: fix failing test
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 5cef1d0cd8)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-21 21:35:24 +01:00
Nick Clemens 2630716057 Bug 25826: (QA follow-up) Add filters
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit e50c54d812)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-21 21:35:23 +01:00
Tomas Cohen Arazi f3fb1f2369 Bug 25826: Forbid changing the hidden attributes for biblionumber
This patch tweaks the UI so it forbids changing the hidden values when
they are correct (i.e. when they are not hidden in OPAC and intranet).

To test:
1. Apply the first patch
2. Play with the hidden values of the subfield you have mapped to
   biblio.biblionumber in your picked framework. This is usually 999$c
   in MARC21, and 001 in UNIMARC.
=> SUCCESS: When you verify the about.pl, it mentions issues when you
hide in some of the interfaces
3. Apply this patch and reload everything
4. Repeat 2
=> SUCCESS: If your framework is 'ok', it prevents you from editing this
values, otherwise you can change them.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 155b2f65e0)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-21 21:35:23 +01:00
Jonathan Druart 7de1a7ba75 Bug 25826: Add a warning to the about page
This patch adds a warning to the about page if the biblionumber field is
hidden at the OPAC or staff interface.

Test plan:
Hide the biblionumber to some framework
Confirm that there is a warning on the about page

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 6b8748248b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-21 21:35:20 +01:00
Timothy Alexis Vass 4da2c1985b Bug 27085: Corrections in overdue_notices.pl help text
-library      <branchname>     only deal with overdues from this library (repeatable : several libraries can be given)
Should be <branchcode>

Help text should also be proper sentences.

To test:
0) Run misc/cronjobs/overdue_notices.pl -h
1) Check that the text is now:
   -library      <branchcode>     Only deal with overdues from this library.
2) Check that the rest of the help text are proper sentences,
   with leading capital letter and punctuation.
3) Sign off.

Sponsored-by: Lunds Universitetsbibliotek
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1ad7d034e6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 00cf5afd52)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 49246b7a20)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-21 20:51:53 +01:00
Fridolin Somers 890e93b57d Bug 27043: Add to number_of_replicas and number_of_shards to index config
With Elasticsearch 6 (>6.4), we have a warning on index creation :
  the default number of shards will change from [5] to [1] in 7.0.0

See https://github.com/elastic/elasticsearch/pull/30587

I propose to add number_of_shards in index config.

Also add number_of_replicas that is better explicit.
In case on only one node, it must be 0.

Test plan :
1) Use Elasticsearch
2) Apply patch and flush memcached
3) Rebuild indexes : misc/search_tools/rebuild_elasticsearch.pl -v -b -d
4) Check you dont have a warning about number of shards
5) Check the settings of index :
   curl '<cluster>:9200/<myindex>_biblios/_settings?pretty&filter_path=**.number_of_*'
6) You should see :
   "number_of_shards" : "5",
   "number_of_replicas" : "1"

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 3dc90c66c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 31b3763546)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit ce3d0ff93e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-18 19:31:22 +01:00
Andrew Fuerste-Henry a4d35d3de8 Bug 27252: DBRev 19.11.13.001
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit f40b7c2b6c)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-17 21:50:49 +01:00
Nick Clemens a4f7bbfd1c Bug 27252: Default to cross fields off
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit bef49a4449)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-17 20:46:17 +01:00
Nick Clemens 6697d937c7 Bug 27252: Add deprecation warning, cross_fields pref, and add version to ES info
This patch prepares Koha to officially no longer support Elasticsearch 5.X

It adds a new system preference 'ElasticsearchCrossFields' to allow users to choose whether or not
to enable this feature

It updates the about page to add a deprecation warning if a site is running ES5

To test:
 1 - Be running Koha with Elasticsearch 5.X
 2 - Attempt to search
   Error: Unable to perform your search. Please try again.
 3 - Apply patch
 4 - Update database
 5 - Searching works
 6 - Find syspref 'ElasticsearchCrossFields'
 7 - Enable it
 8 - Searching is now broken
 9 - Check the about page
 10 - you can now see the Elasticsearch version
 11 - The systeminformation tab has a deprectaion warning
 12 - Set SearchEngine preference to 'Zebra'
 13 - View the about page - no warnings
 14 - Test again with ES6 - searching should "work" with either pref setting
 15 - There should be no warning on about pages

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

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 01f79488a6)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-17 20:45:10 +01:00
Nick Clemens e9558026b3 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>
(cherry picked from commit 03f15d13c5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4c4d8fbdfd)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-17 20:37:28 +01:00
Jonathan Druart 29d4cfbdb8 Bug 27004: Prevent claim resolution to fail
If the account of the patron who created a claim is removed, then the
claim won't be resolvable.
Trying to resolve the claim will result in a 500:
[2020/12/21 10:05:55] [ERROR] PUT /api/v1/return_claims/1/resolve: unhandled exception (Koha::Exceptions::Checkouts::ReturnClaims::NoCreatedBy)<<[created_by is mandatory]>> Koha::REST::Plugin::Exceptions::__ANON

We should not check if created_by exist when we update an existing hold,
only when we create it.

Test plan:
- Login with patron A
- set a value to syspref ClaimReturnedLostValue
- Check an item out
- Claim returned it
- Login with patron B
- Delete patron A
- Resolve the claim
- ERROR in api-error.log an UI never confirming the resolution
- apply patch & restart services
- Resolve the claim
- it works

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 92dbe80902)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8e3f33e5d6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit a5c20fc188)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-15 02:02:38 +01:00
Tomas Cohen Arazi 3c6577d239 Bug 27004: Regression tests
This patch introduces regression tests for the change in
Koha::Checkouts::ReturnClaim->store.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Checkouts/ReturnClaim.t
=> FAIL: Tests fail

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c4702149b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f1b6a5321b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4d05aeb9c3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-15 02:00:34 +01:00
Kyle M Hall df90cce970 Bug 27276: Fix syntax error
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4f112b782b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 289068c0d5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 9a1447ac2b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-15 01:47:38 +01:00
Jonathan Druart cd2389c519 Bug 27276: Prevent borrowers-force-messaging-defaults.pl to crash
MySQL 5.7 does not allow queries using 0000-00-00

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f228c9ee9f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1b4f18148b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 4d85ad1a8f)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-15 01:47:38 +01:00
Victor Grousset/tuxayo 42aab4343e Bug 27055: Fix compatibility with newer Firefox+Selenium version
Fix "submit is not a function error"
A submit button should not be named "submit", in this case, it's id.
https://stackoverflow.com/questions/833032/submit-is-not-a-function-error-in-javascript

Fix some uses of get_attribute()

Fix a fail by setting a global implicit_wait_timeout, default value is 0
in our lib. Other libs set it higher which helps to not have to manually
deal with part of the timing issues.

Fix: remove usage of click_when_visible() because it doesn't work with
elements not in the top of the page. Because they are off screen.

Fix: use $driver->quit() in error_handler to not forget an open Firefox.
With the current version, it fills /dev/shm and fails with around 5
Firefox opened.
Also use quit() it at the end of every script.

Fix: filling item fields, to fill only the displayed one (not those
with display:none)

== Test plan ==
1. Update selenium/standalone-firefox to the latest version [1]
2. prove t/db_dependent/selenium/authentication.t
3. It fails with: arguments[0].form.submit is not a function
4. Apply patch
5. Retest
6. Success

[1] In koha-testing-docker you can do it with
docker-compose.yml:
     selenium:
-        image: selenium/standalone-firefox:2.53.1-americium
+        image: selenium/standalone-firefox

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c3406257e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 51fcc453f9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 09518a3773)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-13 20:01:51 +01:00
Owen Leonard ed6af317d0 Bug 27099: Stage for import button not showing up
In the latest version of Chrome, pages where the Humansmg library is
included have a problem where the language footer obscures the bottom of
the page.

The problem traces back to some CSS in the Humanmsg library's CSS file:

html, body {
    height: 100%; /* Damn you IE! */
}

Removing the line doesn't have any ill effects that I can see in Chrome
or Firefox, and it fixes the problem in Chrome. IE can be damned.

To test you must have one or more translations enabled in the staff
interface.

- Apply the patch and clear your browser cache if necessary.
- View pages in the staff interface which use the Humansmg library,
  e.g.:
  - Administration -> System preferences. Choose a category of
    preferences which will be numerous enough to require scrolling to
    reach the bottom of the page.
  - Tools -> Stage MARC records for import. Upload a file to display the
    form for staging the import.
  - Cataloging -> Advanced MARC editor

On each page the language footer should not obscure the bottom of the
page.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2498cdcc88)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 474a129380)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 0937c0902b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-10 17:29:43 +01:00
Victor Grousset/tuxayo d8a6e90fd3 Update release notes for 19.11.13 release
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-06 19:46:15 +01:00
Victor Grousset/tuxayo 684408c759 Increment version for 19.11.13 release
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-06 19:46:15 +01:00
Victor Grousset/tuxayo 6b15d04351 Fix translations for Koha 19.11.13
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-06 19:46:15 +01:00
Koha translators 3620c83c7f Translation updates for Koha 19.11.13
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-01-06 19:46:04 +01:00
Mirko Tietgen f331675592 Bug 14564: Set permissions on configuration backups
This patch sets the group and group read permissions on
configuration backups, so that they can be downloaded
via the web staff interface.

Test plan:
0. Apply the patch
1. cp debian/scripts/koha-dump /usr/sbin/koha-dump
2. koha-run-backups --days 2 --output /var/spool/koha
3. Note *.tar.gz backups in /var/spool/koha/kohadev
now have root:kohadev-koha ownership and 640 permissions
4. vi /etc/koha/sites/kohadev/koha-conf.xml
5. Set backup_db_via_tools and backup_conf_via_tools to 1
6. echo 'flush_all' | nc -q 1 memcached 1121
7. koha-plack --restart kohadev
8. Go to http://localhost:8081/cgi-bin/koha/tools/export.pl
9. Click on "Export configuration"
10. Choose a file
11. Click Download configuration
12. Note that *.tar.gz file downloaded correctly

Signed-off-by: David Cook <dcook@prosentient.com.au>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6982680ae9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e906a737f2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 227e595843)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-30 15:10:26 +01:00
Martin Renvoize b3a3d9c261 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>
(cherry picked from commit adf0293c7b)
(cherry picked from commit ebd18bb764)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-24 21:27:05 +01:00
Nick Clemens 9b3abaf877 Bug 27166: [20.05.x] Set destination_loc to item->homebranch
In bug 21020 we used the issue to fetch the item and then the homebranch.
This fails when the item is not issued. We fetch the item already, so we
can use it directly

In 20.05.x we don't have the item object, so we can just use the SIP transaction item

To test:
1 - Have an item belonging to branch A
2 - Check it in via sip at branch B:
    perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 --item CHESS1 -l FPL -m checkin
3 - The read command is blank and there is a warn about uninitialized data
4 - Apply patch
5 - Restart sip server
6 - Check the item in at branch A using the sip cli emulator
7 - Check it in at branch B
8 - This time the checkin should succeed and the output msg should be included

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit d58beb621e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-24 15:29:50 +01:00
Nick Clemens 77a2f4191f Bug 27166: Unit tests
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 409d1114d9)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-24 15:29:49 +01:00
Nick Clemens bceeea6fa9 Bug 25189: Don't create authority if results found
Automatic authority creation assumes that if we don't match we need a new authority.

Using the Default linker, however, we don't match if there exists more than one match.
This leads to repeatedly generating authorities once there is a duplicate in the system

We shoudl instead only create a new authority if there are no results

To test:
1 - Set Linker Module to 'Default'
2 - Enable  AutoCreateAuthorities  and  BiblioAddsAuthorities and  CatalogModuleRelink and LinkerRelink
3 - Add two copies of a single authority via Z39
4 - Add a heading for that authority to a bib record
5 - Save the record and note a new authority is generated
6 - Repeat and see another is generated
7 - Apply patch
8 - Restart all the things
9 - Save the record again, no new authority created

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e5baeac0fd)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-18 23:14:37 +01:00
Nick Clemens e5f7075705 Bug 25189: Unit tests
Adds new test for not adding authority if some already exist

Also replaces use of 'SearchAuthorities' as it is Zebra specific

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6a395eab2d)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-18 23:14:36 +01:00
Victor Grousset/tuxayo 770dec246b Bug ?????: Compile SCSS, forgotten in a previous release
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-18 21:17:58 +01:00
Victor Grousset/tuxayo 6c812a004f Bug 12430: [19.11] Fix buildQuery.t
Output is different in 19.11

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-18 21:01:08 +01:00
Jonathan Druart 608512179c Bug 12430: Fix Search.t failure
t/db_dependent/Search.t ..
    #   Failed test 'buildQuery should keep 0 value'
    #   at t/db_dependent/Search.t line 669.
    #          got: 'su,phr=(rk=(0)) '
    #     expected: 'su,phr=0(rk=(0)) '

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a37ba7903d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f7b4f0bccb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit b8eaa1de2e)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-17 15:16:06 +01:00
Jonathan Druart fd65876883 Bug 12430: Fix selenium/regressions.t failure
Test failed with
    # Looks like you planned 4 tests but ran 3.
t/db_dependent/selenium/regressions.t .. 2/5
 #   Failed test 'OPAC - Remove from cart'
 #   at t/db_dependent/selenium/regressions.t line 109.
Error while executing command: clickElement: An unknown server-side error occurred while processing the command.: Element is not clickable at point (583.7000122070312, 14). Other element would receive the click: <a class="page-link" href="/cgi-bin/koha/opac-search.pl?idx=kw&amp;q=d&amp;offset=420&amp;sort_by=relevance_dsc&amp;count=20" aria-label="Go to the last page"></a>

https://pic.infini.fr//Qhq7pLBq/jT9wZ7F1
The remove from basket link for the biblio 3 is hidden by the floating
toolbar.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 48e74cebed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 965ad535b5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 64ccd1c482)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-17 15:16:05 +01:00
David Cook 448e59ed26 Bug 12430: Add unit tests for C4::Search::buildQuery
This patch adds unit tests for buildQuery, especially focusing on
the use of the (rk=()) wrapper.

Note that the Net::Z3950::ZOOM library is used to test the queries
for CCL validity on top of the string matching used in the
got/expected comparisons.

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

JD amended patch: fix spelling connexion ==> connection

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 66b2bb7ca8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a5e9ad5db2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 168c210498)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-17 15:16:05 +01:00
David Cook 21173ef606 Bug 12430: Use releance ranking without QueryWeightFields
The system preference "QueryWeightFields" is mutually exclusive with
the system preference "QueryAutoTruncate" and the * truncation
modifier, when not using QueryParser.

If you use truncation, relevance won't work anymore. (N.B. Relevance
doesn't work probably when using QueryParser, but for a very different
reason beyond the current scope of this bug.)

This patch adds relevance ranking when using truncation (or basically
when QueryWeightFields is disabled).

_TEST PLAN_

1) Turn on "QueryWeightFields" and set "QueryAutoTruncate" to auto
2) Turn off "UseQueryParser"
3) Do a keyword search in the OPAC
4) Note that the results are ordered by biblionumber ascending

5) Apply patch

6) Do the same keyword search in the OPAC
7) Note that the results are never ordered differently
(presumably in relevance order :P)

If you're a stickler, throw in some warns so that you can see
what CCL query is being sent to Zebra.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f6b5dfa4b7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 913cf92b2d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 66b76dd33d)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-17 15:16:04 +01:00
Martin Renvoize f4fd2f0aff 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>
(cherry picked from commit 442802d776)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit bb7ef5294f)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 22:53:11 +01:00
Martin Renvoize f8b7a36a08 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>
(cherry picked from commit f99a22f276)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 198c3be9f0)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 22:53:10 +01:00
Jonathan Druart fb5bd1de68 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>
(cherry picked from commit 7d6a531500)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit c8385e537c)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 22:36:52 +01:00
Nick Clemens 4fe3333f51 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>
(cherry picked from commit a8b89fe66a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 9561eea563)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 18:56:51 +01:00
Jonathan Druart c6a6edf355 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>
(cherry picked from commit 9038cdd9a4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit b68261d3c3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 18:56:50 +01:00
Jonathan Druart 86c8bb9d44 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>
(cherry picked from commit 1519050205)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 089c12ec09)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 18:56:50 +01:00
Jonathan Druart 473c5a96f4 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>
(cherry picked from commit b0c39296c5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 3e5ee1083d)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 18:56:49 +01:00
Jonathan Druart 94ac5fc6be 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>
(cherry picked from commit a1e9453f1d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit db94f61c23)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 18:56:47 +01:00
Blou 76f2a93069 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>
(cherry picked from commit 5bc36cd672)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 794229750f)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 18:25:47 +01:00
Fridolin Somers 58fc12b45e 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>
(cherry picked from commit 6267eb7cba)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit b40b656779)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 15:30:06 +01:00
David Cook 836aed20f4 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>
(cherry picked from commit 181125242c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit c7f66d7d14)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-16 15:30:05 +01:00
Jonathan Druart 7c6e665b1c Bug 25752: Stay in cwd after koha-shell
After bug 25538, after a koha-shell we are not longer in the current directory:

root@cec7bffd8100:koha(master)$ pwd
/kohadevbox/koha
root@cec7bffd8100:koha(master)$ sudo koha-shell kohadev
kohadev-koha@cec7bffd8100:~$ pwd
/var/lib/koha/kohadev

Test plan:
Repeat the commands above and confirm that with this version of the
script you get /kohadevbox/koha inside the koha-shell

Search for possible regressions

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ad985def45)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2020-12-11 17:18:17 +01:00