Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.8.3
-
Fix Version/s: None
-
Component/s: Blocks
-
Labels:None
-
Database:MySQL
-
Affected Branches:MOODLE_18_STABLE
Description
Sometime in first or course pages presents Notice and Warnings from blocklib.php file.
The function block_have_content () works notcorrectly with the pointer:
operator
$instance = &$pageblocks[$position][$n];
this is tantamount of
$instance = null;
$pageblocks[$position][$n] = &$instance;
if iteracion breacked, in array present non-object var.
Befor $instance = &$pageblocks[$position][$n]; need adds:
if (!isset($pageblocks[$position][$n])) {continue;}
or other restructured of code.
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
Still exists in 1.8.5+
It's mostly an annoyance in the logs as some blog returned NULL for us. The fix could change little with the check of !isset($instance->visible)
for ($n=0; $n<count($pageblocks[$position]);$n++) {
$instance = &$pageblocks[$position][$n];
if(!isset($instance->visible) || !$instance->visible) { continue; }