Details
Description
Currently mod/resource/type/html/resource.class.php display() does not log resource page views if blocks are showing:-
/// Are we displaying the course blocks?
if ($this->resource->options == 'showblocks') {
parent::display_course_blocks_start();
// logging missing here
echo format_text($this->resource->alltext, FORMAT_HTML, $formatoptions, $this->course->id);
parent::display_course_blocks_end();
} else {
/// Set up generic stuff first, including checking for access
parent::display();
/// Set up some shorthand variables
$cm = $this->cm;
$course = $this->course;
$resource = $this->resource;
$pagetitle = strip_tags($course->shortname.': '.format_string($resource->name));
$inpopup = optional_param('inpopup', '', PARAM_BOOL);
// fix for MDL-9021, thanks Etienne Roz
add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id); // OK here
Easily resolved, but is there any reason not to make this correction?
Issue Links
| This issue is a clone of: | ||||
| MDL-9021 | View of html resource not adds in log in certain conditions |
|
|
|
Fixed in both HEAD (rev 1.42) and MOODLE_19_STABLE (rev 1.40.2.2). As in
MDL-9021, I moved add_to_log() out of any if { } statements. Thanks for the spotting!MDL-9021, I moved add_to_log() out of any if { } statements. Thanks for the spotting!