MDL-32251 more E_STRICT fixes
This commit is contained in:
@@ -254,7 +254,7 @@ class web_service_token_form extends moodleform {
|
||||
return $data;
|
||||
}
|
||||
|
||||
function validation(&$data, $files) {
|
||||
function validation($data, $files) {
|
||||
global $DB;
|
||||
|
||||
$errors = parent::validation($data, $files);
|
||||
|
||||
+1
-1
@@ -651,7 +651,7 @@ class comment {
|
||||
*
|
||||
* @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 @@ abstract class moodleform_mod extends moodleform {
|
||||
* @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 @@ if ($grade = $DB->get_record('grade_grades', array('itemid' => $grade_item->id,
|
||||
|
||||
$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 @@ class grade_report_grader extends grade_report {
|
||||
|
||||
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 @@ class grade_report_grader extends grade_report {
|
||||
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 @@ class grade_report_grader extends grade_report {
|
||||
$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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 = '';
|
||||
|
||||
+1
-1
@@ -295,7 +295,7 @@ WHERE
|
||||
$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;
|
||||
|
||||
@@ -216,6 +216,7 @@ if ($datarecord = data_submitted() and confirm_sesskey()) {
|
||||
/// 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 @@ class data_field_file extends data_field_base {
|
||||
|
||||
|
||||
// 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 @@ class data_field_picture extends data_field_base {
|
||||
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))) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -764,7 +764,7 @@ class page_wiki_editcomment extends page_wiki {
|
||||
}
|
||||
}
|
||||
|
||||
protected function setup_tabs() {
|
||||
protected function setup_tabs($options = array()) {
|
||||
parent::setup_tabs(array('linkedwhenactive' => 'comments', 'activetab' => 'comments'));
|
||||
}
|
||||
|
||||
@@ -990,7 +990,7 @@ class page_wiki_preview extends page_wiki_edit {
|
||||
$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 @@ class page_wiki_diff extends page_wiki {
|
||||
$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 @@ class page_wiki_restoreversion extends page_wiki {
|
||||
$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 @@ class page_wiki_deletecomment extends page_wiki {
|
||||
$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 @@ class page_wiki_viewversion extends page_wiki {
|
||||
$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')));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user