Bug 20682 - Authorised values should have an option to set a default
Summary: Authorised values should have an option to set a default
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-30 03:38 UTC by Hugh Rundle
Modified: 2024-04-15 20:22 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hugh Rundle 2018-04-30 03:38:08 UTC
There are many places in Koha where values can be chosen via a drop-down menu listing a particular authorised value. For example SUGGEST_FORMAT is used to populate the list of formats that can be selected when placing a purchase suggestion. Currently these lists appear in alphabetical order by description or OPAC description (depending on context), and the first option in the list is usually auto-selected (i.e. more or less default behaviour for a vanilla HTML <select> element). This is problematic in many circumstances as users will accidentally 'select' the first alphabetical option if they don't change anything.

There should be a setting in Authorised Values to set between zero and one values per category to be the default value (probably in authorised_values.pl?op=add_form). This would then add a 'selected' attribute to the <option> tag wherever the authorised value list appears as a dropdown menu.
Comment 1 Marcel de Rooy 2022-09-15 09:02:03 UTC
(In reply to Hugh Rundle from comment #0)
> There are many places in Koha where values can be chosen via a drop-down
> menu listing a particular authorised value. For example SUGGEST_FORMAT is
> used to populate the list of formats that can be selected when placing a
> purchase suggestion. Currently these lists appear in alphabetical order by
> description or OPAC description (depending on context), and the first option
> in the list is usually auto-selected (i.e. more or less default behaviour
> for a vanilla HTML <select> element). This is problematic in many
> circumstances as users will accidentally 'select' the first alphabetical
> option if they don't change anything.

Good observation.
 
> There should be a setting in Authorised Values to set between zero and one
> values per category to be the default value (probably in
> authorised_values.pl?op=add_form). This would then add a 'selected'
> attribute to the <option> tag wherever the authorised value list appears as
> a dropdown menu.

Not sure if we should address it like that. You might have two columns using one AV category where one column may be NULL and the other one not.

"This would add a selected attribute" => That might be a lot of work checking all templates.. Probably address the most striking cases first?
Comment 2 Marcel de Rooy 2022-09-15 09:04:05 UTC
About the select. Found this on stackoverflow:

<select>
    <option style="display:none;"></option>
    <option>Option 1</option>
[etc]

OR

<select class="first-opt-hidden">
    <option></option>
    <option>Option 1</option>
[etc]
WITH css:
select.first-opt-hidden option:first-of-type {
  display:none;
}
Comment 3 Niamh Walker-Headon 2023-02-14 13:47:15 UTC
The select option might work, but coding could get lost at upgrade stage, so I think it would be better to have the option to set a default value.