Skip to content

Commit

Permalink
M4.4 work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Apr 4, 2024
1 parent fd6bf7d commit 5f4dcc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,17 @@ public function get_view_url($section, $options = []) {
} else {
$sectionno = $section;
}
if ((!empty($options['navigation']) || array_key_exists('sr', $options)) && $sectionno !== null) {
if ((!empty($options['navigation'])) && $sectionno !== null) {
// Display section on separate page.
$sectioninfo = $this->get_section($sectionno);
return new moodle_url('/course/section.php', ['id' => $sectioninfo->id]);
}
if ($this->uses_sections() && $sectionno !== null) {
$url->set_anchor('section-'.$sectionno);
if ($this->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {
$url->param('section', $sectionno);
} else {
$url->set_anchor('section-'.$sectionno);
}
}

return $url;
Expand Down
2 changes: 1 addition & 1 deletion tests/privacy_provider_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected static function set_property($obj, $name, $value): void {
* @param stdClass $obj The object.
* @param string $name Name of the method.
*/
protected static function get_property($obj, $name): ReflectionClass {
protected static function get_property($obj, $name): \ReflectionClass {
// Ref: http://stackoverflow.com/questions/18558183/phpunit-mockbuilder-set-mock-object-internal-property ish.
$class = new \ReflectionClass($obj);
$property = $class->getProperty($name);
Expand Down

0 comments on commit 5f4dcc1

Please sign in to comment.