Skip to content

Commit

Permalink
fixing messed up property_exists() regression - sorrrry
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 17, 2010
1 parent b6265b7 commit 4cc977a
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion admin/uploaduser.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
}
}
}
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;
Expand Down
2 changes: 1 addition & 1 deletion course/modedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@
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) {
Expand Down
2 changes: 1 addition & 1 deletion grade/edit/letter/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
$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;
Expand Down
4 changes: 2 additions & 2 deletions grade/edit/tree/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

$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);
}
}
Expand Down Expand Up @@ -184,7 +184,7 @@
}

// 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;
}

Expand Down
2 changes: 1 addition & 1 deletion grade/edit/tree/grade.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
}

// 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;
}
Expand Down
4 changes: 2 additions & 2 deletions grade/edit/tree/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

$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);
}
}
Expand All @@ -135,7 +135,7 @@
$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;
}

Expand Down
4 changes: 2 additions & 2 deletions grade/edit/tree/outcomeitem.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
$data->aggregationcoef = 0;
}

if (property_exists('calculation', $data)) {
if (property_exists($data, 'calculation')) {
$data->calculation = grade_item::normalize_formula($data->calculation, $course->id);
}

Expand All @@ -123,7 +123,7 @@

$convert = array('gradepass', 'aggregationcoef');
foreach ($convert as $param) {
if (property_exists($param, $data)) {
if (property_exists($data, $param)) {
$data->$param = unformat_float($data->$param);
}
}
Expand Down
2 changes: 1 addition & 1 deletion grade/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ public function grade_plugin_return($params = null) {

} else {
foreach ($params as $key=>$value) {
if (property_exists($key, $this)) {
if (property_exists($this, $key)) {
$this->$key = $value;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/completion/data_object.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function __construct($params=NULL, $fetch=true) {
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)) {
Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 4cc977a

Please sign in to comment.