Permalink
Browse files

MDL-29400 Fixing unset object bug encountered by Rajesh during testing

  • Loading branch information...
1 parent e0c0039 commit 0c5e3d45646ebe62140d519c04a5599bc535291d Gerard (Gerry) Caulfield committed with stronk7 Dec 22, 2011
@@ -1069,7 +1069,7 @@ function extend_settings_navigation($node) {
}
// If the user has submitted something add some related links and data
- if ($submission->data2 == 'submitted') {
+ if (isset($submission->data2) AND $submission->data2 == 'submitted') {
// Add a view link to the settings nav
$link = new moodle_url('/mod/assignment/view.php', array('id'=>$this->cm->id));
$node->add(get_string('viewmysubmission', 'assignment'), $link, navigation_node::TYPE_SETTING);
@@ -319,7 +319,7 @@ function extend_settings_navigation($node) {
}
// If the user has submitted something add some related links and data
- if ($submission->numfiles) {
+ if (isset($submission->numfiles) AND $submission->numfiles) {
// Add a view link to the settings nav
$link = new moodle_url('/mod/assignment/view.php', array('id'=>$this->cm->id));
$node->add(get_string('viewmysubmission', 'assignment'), $link, navigation_node::TYPE_SETTING);

0 comments on commit 0c5e3d4

Please sign in to comment.