Go to file
Nick Clemens 6d675b61ad 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 7bb31cffae)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-07-24 21:48:29 +00:00
C4 Bug 25566: Add option to ignore found holds and use it when checking high holds 2020-07-24 20:54:48 +00:00
Koha Bug 25950: Remove <client> in X-Forwarded-For from proxy tests 2020-07-24 21:22:17 +00:00
acqui Bug 25611: Use selected vendor when creating a basket 2020-07-10 16:07:27 +00:00
admin Bug 25440: Fix for "uninitialized $maxsuspensiondays" in smart-rules.pl 2020-07-13 17:05:40 +00:00
api/v1 Bug 25944: Schema fix for illrequests route 2020-07-24 21:00:09 +00:00
authorities Bug 25428: Correctly encode link if authority subfield is a URL 2020-05-22 09:33:16 +01:00
basket Bug 17842: Simplify the code 2020-06-17 21:19:56 +00:00
catalogue Bug 23591: Hide archived suggestions 2020-04-14 16:36:41 +01:00
cataloguing Bug 25553: Make date columns sortable on the edit items table 2020-07-10 15:19:20 +00:00
circ Bug 25868: Fix transfers page to show effective itemtype 2020-07-24 21:43:21 +00:00
clubs Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
course_reserves Bug 22970: Allow to change homebranch in batch add course reserves 2020-05-12 11:40:54 +01:00
debian Bug 25752: Stay in cwd after koha-shell 2020-07-22 17:14:25 +00:00
docs Bug 21395: (QA follow-up) Remove some introduced issues 2020-07-13 16:45:15 +00:00
errors Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
etc Bug 23975: (RM follow-up) Comment example configuration 2020-05-22 12:09:29 +01:00
ill Bug 23173: (follow-up) Small improvements in efficiency 2020-04-06 11:05:09 +01:00
installer Bug 24379: Make login_attempts not nullable 2020-07-24 21:48:29 +00:00
koha-tmpl Bug 25868: Fix transfers page to show effective itemtype 2020-07-24 21:43:21 +00:00
labels Bug 24735: Remove QueryParser-related code 2020-03-02 11:13:03 +00:00
members Bug 25322: fix for not selected "relationship" defaults to father 2020-07-13 16:30:58 +00:00
misc Update release notes for the 20.05.02 release 2020-07-22 21:05:42 +00:00
offline_circ Bug 23463: Replace ModItem with Koha::Item->store 2020-03-23 09:26:30 +00:00
opac Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
patron_lists Bug 19524: Use existing logged_in_user variable 2018-07-18 16:49:30 +00:00
patroncards Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
plugins Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
pos Bug 25139: Corrections to date picker handling 2020-04-15 08:33:07 +01:00
reports Bug 21395: (QA follow-up) Remove some introduced issues 2020-07-13 16:45:15 +00:00
reserve Bug 25516: Fix for "Can't call method unblessed on unblessed reference" 2020-05-19 08:29:34 +01:00
reviews Bug 18789: Send Koha::Patron object to the templates 2018-02-16 13:03:58 -03:00
rotating_collections Bug 21500: Remove warnings in rotating collections 2018-10-09 15:02:45 +00:00
serials Bug 25081: Fix wrong comment 2020-04-08 11:53:37 +01:00
services Bug 20019: use Modern::Perl in misc perl scripts 2018-02-05 09:47:08 -03:00
skel Bug 11078: Add locking to rebuild_zebra 2014-02-28 22:21:41 +00:00
suggestion Bug 24819: (follow-up) Rename suggestor to suggester 2020-04-20 13:36:42 +01:00
svc Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
t Bug 24379: Make login_attempts not nullable 2020-07-24 21:48:29 +00:00
tags Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
tmp/modified_authorities
…
tools Bug 21395: (QA follow-up) Remove some introduced issues 2020-07-13 16:45:15 +00:00
virtualshelves Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
xt Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
.editorconfig Bug 24774: Set JSON indentation of 2 spaces in .editorconfig 2020-03-19 09:24:52 +00:00
.eslintrc.json Bug 23834: Add default ESLint configuration 2019-11-03 08:02:39 +00:00
.gitignore Bug 20427: Convert OPAC LESS to SCSS 2018-08-09 15:17:07 +00:00
.htaccess
…
.mailmap Update mailmap - Jonathan Druart 2017-06-21 12:42:19 -03:00
.perlcriticrc Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
.scss-lint.yml Bug 21237: Clean up staff client SCSS 2018-08-24 16:23:25 +00:00
INSTALL Bug 17626: Remove existing install instructions and link to the wiki pages instead 2016-11-22 11:29:07 +00:00
Koha.pm Increment version for 20.05.02 release 2020-07-22 20:59:18 +00:00
LICENSE
…
MANIFEST.SKIP
…
Makefile.PL Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
README
…
README.md Bug 15465: Fix typo in bugs.k-c.org 2017-05-26 11:45:31 -03:00
README.robots
…
about.pl Bug 25807: Add Template 3.008 to the exclude list 2020-07-13 16:03:14 +00:00
changelanguage.pl Bug 21299: (QA follow-up) Rename module and subroutine 2018-11-07 21:52:17 +00:00
cpanfile Bug 25807: Add Template 3.008 to the exclude list 2020-07-13 16:03:14 +00:00
fix-perl-path.PL Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
gulpfile.js Bug 21751: Replace fixFloat with HC-sticky to fix Chrome display 2019-02-04 14:13:35 +00:00
help.pl Bug 19817: Use the language from the interface if valid 2018-09-06 17:32:28 +00:00
koha_perl_deps.pl Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
kohaversion.pl Bug 13758: Move the Koha version from kohaversion.pl 2015-05-07 11:39:04 -03:00
mainpage.pl Bug 4461: Fix status and borrowernumber fields in problem_reports and more 2020-04-06 11:18:59 +01:00
package.json Bug 23025: security vulnerability detected in fstream < 1.0.12 defined in yarn.lock 2019-11-27 11:30:17 +00:00
rewrite-config.PL Bug 21395: Fix QA errors 2020-07-13 16:45:01 +00:00
yarn.lock Bug 23025: Update yarn.lock 2019-11-27 11:30:17 +00:00

README.md

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: This is a synced mirror of the official Koha repo.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo