mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
MDL-31025 navigation: When calling load_section_activities you must provide an array of activities not course_modinfo
This commit is contained in:
parent
90021290ee
commit
702cb900c3
@ -1707,24 +1707,17 @@ class global_navigation extends navigation_node {
|
||||
/**
|
||||
* Loads all of the activities for a section into the navigation structure.
|
||||
*
|
||||
* @todo 2.2 - $activities should always be an array and we should no longer check for it being a
|
||||
* course_modinfo object
|
||||
*
|
||||
* @param navigation_node $sectionnode
|
||||
* @param int $sectionnumber
|
||||
* @param course_modinfo $modinfo Object returned from {@see get_fast_modinfo()}
|
||||
* @param array $activities An array of activites as returned by {@see global_navigation::generate_sections_and_activities()}
|
||||
* @param stdClass $course The course object the section and activities relate to.
|
||||
* @return array Array of activity nodes
|
||||
*/
|
||||
protected function load_section_activities(navigation_node $sectionnode, $sectionnumber, $activities, $course = null) {
|
||||
protected function load_section_activities(navigation_node $sectionnode, $sectionnumber, array $activities, $course = null) {
|
||||
global $CFG;
|
||||
// A static counter for JS function naming
|
||||
static $legacyonclickcounter = 0;
|
||||
|
||||
if ($activities instanceof course_modinfo) {
|
||||
debugging('global_navigation::load_section_activities argument 3 should now recieve an array of activites. See that method for an example.', DEBUG_DEVELOPER);
|
||||
list($sections, $activities) = $this->generate_sections_and_activities($activities->course);
|
||||
}
|
||||
|
||||
$activitynodes = array();
|
||||
if (empty($activities)) {
|
||||
return $activitynodes;
|
||||
|
Loading…
x
Reference in New Issue
Block a user