Bug 27297

Summary: When itemtype is marked as required in OpacSuggestion MandatoryFields the field is not required
Product: Koha Reporter: Nick Clemens <nick>
Component: OPACAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrewfh, barbara.johnson, caroline.cyr-la-rose, fridolin.somers, jonathan.druart, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
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
Bug 27297: Add required and blank options to av-build-dropbox.inc
Bug 27297: Add required and blank options to av-build-dropbox.inc
Bug 27297: Add required and blank options to av-build-dropbox.inc
Bug 27297: Add required and blank options to av-build-dropbox.inc

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.
Comment 12 Jonathan Druart 2023-07-05 10:40:59 UTC
Just noting: Bug 18680 added "empty" for the same purpose at the staff side. This added "blank" for OPAC.