Bug 31619 - Cannot select title when setting non-default value for OPACSuggestionMandatoryFields
Summary: Cannot select title when setting non-default value for OPACSuggestionMandator...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Galen Charlton
QA Contact: Marcel de Rooy
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-09-23 18:45 UTC by Galen Charlton
Modified: 2023-12-28 20:42 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the OPACSuggestionMandatoryFields system preference so that the title field is visible and marked as mandatory (in red).
Version(s) released in:
22.11.00, 22.05.08


Attachments
Bug 31619: add title back to list of OPACSuggestionMandatoryFields options (1.22 KB, patch)
2022-09-23 18:55 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 31619: add title back to list of OPACSuggestionMandatoryFields options (1.27 KB, patch)
2022-09-27 19:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 31619: add title back to list of OPACSuggestionMandatoryFields options (1.36 KB, patch)
2022-10-07 06:30 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 Galen Charlton 2022-09-23 18:45:56 UTC
Possibly because of a timing issue when the patches for bug 29695 were merged, "title" is no longer listed as an option on the value list for OPACSuggestionMandatoryFields.

As a consequence, if that system preference is set to any non-default value, it becomes impossible to have the title field be mandatory on the OPAC purchase suggestion form.
Comment 1 Galen Charlton 2022-09-23 18:55:39 UTC
Created attachment 140963 [details] [review]
Bug 31619: add title back to list of OPACSuggestionMandatoryFields options

This patch fixes a regression introduced by bug 29695 that prevented
setting the title as a required field when setting the
OPACSuggestionMandatoryFields to a non-default value.

To test:

[1] Set OPACSuggestionMandatoryFields in the system preferences
    editor and note that 'title' is not listed in the modal
    that is displayed.
[2] Apply the patch.
[3] Revist the system preference editor and note that 'title'
    is now displayed as an option.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Comment 2 David Nind 2022-09-23 22:00:23 UTC
The patch adds the title to the list of fields and is in red, however it can't be made optional - that is, it is still mandatory.

Happy to sign off if this is what is intended.
Comment 3 Galen Charlton 2022-09-26 14:48:03 UTC
I confirm that that is intended behavior - see commit 432f296b965 for bug 26296. (Also, with the possible exception of asking the library to buy a piece of equipment, most anything a patron would ask a library to purchase would have a title at minimum.)
Comment 4 David Nind 2022-09-27 19:19:11 UTC
(In reply to Galen Charlton from comment #3)
> I confirm that that is intended behavior - see commit 432f296b965 for bug
> 26296. (Also, with the possible exception of asking the library to buy a
> piece of equipment, most anything a patron would ask a library to purchase
> would have a title at minimum.)

Thanks Galen for clarifying. Sign off on the way!
Comment 5 David Nind 2022-09-27 19:20:21 UTC
Created attachment 141039 [details] [review]
Bug 31619: add title back to list of OPACSuggestionMandatoryFields options

This patch fixes a regression introduced by bug 29695 that prevented
setting the title as a required field when setting the
OPACSuggestionMandatoryFields to a non-default value.

To test:

[1] Set OPACSuggestionMandatoryFields in the system preferences
    editor and note that 'title' is not listed in the modal
    that is displayed.
[2] Apply the patch.
[3] Revist the system preference editor and note that 'title'
    is now displayed as an option.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Marcel de Rooy 2022-09-30 07:33:40 UTC
Thanks for your patch, Galen.
Note that title does not belong to biblioitems, but to biblio.
And that the pref explains that title is always mandatory and therefore not listed. You cannot deselect it.
So we either skip this change or move the explanation to the popup form somehow?
Comment 7 Galen Charlton 2022-10-03 17:57:51 UTC
(In reply to Marcel de Rooy from comment #6)
> Thanks for your patch, Galen.
> Note that title does not belong to biblioitems, but to biblio.

The patch adds an entry for "title" as a column in the suggestions table, not biblio nor biblioitems.

> And that the pref explains that title is always mandatory and therefore not
> listed. You cannot deselect it.
> So we either skip this change or move the explanation to the popup form
> somehow?

Without the patch, any attempt to change the value of OPACSuggestionMandatoryFields to a non-default value will cause the title to not be marked as required; the "title" field is not permanently considered required by the code that reads the value of the system preference unless that preference value is blank.

Setting status back to signed off and requesting re-review.
Comment 8 Marcel de Rooy 2022-10-07 06:30:19 UTC
(In reply to Galen Charlton from comment #7)

> The patch adds an entry for "title" as a column in the suggestions table,
> not biblio nor biblioitems.

Ah, you are right. I just stumbled over an earlier occurrence in the wrong place (i.e. biblioitems). Sorry for that.
Comment 9 Marcel de Rooy 2022-10-07 06:30:55 UTC
Created attachment 141478 [details] [review]
Bug 31619: add title back to list of OPACSuggestionMandatoryFields options

This patch fixes a regression introduced by bug 29695 that prevented
setting the title as a required field when setting the
OPACSuggestionMandatoryFields to a non-default value.

To test:

[1] Set OPACSuggestionMandatoryFields in the system preferences
    editor and note that 'title' is not listed in the modal
    that is displayed.
[2] Apply the patch.
[3] Revist the system preference editor and note that 'title'
    is now displayed as an option.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Tomás Cohen Arazi 2022-10-11 13:10:02 UTC
Gotta say... I'm really happy to push a patch from you, Galen :-D
Comment 11 Tomás Cohen Arazi 2022-10-11 13:24:03 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 12 Lucas Gass 2022-12-05 18:05:25 UTC
Backported to 22.05.x for upcoming 22.05.08
Comment 13 Arthur Suzuki 2022-12-14 14:06:24 UTC
Koha/Database/Columns.pm doesn't exist on 21.11.
Patch doesn't apply here (not needed most probably)