Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
417a273d
Commit
417a273d
authored
Dec 10, 2009
by
Sam Hemelryk
Browse files
navigation MDL-20735 Fixed issue with unset cm contexts for front page course
parent
8f685009
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/navigationlib.php
View file @
417a273d
...
...
@@ -1281,6 +1281,11 @@ class global_navigation extends navigation_node {
}
$file
=
$CFG
->
dirroot
.
'/mod/'
.
$module
->
name
.
'/lib.php'
;
$function
=
$module
->
name
.
'_extend_navigation'
;
if
(
empty
(
$PAGE
->
cm
->
context
))
{
$PAGE
->
cm
->
context
=
get_context_instance
(
CONTEXT_MODULE
,
$PAGE
->
cm
->
instance
);
}
if
(
file_exists
(
$file
))
{
require_once
(
$file
);
if
(
function_exists
(
$function
))
{
...
...
@@ -2940,6 +2945,14 @@ class settings_navigation extends navigation_node {
return
;
}
if
(
empty
(
$this
->
page
->
cm
->
context
))
{
if
(
$this
->
context
->
instanceid
===
$this
->
page
->
cm
->
id
)
{
$this
->
page
->
cm
->
context
=
$this
->
context
;
}
else
{
$this
->
page
->
cm
->
context
=
get_context_instance
(
CONTEXT_MODULE
,
$this
->
page
->
cm
->
instance
);
}
}
$module
=
$DB
->
get_record
(
'modules'
,
array
(
'id'
=>
$this
->
page
->
cm
->
module
));
if
(
!
$module
)
{
debugging
(
'Invalid Module ID picked up while attempting to load the activity for the navigation'
,
DEBUG_DEVELOPER
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment