Fridolin Somers [Tue, 3 Nov 2020 08:19:34 +0000 (09:19 +0100)]
Bug 26904: OPAC password recovery allows regexp in email
When using OPAC password recovery form, opac/opac-password-recovery.pl :
if one provides correct login and an email, there is a check that this email is one of patron's.
This check uses RegExp with case insensitive :
if ( $email && !( any { /^$email$/i } @emails ) )
This is a security issue since one can simply enter '.*'.
Severity is normal because the login must be a correct.
I propose to use simple string compare with lowercase to be case insensitive.
Test plan :
1) Don't apply patch
2) Enable system preference 'OpacResetPassword'
3) Go to 'OPAC > Log in to your account > Forgot your password?'
4) Enter an existing userid or cardnumber and '.*' in 'Email'
5) The password recovery is created ! (check table 'borrower_password_recovery')
6) Apply patch
7) Enter an existing userid or cardnumber and '.*' in 'Email'
8) You get the message 'No account was found with the provided information.'
9) Enter an existing userid or cardnumber and in 'Email' the corresponding email but with different case
10) The password recovery is created (check table 'borrower_password_recovery')
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Backport to 19.05.x: Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Otherwise:
DBIx::Class::Storage::txn_rollback(): A txn_rollback in nested transaction is ineffective! (depth 1) at t/db_dependent/Koha/Objects.t line 274
Possible side-effects? Slowness?
We need to push it to master ASAP and see how our test suite behave.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bd63fb2bb941294371a072fea9fc2f930ff5bf3f)
Nick Clemens [Thu, 29 Oct 2020 12:18:56 +0000 (12:18 +0000)]
Bug 18051: Set UTF8 Flag for record searches/imports from rancor
The advanced cataloging editor uses Koha::MetaSearcher to find and import records
from Z3950.
The records are correctly converted to UTF8, however, we need to set the flag in the
record to ensure they are parsed correctly later
To test:
1 - Add OHIOLINK as a z39 source as described in earlier comments
2 - Browse to Cataloging->Advanced editor
3 - Click Search->Advanced
4 - Select OHIOLINK
5 - Search for author 'capek karel'
6 - Note records look bad
7 - Apply patch
8 - Restart all the things
9 - Repeat
10 - Success!
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4d92e3d284e392ad681b095c02965fe57a85a5a1)
Phil Ringnalda [Fri, 2 Oct 2020 22:35:04 +0000 (15:35 -0700)]
Bug 26606: Correctly URI-encode query string in URL loaded after deleting an authority record
If you search for "this & that" and delete one of the results, after
it is deleted the search in the reloaded page is for "this " rather
than for "this & that". The template uses the url filter, which is
for filtering an entire URI where :, &, #, etc. should be left alone,
rather than the uri filter which is for filtering a URI component
where they should be encoded.
To test:
1) Go to Authorities > New authority > New from Z39.50/SRU
2) Search for the Author (corporate) this & that collective
3) Actions > Import, Save
4) From the detail for that authority, Edit > Edit as new (duplicate)
5) Edit the 110 field, add 2 at the end and Save
6) Search authorities for this & that
7) For one of the ones you created, Actions > Delete, confirm
8) The page that reloads should have a search for this & that, not
just for this
Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 16e5a9d8dcf7ab332a455ff74e23115fde27a10f)
Mason James [Mon, 26 Oct 2020 18:41:03 +0000 (07:41 +1300)]
Bug 18050: move aqbudgetperiods table before aqbudgets, to fix sql error
00:02:16.310 koha_1 | DBD::mysql::st execute failed: Can't create table `koha_kohadev`.`aqbudgets` (errno: 150 "Foreign key constraint is incorrectly formed") at /usr/share/perl5/DBIx/RunSQL.pm line 278, <$args{...}> line 1.
00:02:16.310 koha_1 | Something went wrong loading file /kohadevbox/koha/installer/data/mysql/kohastructure.sql ([SQL ERROR]: CREATE TABLE `aqbudgets` ( -- information related to Funds Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3df7a02d8198e7a0a0af5459c4c3d2192177b27f)
Katrin Fischer [Mon, 5 Oct 2020 06:17:34 +0000 (06:17 +0000)]
Bug 18050: (QA follow-up) Adjust conditions and make use of message text
- When we run into invalid data, we use Augustin's suggested solution
and copy the data into a separate table, setting the budget_period_id to
NULL.
- We amend the output using the new $message.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3c8bef50a223e70fe3023222f5f940a2b1771b5d)
Agustin Moyano [Fri, 9 Oct 2020 18:14:26 +0000 (15:14 -0300)]
Bug 18050: (follow-up) Force adding FK constraint
When there are inconsistent budget_period_id in aqbudgets this patch
creates the table _bug_18050_aqbudgets with the original data, then sets
the column to null and warns the user that there is inconsistent data.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1193dddd8beb4a10a78e385b221c0f908d92dcf6)
Katrin Fischer [Sun, 13 Sep 2020 23:31:52 +0000 (23:31 +0000)]
Bug 18050: Add relation alias to schema
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 2800b53bdd6df1e87f72673bc79ed4896f4e4e35)
Katrin Fischer [Sun, 13 Sep 2020 22:42:27 +0000 (22:42 +0000)]
Bug 18050: Add FK constraint on aqbudgets.budget_period_id
This adds a FK constraint on aqbudgets.budget_period_id so that
a fund cannot be added with an invalid aqbudget.budget_period_id.
We should not have funds that belong to no budget. In case we have, the
update will be skipped and a note displayed.
Part1:
- Before applying the patch
- Make sure you have a budget with some funds linked to it
- You will have to change one of the funds to link to an invalid
budget with SQL:
UPDATE aqbudgets SET budget_period_id = 999 WHERE budget_id = max(budget_id);
- Apply patch
- Run updatedatabase - verify that you see the hint about 1 existing fund with invalid budget.
- Repair your fund with SQL
UPDATE aqbudgets SET budget_period_id = ... WHERE budget_id = max(budget_id);
(... needs to be your existing budget_period_id)
- Run updatedatabase again - verify it runs successfully now.
- If you try to change the budget_period_id to a non-existing now with SQL, you will
get a database error. The new FK doesn't permit it.
Part 2:
- Start fresh with the web installer, verify there are no errors on
creating the database tables
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 0ce62b29bf5ebe30125eb4c631de11391134f109)
Mark Hofstetter [Mon, 19 Oct 2020 17:28:19 +0000 (17:28 +0000)]
Bug 26601: Add utf8 encoding to text output of overdue_notices.pl
This patch sets the UTF8 encoding for output of overdue_notices.pl when
outputting to txt.
To test:
0/ Check out an item with due date yesterday (use specify due date)
1/ Create ODUE text with utf8 encoded characters, chinese characters, umlauts etc
<url>/cgi-bin/koha/tools/letter.pl?op=add_form&module=circulation&code=ODUE
2/ Run
perl overdue_notices.pl -text ./
3/ Verify encoding in the generated text file is incorrect
4/ Apply patch and repeat 2/
3/ Confirm text now inludes properly encoded characters
Sponsored-by: Styrian State Library Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
With German umlauts on my system the editor still showed the
characters correctly (probably guessing the right encoding).
Using Chinese made the problem visible.
This is really an installation issue, though at the
time of installation it did not result in any error.
During cataloguing in the items menu the "Type of item or material"
is not constrained by the itemtypes authorised_values (as it is for 942c records).
I have added the itemtypes to the installer sql in unimarc_framework.sql
as well as adding the description of this field for OPAC, which had been left empty.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3bd23a3287345167de50d994d737351174c04936)
John Fawcett [Mon, 12 Oct 2020 11:06:40 +0000 (13:06 +0200)]
Bug 26612: Error during web install for it-IT translation
Patch changes some of the values in the sql statement that inserts 307a
unimarc row into the marc_subfield_structure which created an SQL error
on installation.
The fields changed are:
- isurl now 0 instead of NULL,
- hidden now -5 instead of NULL,
- seealso empty string instead of NULL,
- link empty string instead of NULL.
These field values are now similar to the ones inserted for 306a or 308a.
The value that caused the SQL error was using NULL for hidden (due to
the NOT NULL constraint in the table definition).
I have tested the install with this change and found no issues.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c74c6636f779bbbaceee74f8704df9ec625815d)
Bug 26569: Use gender neutral pronouns in system prefernece explanations
To test:
1 - perform query "select variable,explanation from systempreferences where explanation like '% his %';"
2 - find 6 sysprefs with gendered pronouns used in explanations
3 - apply patch, reset_all
4 - repeat query
5 - no more gendered pronouns!
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a96f5deef04bb74fbd826449b4d82f651a67512c)
David Cook [Mon, 21 Sep 2020 02:02:27 +0000 (02:02 +0000)]
Bug 26496: Add op field to Budget Planning
Without this patch, it's impossible to save a budget plan.
With this patch, it is possible to save a budget plan.
Test:
1. Apply patch
2. Modify a budget (e.g. http://localhost:8081/cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form&budget_period_id=1)
3. Unlock the budget if necessary by unticking "Lock budget" and click "Save"
4. Go to a budget (e.g. http://localhost:8081/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=1)
5. Click "Planning" and "Plan by libraries"
6. Click "Auto-fill row" on the first line
7. Click "Save"
8. Note that results are saved and shown on the newly loaded page
To verify this patch is necessary, do the test plan without applying the patch.
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fd35df346f73a00b643e675853ba2c8ef321cf66)
Alex Buckley [Tue, 29 Sep 2020 05:53:34 +0000 (05:53 +0000)]
Bug 26589: Fix t/db_dependent/OAI/Sets.t failing when OAI-PMH:AutoUpdateSets is enabled
Test plan:
1. Check the OAI-PMH:AutoUpdateSets syspref is disabled
2. Run t/db_dependent/OAI/Sets.t tests and confirm tests pass
successfully
3. Enabled the OAI-PMH:AutoUpdateSets syspref
4. Repeat step 2 and confirm the tests fail
5. Apply this patch and restart plack: sudo koha-plack --restart
<instance>
6. Repeat step 2 and confirm the tests now pass
7. Disable the OAI-PMH:AutoUpdateSets syspref and repeat step 2 and
confirm tests still pass
Sponsored-By: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 913897f3a484ea31a2373de7aac2cc8298319575)
Can't use string ("13") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Serials.pm line 2198.
This function call makes no sense, that subroutine always returns a list and doesn't take any parameters. I think it was meant to be GetSubscriptionFrequency which is in fact already called a few lines down.
Signed-off-by: kelly mcelligott <kelly@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD
Test plan:
1. Create a new subscription
* When there is an irregular issue: Skip issue number
* Select a frequency (not irregular)
* Test prediction pattern and mark some "not published" (to fill the subscription.irregular DB field
2. Receive a first serial (mark it arrived, an "expected" one is created)
3. Claim the expected one
=> You have 1 arrived and 1 claimed.
It's the only way to not have an expected one and hit the else block in serials/serials-collection.pl
4. Generate next => boom
Jonathan Druart [Thu, 20 Aug 2020 08:10:44 +0000 (10:10 +0200)]
Bug 26260: Add missing elastic>cnx_pool to koha-conf-site.xml.in
Added by bug 22705, but only in etc/koha-conf.xml
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 33ab3c690076bf78d62105502b6de54e45e766b2)
Katrin Fischer [Thu, 24 Sep 2020 21:52:33 +0000 (23:52 +0200)]
Bug 24780: Make items.stocknumber show up in batch item modification
It looks like the field was intentionally removed from the list
of batch editable fields in the past. This makes sense as we
used to have a unique index on it at some point - but we do have
no more.
This removes the exception so that the invendory number behaves
like the other fields on the batch item edit form.
To test:
- Create some items with and without stocknumber
- Go to tools > batch item modification
- Enter the barcodes of your selected items in the list or
upload a file with them
- Verify that the stocknumber/inventory number is not showing
in the item edit form below
- Apply patch
- Reload the page - inventory number is there now
- Batch edit the inventory number and verify it works as expected
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 0afcf3936a6ceeb865fdf0159cf54618400847d7)
Nick Clemens [Mon, 17 Aug 2020 10:16:14 +0000 (10:16 +0000)]
Bug 26224: Prevent double submit of header check in form
To test:
1 - Browse to Home
1 - In the header bar select the 'Check in' tab
2 - Type a barcode into the box
3 - Hit Enter as many as times as you can
4 - Check the statistics table:
SELECT * FROM statistics WHERE itemnumber={itemnumber} AND DATE(datetime)=CURDATE();
5 - Note you have multiple lines for the same item at the same time
6 - Apply patch
7 - Reload the page
8 - Type the barcode
9 - Press Enter even more fast and more furiously
10 - Check the statistics table
11 - Only one entry, huzzah!
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5d5a49a7ef165b7b47dda6357aaf2953dacfa362)
Koha::Calendar assumes we never issue an item on a closed day.. this is
a fair assumption but the hardcoded closed day in our tests means it
does not hold true in this case.
This patch sets the closed day dynamically to prevent such a case.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
The original loop compared start date to end date and iterated all the
way to start date equals end date. The alternate implimentation
inadvertantly looped from start date, skipped the first day then
iterated up to one day beyond end date.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Jonathan Druart [Tue, 29 Sep 2020 09:43:00 +0000 (11:43 +0200)]
Bug 26562: [19.05.x] Removes 'searches' from localStorage on logout
A user recently logged in will inherit the "searches" item stored in localStorage.
To recreate:
Log in with user A, do some searches
Note that the "searches" item is filled in with the search queries
Logout and log in with user B
Note that the "searches" item is still there
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Plugin dirs defined in koha-conf.xml are added to @INC in order to compile perl code.
Looks like with plack those dirs are added several times.
This may lead to an error "INCLUDE_PATH exceeds 64 directories".
This bug was identified with Carrousel plugin : https://inlibro.com/instructions-carrousel/
Test plan :
1) Enable plack and plugins
2) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'
3) Install plugin KitchenSink : https://github.com/bywatersolutions/koha-plugin-kitchen-sink
4) Dont apply patch
5) Use configure on KitchenSink
6) Look at page about.pl : @INC contains server plugin dir 'var/lib/plugins'
7) Apply patch and restart plack
8) Use configure on KitchenSink
9) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'
Signed-off-by: Kyle M Hall <kyle@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 dcdc72aee7d835c08ca3565a83a3dae7389a4f87)
Kyle M Hall [Tue, 22 Sep 2020 18:10:10 +0000 (14:10 -0400)]
Bug 26510: Transport Cost Matrix editor doesn't show all data when HoldsQueueSkipClosed is enabled
If HoldsQueueSkipClosed is enabled, and a library happens to be closed
on the day you edit the transport cost matrix, all the values for that
library will not show. Instead they will appear disabled, and if you
were to edit the cell and save a new value in it, it will also
'disappear' when the page is reloaded.
Test Plan:
1) Set today as a holiday for a library
2) Set HoldsQueueSkipClosed to 'open'
3) Go to the transport cost matrix editor
4) Edit a cell where the 'from' is for the closed library
5) Note the value doesn't 'save', it is still in the database though
6) Apply this patch
7) Restart all the things!
8) Reload the transport cost matrix editor
9) The value now appears correctly!
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 26ab04a3b383f5a9c88124625f8edc1c4cf1d816)
Plugin dirs defined in koha-conf.xml are added to @INC in order to compile perl code.
Looks like with plack those dirs are added several times.
This may lead to an error "INCLUDE_PATH exceeds 64 directories".
This bug was identified with Carrousel plugin : https://inlibro.com/instructions-carrousel/
Test plan :
1) Enable plack and plugins
2) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'
3) Install plugin KitchenSink : https://github.com/bywatersolutions/koha-plugin-kitchen-sink
4) Dont apply patch
5) Use configure on KitchenSink
6) Look at page about.pl : @INC contains server plugin dir 'var/lib/plugins'
7) Apply patch and restart plack
8) Use configure on KitchenSink
9) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'
Signed-off-by: Kyle M Hall <kyle@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 dcdc72aee7d835c08ca3565a83a3dae7389a4f87)
David Cook [Tue, 18 Aug 2020 02:20:32 +0000 (12:20 +1000)]
Bug 26231: Remove incorrect use of AddAuthority() when 001 present
This patch removes the use of AddAuthority with a non-empty
authid argument, since that triggers an update rather than an insert.
In practice, the update also fails, but the error isn't raised,
as the database connection doesn't have RaiseError set.
Test plan:
1) Do not apply patch
2) Try to bulkmarcimport an authority file with a 001
3) Observe that the script reports success but no authority is added
4) Apply the path
5) Try to bulkmarcimport an authority file with a 001
6) Observe that the script reports success and the authority is added
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 9622561636387ced932cc31e285d13cdba607c47)
Bug 26049: Replace li with span class results_summary in UNIMARC intranet XSLT
In all XSLT for record display, fields are created with <span class="results_summary> except in UNIMARC intranet where there is just <li>.
This allows a better CSS customisation and closer code in files for OPAC and intranet.
Actually li gets diplayed with a dot at each line, we don't want this.
Test plan :
1) For each modified file run 'xsltproc file.xsl' and see there is no
error
2) Use default XSLT in all system preferences
3) Perform a search and check display with and without patch
4) Click on a record to see details and check display with and without patch
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> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9db369fb58c1f2795f748e972397f1ecb882ce92)
Jonathan Druart [Thu, 10 Sep 2020 07:42:58 +0000 (09:42 +0200)]
Bug 26420: Use translated notices for overdue_notices.pl
This script does not pass the patron's preferred lang for notices.
Test plan:
Enable TranslateNotices
Create a patron with a preferred lang for notices != default
Translate ODUE for this language
Setup the overdue notices for this patron's category
Check an item out for this patron (select the correct due date to
trigger the notice)
Run the script overdue_notices.pl
Check the message_queue table and confirm that the notice enqueued is
translated
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> 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 8e397330f687bd0e9e39387e32a8a8acbbb3b31a)
Jonathan Druart [Thu, 21 May 2020 13:46:53 +0000 (15:46 +0200)]
Bug 20783: Add missing url filters
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
(cherry picked from commit 856cb2d1b71f04de7ee457d0d001511f0dcb760a) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Jonathan Druart [Tue, 12 May 2020 13:13:44 +0000 (15:13 +0200)]
Bug 20783: Similar changes for OPAC
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
(cherry picked from commit cd52f4439ba31ccd2af71541678100cb98ab5f36) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Jonathan Druart [Tue, 12 May 2020 10:54:50 +0000 (12:54 +0200)]
Bug 20783: Use iframe to embed Youtube videos
WWW::YouTube::Download is broken and not reliable.
Other alternative was to use HTML::Video::Embed but not updated since
years.
The best alternative seems to follow youtube advise and use an iframe
https://developers.google.com/youtube/iframe_api_reference
Test plan:
Put youtube video in 856$u (using different url formats, youtu.be,
youtube.com/embed, etc.)
Enable HTML5MediaEnabled and HTML5MediaYouTube and confirm that the
youtube videos are correctly embeded.
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
(cherry picked from commit 524fe12e4419654d98af485d7dbbc9eedac28141) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Martin Renvoize [Tue, 15 Oct 2019 15:49:07 +0000 (16:49 +0100)]
Bug 23129: (RM follow-up) Fix failing test
This patch corrects a test that was testing for the oposite behaviour to
that introduced in this patchset. We have agreed on the bug that the
new behaviour is desired and so I have updated the test to follow.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 480434bbf4a32750c5e47a3600b6a386d9732296) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Nick Clemens [Fri, 14 Jun 2019 18:18:03 +0000 (18:18 +0000)]
Bug 23129: Set holdingbranch to library that initiates transfer
To test:
1 - Find an item
2 - Check it in at anothe rbranch and initiate a transfer
3 - View the item details or check db - note that holdingbranch is set as the destination library
4 - Complete or cancel the transfer
5 - Apply patch
6 - Initiate a new transfer
7 - Note the holdingbranch is set to the initiating library
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40380339f9bdd0b2a056c820bc61a3cdc8545df3) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Owen Leonard [Wed, 29 Jul 2020 12:21:29 +0000 (12:21 +0000)]
Bug 25762: Typo in linkitem.tt
This patch corrects the same typo in two different templates:
’ -> ›
If you want to test beyond examining the patch, apply the patch
and go to Tools -> Rotating collections.
- Add an item to a rotating collection.
- In the browser's title bar (or the tab title if the title bar isn't
shown) the separator between the rotating collection name and "Add or
remove items" should be ">" instead of "`"
- Enable the EasyAnalyticalRecords system preference.
- View the detail page for a bibliographic record.
- From the "Edit" menu, choose "Link to host record"
- Check the title bar as you did previously.
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 19f9bc0528ec0f5cdf000b5120138652b3ece57c)
Martin Renvoize [Wed, 22 Jul 2020 12:28:44 +0000 (13:28 +0100)]
Bug 26041: Enable keyboard navigation without 'ctrl'
This patch enables keyboard navigation using the arrow keys without the
need to hold the control key for the jQuery UI datepicker.
Test plan
1/ Navigate to an item in the opac and attempt to place a hold
2/ On the resultant screen, use keyboard navigation to trigger the 'Show
more options' dropdown.
3/ Focus on one of the date inputs using keyboard navigation.
4/ Use 'ctrl + arrow' keys to navigate the datepicker.
5/ Note that prior to the patch using 'bare' arrow keys does not trigger
anything
6/ Apply the patch and confirm that the datepicker can now be naviated
using the arrow keys without holding the ctrl key.
7/ Confirm that using the ctrl key combinations continue to work as
expected too.
8/ Signoff
Signed-off-by: Brandon J <brandon.jimenez@inLibro.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit be92f7e79ce093e251c2489408dce3077f782c0d)
Mason James [Thu, 18 Jun 2020 01:26:20 +0000 (13:26 +1200)]
Bug 25792: Rename 'ttf-dejavu' package to 'fonts-dejavu' for Debian 11
to test...
1/ attempt to install koha 20.05 package on deb11, fail :'(
2/ apply patch and build new koha package
3/ attempt to install new koha package on deb11, succeed!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 14932ae7d3bf864f64bffc9b1b015a07e11c8e2e)
Jonathan Druart [Thu, 20 Aug 2020 12:32:43 +0000 (14:32 +0200)]
Bug 24147: Don't assume search_related will return ordered values
This test is failing randomly because it assume the order is always the
same. But it's not.
Note: Koha::Objects->search_related is never used , last use removed from
commit 9aa724cdf29a57bc91e42b240b5bcd19e3814ada
Bug 19599: Speed anonymise_issue_history up
We should keep it however IMO
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e10dc503289e8d7e8c742af0111acb79d4d53111)
Jonathan Druart [Fri, 21 Aug 2020 14:07:46 +0000 (16:07 +0200)]
Bug 26069: Pass correct URL to twitter
We don't provide the url of the detail page so the twitter JS code
retrieve the current location, with the search terms.
Test plan:
Do a search
Click on a result
Click on the twitter button and confirm that the link only contain
biblionumber=x in the parameter
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5fd8774c687c6aaf6716485ab9bd72a69a0e2f76)
Jonathan Druart [Tue, 18 Aug 2020 08:54:43 +0000 (08:54 +0000)]
Bug 26233: (bug 25553 follow-up) Make date columns sortable on the edit items table
We were missing to pass the title-string to datatables.
Test plan:
Retest bug 26233, with appropriate dates
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit df5c9d0725dec84a3d57f97a7728cbc7e1cac9fc)
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
(cherry picked from commit 2a48a23c4209fea92fcdaae66268a1af9004a736) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This patch does the minimum to make it usable, but it would need more
love.
Test plan:
To test you will need to try the 4 combinaisons:
item-level_itypes = item or biblio
With or without a library selected in the dropdown list
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5bca73080f89bb2f4ca83ce6ceb9fa8e3c4a7d92)
Jonathan Druart [Tue, 7 Apr 2020 11:32:51 +0000 (13:32 +0200)]
Bug 25005: (bug 22868 follow-up) Fix suggestions pending on main page
There is a "Suggestions pending approval" link on the main page that is
displayed if there are new suggestions and the logged in user has the
permission to manage them.
On bug bug 22868 the permission changed from
acquisition.suggestions_manage to suggestions.suggestions_manage
But in the template, one occurrence has not been replaced correctly
(certainly because it was already wrong actually).
Test plan:
Create a suggestion at the OPAC
Create a patron with the suggestions permission
Use this patron to login at the staff interface
=> Without this patch the link does not appear on the main page
=> With this patch applied the link appears
Signed-off-by: David Roberts <david@koha-ptfs.co.uk> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
(cherry picked from commit fba279050a344cfb43a189d11e041cdb4326acf4) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Nick Clemens [Fri, 17 Jul 2020 11:31:29 +0000 (11:31 +0000)]
Bug 26000: Make exception_holidays cache with branch in key
In light of 25723 offering a simpler solution here.
This would just let us avoid backporting larger changes, but this can be
marked as a duplicate if 25723 is preferred to this change
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
(cherry picked from commit 1d9737486c8aad3a419d1b4ad22ba1a43ee243d3) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Fridolin Somers [Mon, 29 Jun 2020 13:07:10 +0000 (15:07 +0200)]
Bug 23542: Fix SRU import encoding
When importing records from a SRU server, the diacritics have bad encoding.
I reproduce with BNF server so it may be a UNIMARC issue.
Tests show that difference between Z39.50 server and SRU is that leader contains 'a' at postion 9.
Looking at MARC::Record->encoding() shows that encoding depends on leader even for UNIMARC.
So this patch adds a call to MARC::Record->encoding('UTF-8') in case of a SRU server in C4::Breeding.
Same use exists in Koha::MetadataRecord::Authority::get_from_breeding().
In case of import via Z3950, MarcToUTF8Record() is called,
which calls SetMarcUnicodeFlag(),
which calls MARC::Record->encoding('UTF-8')
Test plan :
1) Use a UNIMARC database
2) Configure a connexion to a UNIMARC SRU, for example BNF,
see https://doc.biblibre.com/koha/autour_de_koha/serveurs_z3950_sru#serveur_de_la_bnf
3) Go to cataloguing module
4) Click on 'New from Z39.50/SRU'
5) Choose only the SRU target
6) Search for ISBN 2266072889
7) Confirm you see good encoding : diacritic on 'a' of title 'Strate-a-gemmes'
8) Click on 'Marc preview'
9) Confirm you see good encoding
10) Click import
11) Confirm you see good encoding
12) Check also Authorities import via SRU
13) Check also SRU imports on a MARC21 database
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Removed change to new_from_xml call. We should respect syntax.
But the added MARC::Record encoding does the tric! Which is implicit
for Z3950 targets where MarcToUTF8Record does the same. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 19d9ba176dea6b7816a33b014a5f9e309af53dc0)
Jonathan Druart [Wed, 19 Aug 2020 05:25:06 +0000 (07:25 +0200)]
Bug 26162: [19.11] Fix DT info label
There is an inconsistency in 19.11:
% grep Showing koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc koha-tmpl/intranet-tmpl/prog/js/datatables.js
koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc: var MSG_DT_INFO = _("Showing _START_ to _END_ of _TOTAL_");
koha-tmpl/intranet-tmpl/prog/js/datatables.js: "sInfo" : window.MSG_DT_INFO || "Showing _START_ to _END_ of _TOTAL_ entries",
The "entries" is not always displayed.
datatables.inc has been removed from 20.05 by
Bug 24662: Remove global variables MSG_* from datatables.inc
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
(cherry picked from commit 8d1e45727b16ca63e0c0041fcba4e10222665987) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Jonathan Druart [Mon, 10 Aug 2020 09:59:58 +0000 (11:59 +0200)]
Bug 26162: Wait for the table to be refreshed
The previous patch did not work as expected. We still got a
StaleElementReference exception.
But this time on
10:43:47 selenium_1 | Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//*[@id=\"branchname\"]"}
Because we found the one that existed on the page, not the one sent back
in AJAX.
The idea of this patch is to search for the "Showing 1 to X of Y entries" info and wait for X == Y
Jonathan Druart [Thu, 6 Aug 2020 13:08:48 +0000 (15:08 +0200)]
Bug 26162: Make Selenium click action more robust
See
https://stackoverflow.com/questions/12967541/how-to-avoid-staleelementreferenceexception-in-selenium
https://www.selenium.dev/exceptions/
https://developer.mozilla.org/en-US/docs/Web/WebDriver/Errors/StaleElementReference
This patch will fix the following failure we get under D11:
18:47:07 selenium_1 | 09:47:07.478 WARN - Exception: Element not found in the cache - perhaps the page has changed since it was looked up
18:47:07 selenium_1 | For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html
18:47:07 selenium_1 | Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
18:47:07 selenium_1 | System info: host: '78b9a07f51f2', ip: '192.168.16.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.0-9-amd64', java.version: '1.8.0_91'
18:47:07 selenium_1 | Driver info: driver.version: unknown
18:47:07 koha_1 |
18:47:07 koha_1 | STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
18:47:07 koha_1 | /usr/local/share/perl/5.26.1/Selenium/Remote/Driver.pm:353 in Try::Tiny::try
18:47:07 koha_1 | (eval 1571):1 in Selenium::Remote::Driver::__ANON__
18:47:07 koha_1 | (eval 1573):2 in Selenium::Remote::Driver::__ANON__
18:47:07 koha_1 | (eval 1546):17 in Selenium::Remote::Driver::_execute_command
18:47:07 koha_1 | /usr/local/share/perl/5.26.1/Selenium/Remote/WebElement.pm:63 in Selenium::Remote::WebElement::_execute_command
18:47:07 koha_1 | /kohadevbox/koha/t/lib/Selenium.pm:184 in Selenium::Remote::WebElement::click
18:47:07 koha_1 | /kohadevbox/koha/t/lib/Selenium.pm:172 in t::lib::Selenium::click_when_visible
18:47:07 koha_1 | t/db_dependent/selenium/administration_tasks.t:131 in t::lib::Selenium::click
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a96433446e87c03ac6e253a54eb067ac93a33575)
Jonathan Druart [Wed, 22 Jul 2020 12:11:03 +0000 (14:11 +0200)]
Bug 26043: Fix random failure from Holds.t
# Failed test 'Test ModReserveMinusPriority()'
# at t/db_dependent/Holds.t line 202.
# got: undef
# expected: '1605'
# Looks like you failed 1 test of 66.
It is coming from Koha::Patron->holds that is ordering by reservedate,
so "sometimes" they are ordered in reverse (at least it's my
understanding of the problem).
Test plan:
Run the test file several times (from 20 to 60x), it must never fail
with this patch
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 80a611797bf67b263b6b84a6e931833ea336b6a5)
Owen Leonard [Wed, 29 Jul 2020 12:21:29 +0000 (12:21 +0000)]
Bug 25762: Typo in linkitem.tt
This patch corrects the same typo in two different templates:
’ -> ›
If you want to test beyond examining the patch, apply the patch
and go to Tools -> Rotating collections.
- Add an item to a rotating collection.
- In the browser's title bar (or the tab title if the title bar isn't
shown) the separator between the rotating collection name and "Add or
remove items" should be ">" instead of "`"
- Enable the EasyAnalyticalRecords system preference.
- View the detail page for a bibliographic record.
- From the "Edit" menu, choose "Link to host record"
- Check the title bar as you did previously.
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 19f9bc0528ec0f5cdf000b5120138652b3ece57c)
Julian Maurice [Thu, 25 Jun 2020 07:25:41 +0000 (11:25 +0400)]
Bug 25873: Ignore malformed data for Elasticsearch integer fields
If we try to put malformed data into an integer field, Elasticsearch
rejects the whole document.
Setting 'ignore_malformed' to true allows to ignore malformed data and
process the other fields of the document normally
Test plan:
* Without the patch
1. In search engine configuration, change the type of a text field to
'Number' (for instance 'title')
2. misc/search_tools/rebuild_elasticsearch.pl -d -b
3. See that the index is empty (unless you have titles consisting only
of digits)
* With the patch
1. misc/search_tools/rebuild_elasticsearch.pl -d -b
2. Now records are correctly indexed
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cb5acdc6702cef4668921ccf2537797358981fff)
Jonathan Druart [Thu, 30 Jul 2020 10:00:03 +0000 (12:00 +0200)]
Bug 25852: Improve C4::Creators::Lib reliability under plack
This is certainly a major issue that leads to many side-effects.
Under plack, the structure of the default values are not handled
correctly.
Package variables are used to store stuff like the "layout type". They
are complex structures (arrays of hashes) and returned without being
copied.
When the caller (the controller script) retrieve them then modify the
returned structures, it actually modifies the package's variables.
One of the issue is:
Create a new layout
The script retrieve a structure with all "selected" flags are set to 0
It select the first one as default (BAR as selected => 1)
The user creates the new layout and will selected BIBBAR (for instance)
If you then edit this new layout, the script will retrieve the
"label_types" and set "selected" for BIBBAR. However BAR is still
selected!
The UI receives 2 selected and display the first selected one that has
the selected option.
Test plan:
1. Create a layout type for Barcode/Biblio
2. Choose fields to print and size of font
3. Save
4. Edit existing Layout
=> Withtout this patch "Barcode" is the preselected option
=> With this patch applied, the correct "Barcode/Biblio" option is
selected
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0a9d3f17d9e44b5326a42d14420d30243031629d)
Jonathan Druart [Thu, 30 Jul 2020 09:59:44 +0000 (11:59 +0200)]
Bug 25852: Add tests
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e330e4ec222f8ac3a04339a020509e30aa0bf3ab)
Test plan:
1) have books entered
2) log in create a list
3) add books to list
4) display list in OPAC
5) click the RSS link button.
-- output is displayed as html text
6) apply patch
7) repeat steps 4&5
-- output is displayed as xml tree
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3d0da68d5ada37b40099fbc11b63202ccf7a48b2)
19.05: The warning fix wasn't in 19.05 so not it was introduced in it's
2nd version.
kohadev-koha@kohadevbox:/kohadevbox/koha$ prove t/db_dependent/Koha/Patrons/Import.t
t/db_dependent/Koha/Patrons/Import.t .. 2/159
# Failed test 'No warning raised by import_patrons'
# at t/db_dependent/Koha/Patrons/Import.t line 171.
# found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
# found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
# didn't expect to find a warning
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
t/db_dependent/Koha/Patrons/Import.t .. 152/159 # Looks like you failed 1 test of 159.
t/db_dependent/Koha/Patrons/Import.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/159 subtests
Nick Clemens [Wed, 8 Jan 2020 20:59:38 +0000 (20:59 +0000)]
Bug 24379: Make login_attempts not nullable
While the column defaults to 0 in Koha::Object->store we set to NULL if NULLABLE
When trying to reset a patrons password we check that the account is not administratively locked:
login_attempts != -1
This query does not return rows where login_attempts IS NULL. It will return accounts where login_attempts = 0
Let's default to 0 like we intend
To test:
1 - Create a new patron
2 - Note their login_attempts is NULL
SELECT login_attempts FROM borrowers ORDER BY borrowernumber DESC LIMIT 1
3 - Enable OpacResetPassword
4 - Attempt to reset password before logging in, you cannot
5 - Apply patch, updatedatabase, restart_all, update schema
6 - Create another patron
7 - Their login attempts should be 0
8 - Attempt to reset password, it works!
Bug 24379: Fix the test
First we create a patron using TestBuilder to get a hashref of valid
info. Then we delete it and create a new patron using Koha::Patron->new
Once stored, we should call discard_changes to make the calculated
values available in the currenct object.
Bug 24379: Don't drop default of 0 for login attempts
When moving the column we drop the default, this means that DBs upgraded form earlier versions
get the wrong values set
To test:
1 - Checkout 16.11.x
2 - Reset all
3 - Checkout master
4 - updatedatabase
5 - SHOW CREATE TABLE borrowers;
6 - Note the column login_attempts defaults to NULL
7 - Apply patch(es)
8 - Repeat
9 - Now it defaults ot 0 (and has NOT NULL if applied all)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7bb31cffae27dc398a7b4a4decf3623ec65478ac)
Nick Clemens [Mon, 6 Jul 2020 17:56:35 +0000 (17:56 +0000)]
Bug 25709: Rename systempreference to NotesToHide
In an effort to use more inclusive language we have added a new coding guideline:
https://wiki.koha-community.org/wiki/Coding_Guidelines#TERM3:_Inclusive_Language
This patchset renames a syspref to be clearer and follow the guideline
To test:
1 - Apply patch and updatedatabase
2 - git grep NotesBlacklist
3 - Note all remaining occurrences are translations, db updates, and release notes
4 - Add a field (e.g. '520' ) to the NotesToHide systempreference
5 - View a record with a 520 field on the opac
6 - Confirm the field does not show in the 'Title notes' tab
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5e45076c00b2f72537ba9c81c4535253f1aaadfb)
Kyle M Hall [Wed, 18 Sep 2019 14:28:33 +0000 (10:28 -0400)]
Bug 23086: Search for collection is broken
It appears that we are quoting the ccode values deep in the search code.
Under ICU chains this breaks searching by limits
To recreate
1 - Setup Koha using Zebra and icuchains
2 - Add ccode to AdvancedSearchTypes
3 - In koha-conf.xml set zebra debug level to include request
<zebra_loglevels>none,fatal,warn,request,info</zebra_loglevels>
4 - Set some items into different ccodes
5 - On opac perform a search for:
ccode:NFIC
6 - It works
7 - tail -n 50 /var/log/koha/kohadev/zebra-output.log
8 - Note search request like:
Search biblios OK 26 1 1+0 RPN @attrset Bib-1 @attr 1=8009 NFIC
9 - On opac go to advanced search, select Collection, and limit to smae code a s above
10 - No results
11 - Check the zebra-output.log:
Search biblios OK 0 1 1+0 RPN @attrset Bib-1 @attr 1=8009 'NFIC'
12 - Apply patch
13 - Restart all
14 - Repeat search by collection limit
15 - Success!
16 - Check the zebra-output.log:
Search biblios OK 0 1 1+0 RPN @attrset Bib-1 @attr 1=8009 NFIC
17 - Add a new ccode value: N)N
18 - Set some items to that ccode
19 - Confirm searching by that ccode works
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bc1b76be4a35403239fbce6f349ee343435cc8a0)
Nick Clemens [Wed, 15 Jul 2020 15:33:18 +0000 (15:33 +0000)]
Bug 23086: Unit test
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 40b6e1b8a1a6e74cb4e9a1c422ffa4faa0bdefc0)
Jonathan Druart [Mon, 27 Jul 2020 13:15:44 +0000 (15:15 +0200)]
Bug 25729: Prevent Charges/Fees.t to fail on slow server
We must use t::lib::Dates::compare to compare dates
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 fcd659b2d4cf62df48113567c59392e8dff9696f)
Martin Renvoize [Mon, 29 Jun 2020 14:55:17 +0000 (15:55 +0100)]
Bug 25244: Add specific aria-label to search results
This patch adds an arai-lebel to the select checkboxes on the search
results page of the OPAC.
Test plan
1/ Perform a search that will yield some results
2/ Inspect the 'checkbox' on the left side of the results table
3/ Note that there is no arai-label
4/ Apply patch
5/ Refresh the search results page
6/ Inspect the 'checkbox' on the left side of the results table
7/ Note that the aria-label now appears and contains relavant
information
8/ Signoff
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Bug 25244: (follow-up) QA corrections
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d1a7112a9054305ead325daedd6bb106a31b346f)
Martin Renvoize [Thu, 11 Jun 2020 09:14:03 +0000 (10:14 +0100)]
Bug 25155: (follow-up) Increase headings levels by 1
In the previous patch we reduced the headings levels by 2, but this was
one level too many as we already have an H1 in the navbar and so all
other heading sets should start at level 2 to semantically follow the
title heading.
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c9a0243f3abf407e1a89d7bfc125911cc153b3cc)
Martin Renvoize [Thu, 11 Jun 2020 08:32:45 +0000 (09:32 +0100)]
Bug 25155: Fixing semantic headings login modal
The login modal headings were semantically incorrect prior to this
patch.
Test plan:
1) Click the 'Log in to your account' option to expose the modal
2) Use a headings inspector and note we jump from H1 (Page Title) -> H3
(Modal Title)
3) Apply the patch and reload the page.
4) Click the 'Log in to your account' option to expose the modal
5) The modal should still appear well formed
6) Use a headings inspector and note we jump from H1 (Page Title) -> H2
(Modal Title) -> H3 (Shibboleth title if enabled)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 513b226873759ba3df6765dce635fe96cf5a51f3)
Hayley Mapley [Thu, 11 Jun 2020 01:13:30 +0000 (13:13 +1200)]
Bug 25155: Fixing semantic headings in opac-auth.tt
Test plan:
1) Follow test plan from comment #1
2) Apply the patch
3) Reload the page, and note that is still displays fine
4) Check that the main heading is now an h1, and that the other headings
on the page make sense
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0bc47b5302fba91c1315acee5533ec5917df5761)
Bug 25726: make holds to pull ignore holds where found is not null and itemnumber is null
To test:
1- place 2 bib-level holds on available items
2- confirm they both show on Holds to Pull
3- edit one hold from the database to set found='T'
4- reload Holds to Pull, confirm it is now empty
5- apply patch
6- Reload Holds to Pull
7- confirm it now shows the hold you did not edit
Signed-off-by: donnab <donna@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Using capitals for SQL reserved words; added a FIXME
Tested with:
update reserves set found='T', itemnumber=NULL where reserve_id=...
This should be a workaround while we fix the underlying problem.
Martin Renvoize [Tue, 7 Jul 2020 08:27:48 +0000 (09:27 +0100)]
Bug 25944: Schema fix for illrequests route
The illrequests path was missing the `comments` and `status_alias`
embedable relations in the path specification.
Test plan:
1/ Ensure you have the latest Mojolicious + OpenAPI modules installed.
2/ Navigate to the ill requests page and note that the table is empty.
3/ Note that under the networking tab in your browsers developer tools
that the api call fails with a 400 error.
4/ Apply the patch
5/ Refresh the page
6/ The table should now load and the api route should return a proper
200 response.
7/ Signoff
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Magnus Enger <magnus@libriotech.no>
Applied the patch to a production server that was having the 400
error on the main ILL page, and the error was gone. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40ab030060d6cbacb0be9df981fb28a6ade705ea)
Mason James [Sun, 24 May 2020 03:16:20 +0000 (15:16 +1200)]
Bug 25591: Update list-deps for Debian 10 and Ubuntu 20.04
This patch removes version-specific packages from the debian/control file,
which fixes a bug where koha-common can only be installed on the debian
version that the package was built on
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 5d9a51332d0cc932a4f23d757bbd6f5c38282df6)
Jonathan Druart [Tue, 21 Jul 2020 10:36:17 +0000 (12:36 +0200)]
Bug 26033: Use pic.infini.fr instead of framapic
https://framapic.org/ is closing
"""
Framapic will be closing its doors on Tuesday, January 12, 2021. You will find a similar service on this page.
Uploading images is now disabled, but you can still retrieve your images on the My images page.
"""
We can still use another service. However we may think about hosting the
service ourself!
Test plan:
Modify a selenium script to make it fail (for instance modify the path
for a find_element call)
Run it
Confirm that the screenshot has been uploaded correctly and that the
link works
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8aa907379eb54d360746c3e15051327a1e6cc1fe)
Nick Clemens [Thu, 21 May 2020 13:41:23 +0000 (13:41 +0000)]
Bug 25566: Add option to ignore found holds and use it when checking high holds
To test:
1 - Find or create a record with 10 items
2 - Set sysprefs:
decreaseLoanHighHolds - enable
decreaseLoanHighHoldsDuration - 2
decreaseLoanHighHoldsValue - 2
decreaseLoanHighHoldsControl - 'over the number of holdable items'/dynamic
3 - Set circ rules to allow 1 hold per record on the relevant record
4 - Place 3 holds on the record
5 - Check one item in and confirm hold to set to waiting
6 - Issue to the patron with the waiting hold
7 - Get a notice that loan period is decreased
8 - Don't confirm the checkout
9 - Apply patch
10 - Restart all the things
11 - Repeat checkout, no decrease this time!
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 96a871035043c7ffd93c61e756ee1ff89e3da0f0)
Jonathan Druart [Fri, 21 Aug 2020 12:00:51 +0000 (14:00 +0200)]
Bug 26270: Fix ThingISBN after a change in behaviour
This is just a guess! One of our tests is failing since today and we
don't modify anything in this area.
My guess is that the service is now returning the normalized version of
the ISBN
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
(cherry picked from commit 7a34b88885c13a89cd713bb76eadef11472c1960) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 23634: (QA follow-up) Our PUT is really a PATCH
This patch makes the controller not expect that there will always be all
the email fields. So it now checks if an email field was passed, and
changed, and renders the error if that stands.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Tests written by Nick highlight a problem
2. Apply this patch
3. Repeat 1
=> SUCCESS: Problems solved
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
(cherry picked from commit cc1e2ae3b73c7bc45f4cc2a05a3836e295453e0b) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>