Bug 27297 - When itemtype is marked as required in OpacSuggestion MandatoryFields the field is not required
Summary: When itemtype is marked as required in OpacSuggestion MandatoryFields the fie...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-22 19:06 UTC by Nick Clemens
Modified: 2021-02-11 22:10 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02,20.05.09


Attachments
Bug 27297: Add required and blank options to av-build-dropbox.inc (2.95 KB, patch)
2020-12-22 19:31 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27297: Add required and blank options to av-build-dropbox.inc (3.01 KB, patch)
2020-12-29 23:29 UTC, Kelly McElligott
Details | Diff | Splinter Review
Bug 27297: Add required and blank options to av-build-dropbox.inc (3.37 KB, patch)
2021-01-11 12:51 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27297: Add required and blank options to av-build-dropbox.inc (3.44 KB, patch)
2021-01-15 21:49 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 27297: Add required and blank options to av-build-dropbox.inc (3.49 KB, patch)
2021-01-17 15:24 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-12-22 19:06:20 UTC
Two issues:
1 - We only add the required class, we don't make the input required
2 - We don't add a 'blank' option, so the field is preselected
Comment 1 Nick Clemens 2020-12-22 19:31:40 UTC
Created attachment 114620 [details] [review]
Bug 27297: Add required and blank options to av-build-dropbox.inc

This patch adds two options to av-build-drobx
required - which will add the required attribute to the select
blank - which will add a blank option to avoid preselecting others

To test:
1 - In OpacSuggestionMandatoryFeilds select itemtype
2 - Go to OPAC
3 - Add a suggestion
4 - Don't fill out any fields
5 - Submit
6 - Suggestion is added
7 - Delete it
8 - Apply patch
9 - Add a suggestion
10 - Note itemtyp edefaults to 'None'
11 - You cannot submit until you select a value
Comment 2 Kelly McElligott 2020-12-29 23:29:54 UTC
Created attachment 114737 [details] [review]
Bug 27297: Add required and blank options to av-build-dropbox.inc

This patch adds two options to av-build-drobx
required - which will add the required attribute to the select
blank - which will add a blank option to avoid preselecting others

To test:
1 - In OpacSuggestionMandatoryFeilds select itemtype
2 - Go to OPAC
3 - Add a suggestion
4 - Don't fill out any fields
5 - Submit
6 - Suggestion is added
7 - Delete it
8 - Apply patch
9 - Add a suggestion
10 - Note itemtyp edefaults to 'None'
11 - You cannot submit until you select a value

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 3 Katrin Fischer 2021-01-10 20:48:20 UTC
I am sorry, but this doesn't work correctly.

1) When itemtype is set to mandatory, the None option appears multiple times in the pull down, I believe once for every item type listed.

2) when itemtype is not set to mandatory, the None option doesn't appear as all, which means as you can't unselect the itemtype it's still kidna mandatory.

We need to fix 1) for sure,... but can we fix 2) please at the same time and always include a none option?
Comment 4 Nick Clemens 2021-01-11 12:51:00 UTC
Created attachment 115020 [details] [review]
Bug 27297: Add required and blank options to av-build-dropbox.inc

This patch adds two options to av-build-drobx
required - which will add the required attribute to the select
blank - which will add a blank option to avoid preselecting others

To test:
1 - In OpacSuggestionMandatoryFeilds select itemtype
2 - Go to OPAC
3 - Add a suggestion
4 - Don't fill out any fields
5 - Submit
6 - Suggestion is added
7 - Delete it
8 - Apply patch
9 - Add a suggestion
10 - Note itemtyp edefaults to 'None'
11 - You cannot submit until you select a value
Comment 5 PTFS Europe Sandboxes 2021-01-15 21:49:17 UTC
Created attachment 115215 [details] [review]
Bug 27297: Add required and blank options to av-build-dropbox.inc

This patch adds two options to av-build-drobx
required - which will add the required attribute to the select
blank - which will add a blank option to avoid preselecting others

To test:
1 - In OpacSuggestionMandatoryFeilds select itemtype
2 - Go to OPAC
3 - Add a suggestion
4 - Don't fill out any fields
5 - Submit
6 - Suggestion is added
7 - Delete it
8 - Apply patch
9 - Add a suggestion
10 - Note itemtyp edefaults to 'None'
11 - You cannot submit until you select a value

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 6 Katrin Fischer 2021-01-17 15:24:17 UTC
Created attachment 115219 [details] [review]
Bug 27297: Add required and blank options to av-build-dropbox.inc

This patch adds two options to av-build-drobx
required - which will add the required attribute to the select
blank - which will add a blank option to avoid preselecting others

To test:
1 - In OpacSuggestionMandatoryFeilds select itemtype
2 - Go to OPAC
3 - Add a suggestion
4 - Don't fill out any fields
5 - Submit
6 - Suggestion is added
7 - Delete it
8 - Apply patch
9 - Add a suggestion
10 - Note itemtyp edefaults to 'None'
11 - You cannot submit until you select a value

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2021-01-17 15:25:03 UTC
Thx Nick, no complaints this time :)
Comment 8 Jonathan Druart 2021-01-19 15:24:15 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 9 Fridolin Somers 2021-01-20 09:00:34 UTC
Pushed to 20.11.x for 20.11.02
Comment 10 Andrew Fuerste-Henry 2021-01-29 18:39:46 UTC
Pushed to 20.05.x for 20.05.09
Comment 11 Victor Grousset/tuxayo 2021-02-01 19:50:44 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.