Bug 20781 - 0 months is not a valid enrollment period and causes errors
Summary: 0 months is not a valid enrollment period and causes errors
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-18 14:00 UTC by Nick Clemens
Modified: 2019-10-14 19:57 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20781: Set a minimum enrollemnt period 'in months' of 1 (1.61 KB, patch)
2018-05-18 14:04 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 20781: Set a minimum enrollemnt period 'in months' of 1 (1.66 KB, patch)
2018-05-18 14:23 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20781: Set a minimum enrollemnt period 'in months' of 1 (1.76 KB, patch)
2018-05-25 08:26 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20781: (QA follow-up) Remove unneeded rules (1.21 KB, patch)
2018-05-25 08:26 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2018-05-18 14:00:52 UTC
To recreate:
1 - Browse to Admin->Patron Categories
2 - Click '+ New category'
3 - Enter data as required, however, enter 0 in 'Enrolment period' -> 'in months'
4 - Save
5 - View the list of categories, the new category has 'Enrolment period' = 'until'
6 - Create a patron in this category
7 - Search for them
8 - internal server error
Comment 1 Nick Clemens 2018-05-18 14:04:21 UTC
Created attachment 75433 [details] [review]
Bug 20781: Set a minimum enrollemnt period 'in months' of 1

To test:
 1 - Browse to Admin->Patron Categories
 2 - Click '+ New category'
 3 - Enter data as required, however, enter 0 in 'Enrolment period' ->
'in months'
 4 - Save
 5 - View the list of categories, the new category has 'Enrolment period'
= 'until'
 6 - Create a patron in this category, note their dateexipry is
'0000-00-00'
 7 - Search for them
 8 - internal server error
 9 - Delete that patron
10 - Apply patch
11 - Edit the category, note you cannot save with 0 months
12 - Set 1 month and save
13 - Create a patron in this cateogry
14 - Note they have a valid dateexpiry
15 - Search for them
16 - All works
17 - Create a new category and verify you cannot add with 0 months
Comment 2 Owen Leonard 2018-05-18 14:23:07 UTC
Created attachment 75437 [details] [review]
Bug 20781: Set a minimum enrollemnt period 'in months' of 1

To test:
 1 - Browse to Admin->Patron Categories
 2 - Click '+ New category'
 3 - Enter data as required, however, enter 0 in 'Enrolment period' ->
'in months'
 4 - Save
 5 - View the list of categories, the new category has 'Enrolment period'
= 'until'
 6 - Create a patron in this category, note their dateexipry is
'0000-00-00'
 7 - Search for them
 8 - internal server error
 9 - Delete that patron
10 - Apply patch
11 - Edit the category, note you cannot save with 0 months
12 - Set 1 month and save
13 - Create a patron in this cateogry
14 - Note they have a valid dateexpiry
15 - Search for them
16 - All works
17 - Create a new category and verify you cannot add with 0 months

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Marcel de Rooy 2018-05-25 08:26:49 UTC
Created attachment 75553 [details] [review]
Bug 20781: Set a minimum enrollemnt period 'in months' of 1

To test:
 1 - Browse to Admin->Patron Categories
 2 - Click '+ New category'
 3 - Enter data as required, however, enter 0 in 'Enrolment period' ->
'in months'
 4 - Save
 5 - View the list of categories, the new category has 'Enrolment period'
= 'until'
 6 - Create a patron in this category, note their dateexipry is
'0000-00-00'
 7 - Search for them
 8 - internal server error
 9 - Delete that patron
10 - Apply patch
11 - Edit the category, note you cannot save with 0 months
12 - Set 1 month and save
13 - Create a patron in this cateogry
14 - Note they have a valid dateexpiry
15 - Search for them
16 - All works
17 - Create a new category and verify you cannot add with 0 months

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2018-05-25 08:26:53 UTC
Created attachment 75554 [details] [review]
Bug 20781: (QA follow-up) Remove unneeded rules

These rules do not have any meaning.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Nick Clemens 2018-05-29 14:09:07 UTC
(In reply to Marcel de Rooy from comment #4)
> Created attachment 75554 [details] [review] [review]
> Bug 20781: (QA follow-up) Remove unneeded rules
> 
> These rules do not have any meaning.
> 
> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Hmm...without these rules we can enter a value in both fields - going to skip this patch
Comment 6 Nick Clemens 2018-05-29 14:39:41 UTC
Pushed to master for 18.11.

Awesome work all, thank you.
Comment 7 Martin Renvoize 2018-06-05 10:39:36 UTC
This patch has been pushed to 18.05.x and will be in 18.05.01

Also skipped the second patch here.
Comment 8 Fridolin Somers 2018-06-07 06:03:22 UTC
Pushed to 17.11.x for 17.11.07