mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-67307 core: Fix onject creation from empty value cases
The "creating default object from empty value" warning is now consistently thrown if a falsy value is promoted into an stdClass object. Previously some cases like `$null->prop[0] = $val` missed this warning.
This commit is contained in:
parent
a5f618d6a9
commit
88d88bd92e
2 changed files with 5 additions and 0 deletions
|
@ -3251,6 +3251,9 @@ class initials_bar implements renderable, templatable {
|
||||||
if ($letter == $this->current) {
|
if ($letter == $this->current) {
|
||||||
$groupletter->selected = $this->current;
|
$groupletter->selected = $this->current;
|
||||||
}
|
}
|
||||||
|
if (!isset($data->group[$groupnumber])) {
|
||||||
|
$data->group[$groupnumber] = new stdClass();
|
||||||
|
}
|
||||||
$data->group[$groupnumber]->letter[] = $groupletter;
|
$data->group[$groupnumber]->letter[] = $groupletter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2457,6 +2457,8 @@ class assign {
|
||||||
* @return array An array of userids
|
* @return array An array of userids
|
||||||
*/
|
*/
|
||||||
protected function get_grading_userid_list($cached = false, $useridlistid = '') {
|
protected function get_grading_userid_list($cached = false, $useridlistid = '') {
|
||||||
|
global $SESSION;
|
||||||
|
|
||||||
if ($cached) {
|
if ($cached) {
|
||||||
if (empty($useridlistid)) {
|
if (empty($useridlistid)) {
|
||||||
$useridlistid = $this->get_useridlist_key_id();
|
$useridlistid = $this->get_useridlist_key_id();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue