Bug 31294

Summary: Article requests: Mandatory subfields in OPAC don't show they are required
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: David Cook <dcook>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low CC: dcook, lucas, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00,22.05.06,21.11.12
Attachments: Bug 31294: Show "Required" label on mandatory fields
Bug 31294: Show "Required" label on mandatory fields
Bug 31294: Show "Required" label on mandatory fields

Description Katrin Fischer 2022-08-05 09:46:45 UTC
There are 3 system preference to mark fields mandatory in the article request form for different use cases: ArticleRequestsMandatory*

If you set fields to mandatory, they will trigger a message on saving, but they are missing the visible markup so you can tell right away that they are mandatory.
Comment 1 David Cook 2022-08-11 05:41:46 UTC
Created attachment 139013 [details] [review]
Bug 31294: Show "Required" label on mandatory fields

This patch adds "Required" label on mandatory fields for Article Requests

0. Apply the patch
1. koha-plack --restart kohadev
2. Change syspref 'ArticleRequests' to 'Enable'
3. Change syspref 'ArticleRequestsMandatoryFields' to '[Select all]'
4. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
5. Click "Request article" for "Gairm"
6. Note that "Title", "Author", "Volume", "Issue", "Date", "Pages", and "Chapters" all say required
7. Change syspref 'ArticleRequestsMandatoryFields' to 'Title' and 'Author'
8. Go to http://localhost:8080/cgi-bin/koha/opac-request-article.pl?biblionumber=29
9. Note that only "Title" and "Author" say required
Comment 2 Owen Leonard 2022-08-11 14:35:40 UTC
Created attachment 139023 [details] [review]
Bug 31294: Show "Required" label on mandatory fields

This patch adds "Required" label on mandatory fields for Article Requests

0. Apply the patch
1. koha-plack --restart kohadev
2. Change syspref 'ArticleRequests' to 'Enable'
3. Change syspref 'ArticleRequestsMandatoryFields' to '[Select all]'
4. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
5. Click "Request article" for "Gairm"
6. Note that "Title", "Author", "Volume", "Issue", "Date", "Pages", and
   "Chapters" all say required
7. Change syspref 'ArticleRequestsMandatoryFields' to 'Title' and
   'Author'
8. Go to http://localhost:8080/cgi-bin/koha/opac-request-article.pl?biblionumber=29
9. Note that only "Title" and "Author" say required

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Katrin Fischer 2022-08-12 13:51:36 UTC
Created attachment 139055 [details] [review]
Bug 31294: Show "Required" label on mandatory fields

This patch adds "Required" label on mandatory fields for Article Requests

0. Apply the patch
1. koha-plack --restart kohadev
2. Change syspref 'ArticleRequests' to 'Enable'
3. Change syspref 'ArticleRequestsMandatoryFields' to '[Select all]'
4. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
5. Click "Request article" for "Gairm"
6. Note that "Title", "Author", "Volume", "Issue", "Date", "Pages", and
   "Chapters" all say required
7. Change syspref 'ArticleRequestsMandatoryFields' to 'Title' and
   'Author'
8. Go to http://localhost:8080/cgi-bin/koha/opac-request-article.pl?biblionumber=29
9. Note that only "Title" and "Author" say required

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

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 4 Tomás Cohen Arazi 2022-08-16 18:32:28 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 5 Lucas Gass 2022-10-03 22:17:52 UTC
Backported to 22.05.x for 22.05.06
Comment 6 Victor Grousset/tuxayo 2022-10-16 21:13:53 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document it seems, marking resolved.
Comment 7 Arthur Suzuki 2022-10-22 22:09:55 UTC
Thanks!

Pushed to 21.11 for 21.11.12