Permalink
Browse files

MDL-32251 more E_STRICT fixes

  • Loading branch information...
1 parent 9aa09d8 commit 54352ac9794b3c364e4b3b9b97d71a0c77425bcd @skodak skodak committed Mar 30, 2012
@@ -254,7 +254,7 @@ function get_data() {
return $data;
}
- function validation(&$data, $files) {
+ function validation($data, $files) {
global $DB;
$errors = parent::validation($data, $files);
View
@@ -651,7 +651,7 @@ public static function delete_comments($param) {
*
* @param stdClass $context course context
*/
- public function reset_course_page_comments($context) {
+ public static function reset_course_page_comments($context) {
global $DB;
$contexts = array();
$contexts[] = $context->id;
@@ -656,7 +656,7 @@ function add_completion_rules() {
* @return bool True if one or more rules is enabled, false if none are;
* default returns false
*/
- function completion_rule_enabled(&$data) {
+ function completion_rule_enabled($data) {
return false;
}
@@ -160,6 +160,7 @@
$mform->set_data($grade);
} else {
+ $grade = new stdClass();
$grade->feedback = array('text'=>'', 'format'=>FORMAT_HTML);
$mform->set_data(array('itemid'=>$itemid, 'userid'=>$userid, 'locked'=>$grade_item->locked, 'locktime'=>$grade_item->locktime));
}
@@ -280,6 +280,10 @@ private function setup_sortitemid() {
global $SESSION;
+ if (!isset($SESSION->gradeuserreport)) {
+ $SESSION->gradeuserreport = new stdClass();
+ }
+
if ($this->sortitemid) {
if (!isset($SESSION->gradeuserreport->sort)) {
if ($this->sortitemid == 'firstname' || $this->sortitemid == 'lastname') {
@@ -439,7 +443,7 @@ public function load_final_grades() {
foreach ($grades as $graderec) {
if (in_array($graderec->userid, $userids) and array_key_exists($graderec->itemid, $this->gtree->get_items())) { // some items may not be present!!
$this->grades[$graderec->userid][$graderec->itemid] = new grade_grade($graderec, false);
- $this->grades[$graderec->userid][$graderec->itemid]->grade_item =& $this->gtree->get_item($graderec->itemid); // db caching
+ $this->grades[$graderec->userid][$graderec->itemid]->grade_item = $this->gtree->get_item($graderec->itemid); // db caching
}
}
}
@@ -451,7 +455,7 @@ public function load_final_grades() {
$this->grades[$userid][$itemid] = new grade_grade();
$this->grades[$userid][$itemid]->itemid = $itemid;
$this->grades[$userid][$itemid]->userid = $userid;
- $this->grades[$userid][$itemid]->grade_item =& $this->gtree->get_item($itemid); // db caching
+ $this->grades[$userid][$itemid]->grade_item = $this->gtree->get_item($itemid); // db caching
}
}
}
View
@@ -102,6 +102,7 @@
if (!$section = $DB->get_record('course_sections', array('course'=>$SITE->id, 'section'=>1))) {
$DB->delete_records('course_sections', array('course'=>$SITE->id, 'section'=>1)); // Just in case
+ $section = new stdClass();
$section->course = $SITE->id;
$section->section = 1;
$section->summary = '';
View
@@ -295,7 +295,7 @@ function choice_user_submit_response($formanswer, $choice, $userid, $course, $cm
$DB->update_record("choice_answers", $newanswer);
add_to_log($course->id, "choice", "choose again", "view.php?id=$cm->id", $choice->id, $cm->id);
} else {
- $newanswer = NULL;
+ $newanswer = stdClass();
$newanswer->choiceid = $choice->id;
$newanswer->userid = $userid;
$newanswer->optionid = $formanswer;
View
@@ -216,6 +216,7 @@
/// Insert a whole lot of empty records to make sure we have them
$fields = $DB->get_records('data_fields', array('dataid'=>$data->id));
foreach ($fields as $field) {
+ $content = new stdClass();
$content->recordid = $recordid;
$content->fieldid = $field->id;
$DB->insert_record('data_content',$content);
@@ -149,7 +149,7 @@ function display_browse_field($recordid, $template) {
// content: "a##b" where a is the file name, b is the display name
- function update_content($recordid, $value, $name) {
+ function update_content($recordid, $value, $name='') {
global $CFG, $DB, $USER;
$fs = get_file_storage();
@@ -197,7 +197,7 @@ function update_field() {
return true;
}
- function update_content($recordid, $value, $name) {
+ function update_content($recordid, $value, $name='') {
global $CFG, $DB, $USER;
if (!$content = $DB->get_record('data_content', array('fieldid'=>$this->field->id, 'recordid'=>$recordid))) {
View
@@ -145,7 +145,8 @@ function wiki_get_current_version($pageid) {
FROM {wiki_versions}
WHERE pageid = ?
ORDER BY version DESC";
- return array_pop($DB->get_records_sql($sql, array($pageid), 0, 1));
+ $records = $DB->get_records_sql($sql, array($pageid), 0, 1);
+ return array_pop($records);
}
View
@@ -764,7 +764,7 @@ protected function create_navbar() {
}
}
- protected function setup_tabs() {
+ protected function setup_tabs($options = array()) {
parent::setup_tabs(array('linkedwhenactive' => 'comments', 'activetab' => 'comments'));
}
@@ -990,7 +990,7 @@ function set_url() {
$PAGE->set_url($CFG->wwwroot . '/mod/wiki/edit.php', $params);
}
- protected function setup_tabs() {
+ protected function setup_tabs($options = array()) {
parent::setup_tabs(array('linkedwhenactive' => 'view', 'activetab' => 'view'));
}
@@ -1096,7 +1096,7 @@ protected function create_navbar() {
$PAGE->navbar->add(get_string('diff', 'wiki'));
}
- protected function setup_tabs() {
+ protected function setup_tabs($options = array()) {
parent::setup_tabs(array('linkedwhenactive' => 'history', 'activetab' => 'history'));
}
@@ -1854,7 +1854,7 @@ protected function create_navbar() {
$PAGE->navbar->add(get_string('restoreversion', 'wiki'));
}
- protected function setup_tabs() {
+ protected function setup_tabs($options = array()) {
parent::setup_tabs(array('linkedwhenactive' => 'history', 'activetab' => 'history'));
}
@@ -1922,7 +1922,7 @@ protected function create_navbar() {
$PAGE->navbar->add(get_string('deletecommentcheck', 'wiki'));
}
- protected function setup_tabs() {
+ protected function setup_tabs($options = array()) {
parent::setup_tabs(array('linkedwhenactive' => 'comments', 'activetab' => 'comments'));
}
@@ -2089,7 +2089,7 @@ protected function create_navbar() {
$PAGE->navbar->add(get_string('versionnum', 'wiki', $this->version->version));
}
- protected function setup_tabs() {
+ protected function setup_tabs($options = array()) {
parent::setup_tabs(array('linkedwhenactive' => 'history', 'activetab' => 'history', 'inactivetabs' => array('edit')));
}

0 comments on commit 54352ac

Please sign in to comment.