mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-67049 grading: options are array, ensure json_decode() knows it
By default json_decode() returns object for associative arrays. That was not a problem till now becuause array_key_exists() worked with objects too. But in php74 that emits a warning. So we need to ensure that the information arriving to it is an array, allowing everything to continue working ok.
This commit is contained in:
parent
a5f618d6a9
commit
8e98f82f12
1 changed files with 1 additions and 1 deletions
|
@ -386,7 +386,7 @@ class gradingform_rubric_controller extends gradingform_controller {
|
|||
public function get_options() {
|
||||
$options = self::get_default_options();
|
||||
if (!empty($this->definition->options)) {
|
||||
$thisoptions = json_decode($this->definition->options);
|
||||
$thisoptions = json_decode($this->definition->options, true); // Assoc. array is expected.
|
||||
foreach ($thisoptions as $option => $value) {
|
||||
$options[$option] = $value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue