Affects Version/s: 2.6.5
Fix Version/s: None
Inside a course, go to Grade administration > Course grade settings (In grade/edit/settings/index.php?id=xxx) and change the value for "Grade display type".
For example we select "Real" for "Grade display type", the displaytype options look like this:
In the database there is now a row for displaytype with value 1 in mdl_grade_settings:
This is the way one would expect this to work for all values. In the list there is selected="selected" on value="1" and we have a row for the displaytype setting in the database.
When selecting "Default (Real)", things behave differently.
There is no option selected and no row for displaytype in mdl_grade_settings.
For english language the bug is not noticeable. The "Grade display type" dropdown sorts items alphabetically.
"Default (Real)" is the first item in the alphabetical list, so it is selected by default when there's no value for displaytype in the database.
For other languages, the order of items can be different. For example in Finnish the list looks like this.
In this case "Kirjain" would be selected and mistakenly saved when the user clicks on "Save changes".