Skip to content

Commit

Permalink
MDL-31270: Fix undefined variables
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed May 2, 2012
1 parent 9f135d5 commit 85fc0dc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mod/assign/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private function check_permissions() {
* @return string the name of the next page to display
*/
public function delete_plugin($plugin) {
global $CFG, $DB;
global $CFG, $DB, $OUTPUT;
$confirm = optional_param('confirm', null, PARAM_BOOL);

if ($confirm) {
Expand Down
1 change: 1 addition & 0 deletions mod/assign/gradeform.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function definition() {
* @param array $files
*/
function validation($data, $files) {
global $DB;
$errors = parent::validation($data, $files);
// advanced grading
if (!array_key_exists('grade', $data)) {
Expand Down
5 changes: 3 additions & 2 deletions mod/assign/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ private function update_grade($grade) {
* @return string
*/
private function view_plugin_content($pluginsubtype) {
global $CFG, $USER;
global $USER;

$o = '';

Expand Down Expand Up @@ -1609,6 +1609,7 @@ private function view_grading_page() {
* @return void
*/
private function plagiarism_print_disclosure() {
global $CFG;
$o = '';

if (!empty($CFG->enableplagiarism)) {
Expand Down Expand Up @@ -2891,7 +2892,7 @@ public function get_user_grades_for_gradebook($userid) {
$gradebookgrade = clone $result;
// now get the feedback
if ($gradebookplugin) {
$grade = $this->get_user_grade($grade->userid, false);
$grade = $this->get_user_grade($result->userid, false);
$gradebookgrade->feedbacktext = $gradebookplugin->text_for_gradebook($grade);
$gradebookgrade->feedbackformat = $gradebookplugin->format_for_gradebook($grade);
}
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/renderable.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public function __construct(context $context, $sid, $filearea, $component) {
public function preprocess($dir, $filearea, $component) {
global $CFG;
foreach ($dir['subdirs'] as $subdir) {
$this->preprocess($subdir, $filearea);
$this->preprocess($subdir, $filearea, $component);
}
foreach ($dir['files'] as $file) {
$file->portfoliobutton = '';
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/upgradelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private function duplicate_course_module(stdClass $cm, $moduleid, $newinstanceid
* @return bool
*/
private function delete_course_module($cm) {
global $CFG, $USER, $DB;
global $CFG, $USER, $DB, $OUTPUT;
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);

$coursecontext = context_course::instance($course->id);
Expand Down

0 comments on commit 85fc0dc

Please sign in to comment.