diff --git a/admin/uploaduser.php b/admin/uploaduser.php index 48b067eea2c..5b31f5c8fdb 100755 --- a/admin/uploaduser.php +++ b/admin/uploaduser.php @@ -457,7 +457,7 @@ if ($formdata = $mform->is_cancelled()) { } } } - if ((property_exists($column, $existinguser) and property_exists($column, $user)) or in_array($column, $PRF_FIELDS)) { + if ((property_exists($existinguser, $column) and property_exists($user, $column)) or in_array($column, $PRF_FIELDS)) { if ($updatetype == 3 and $existinguser->$column !== '') { //missing == non-empty only continue; diff --git a/course/modedit.php b/course/modedit.php index e65444df8bb..3a7ae149b44 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -521,7 +521,7 @@ if ($mform->is_cancelled()) { foreach($outcomes as $outcome) { $elname = 'outcome_'.$outcome->id; - if (property_exists($elname, $fromform) and $fromform->$elname) { + if (property_exists($fromform, $elname) and $fromform->$elname) { // so we have a request for new outcome grade item? if ($items) { foreach($items as $item) { diff --git a/grade/edit/letter/index.php b/grade/edit/letter/index.php index daf023a3f3f..9c0915b8f8f 100644 --- a/grade/edit/letter/index.php +++ b/grade/edit/letter/index.php @@ -142,7 +142,7 @@ if (!$edit) { $gradelettername = 'gradeletter'.$i; $gradeboundaryname = 'gradeboundary'.$i; - if (property_exists($gradeboundaryname, $data) and $data->$gradeboundaryname != -1) { + if (property_exists($data, $gradeboundaryname) and $data->$gradeboundaryname != -1) { $letter = trim($data->$gradelettername); if ($letter == '') { continue; diff --git a/grade/edit/tree/category.php b/grade/edit/tree/category.php index e3cbdd1ff14..0c37f8c43d3 100644 --- a/grade/edit/tree/category.php +++ b/grade/edit/tree/category.php @@ -155,7 +155,7 @@ if ($mform->is_cancelled()) { $convert = array('grademax', 'grademin', 'gradepass', 'multfactor', 'plusfactor', 'aggregationcoef'); foreach ($convert as $param) { - if (property_exists($param, $itemdata)) { + if (property_exists($itemdata, $param)) { $itemdata->$param = unformat_float($itemdata->$param); } } @@ -184,7 +184,7 @@ if ($mform->is_cancelled()) { } // Handle null decimals value - must be done before update! - if (!property_exists('decimals', $itemdata) or $itemdata->decimals < 0) { + if (!property_exists($itemdata, 'decimals') or $itemdata->decimals < 0) { $grade_item->decimals = null; } diff --git a/grade/edit/tree/grade.php b/grade/edit/tree/grade.php index 71ec86f49b5..c662fdc56e4 100644 --- a/grade/edit/tree/grade.php +++ b/grade/edit/tree/grade.php @@ -186,7 +186,7 @@ if ($mform->is_cancelled()) { } // the overriding of feedback is tricky - we have to care about external items only - if (!property_exists('feedback', $data) or $data->feedback == $data->oldfeedback) { + if (!property_exists($data, 'feedback') or $data->feedback == $data->oldfeedback) { $data->feedback = $old_grade_grade->feedback; $data->feedbackformat = $old_grade_grade->feedbackformat; } diff --git a/grade/edit/tree/item.php b/grade/edit/tree/item.php index deffd46f029..1ce936c0dab 100644 --- a/grade/edit/tree/item.php +++ b/grade/edit/tree/item.php @@ -125,7 +125,7 @@ if ($mform->is_cancelled()) { $convert = array('grademax', 'grademin', 'gradepass', 'multfactor', 'plusfactor', 'aggregationcoef'); foreach ($convert as $param) { - if (property_exists($param, $data)) { + if (property_exists($data, $param)) { $data->$param = unformat_float($data->$param); } } @@ -135,7 +135,7 @@ if ($mform->is_cancelled()) { $grade_item->outcomeid = null; // Handle null decimals value - if (!property_exists('decimals', $data) or $data->decimals < 0) { + if (!property_exists($data, 'decimals') or $data->decimals < 0) { $grade_item->decimals = null; } diff --git a/grade/edit/tree/outcomeitem.php b/grade/edit/tree/outcomeitem.php index aff2c934298..518f111334b 100644 --- a/grade/edit/tree/outcomeitem.php +++ b/grade/edit/tree/outcomeitem.php @@ -107,7 +107,7 @@ if ($data = $mform->get_data()) { $data->aggregationcoef = 0; } - if (property_exists('calculation', $data)) { + if (property_exists($data, 'calculation')) { $data->calculation = grade_item::normalize_formula($data->calculation, $course->id); } @@ -123,7 +123,7 @@ if ($data = $mform->get_data()) { $convert = array('gradepass', 'aggregationcoef'); foreach ($convert as $param) { - if (property_exists($param, $data)) { + if (property_exists($data, $param)) { $data->$param = unformat_float($data->$param); } } diff --git a/grade/lib.php b/grade/lib.php index f142ef229d7..47d0b5d802d 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -691,7 +691,7 @@ class grade_plugin_return { } else { foreach ($params as $key=>$value) { - if (property_exists($key, $this)) { + if (property_exists($this, $key)) { $this->$key = $value; } } diff --git a/lib/completion/data_object.php b/lib/completion/data_object.php index ca26f8d9797..b805939f650 100644 --- a/lib/completion/data_object.php +++ b/lib/completion/data_object.php @@ -86,7 +86,7 @@ abstract class data_object { public function load_optional_fields() { global $DB; foreach ($this->optional_fields as $field=>$default) { - if (property_exists($field, $this)) { + if (property_exists($this, $field)) { continue; } if (empty($this->id)) { diff --git a/mod/workshop/locallib.php b/mod/workshop/locallib.php index 5f455e69ea7..9640bb47043 100644 --- a/mod/workshop/locallib.php +++ b/mod/workshop/locallib.php @@ -170,7 +170,7 @@ class workshop { */ public function __construct(stdclass $dbrecord, stdclass $cm, stdclass $course, stdclass $context=null) { foreach ($dbrecord as $field => $value) { - if (property_exists('workshop', $field)) { + if (property_exists($field, 'workshop')) { $this->{$field} = $value; } }