fixing messed up property_exists() regression - sorrrry

This commit is contained in:
Petr Skoda
2010-09-17 20:36:49 +00:00
parent b6265b7e37
commit 4cc977a64d
10 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
+2 -2
View File
@@ -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;
}
+2 -2
View File
@@ -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);
}
}
+1 -1
View File
@@ -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;
}
}
+1 -1
View File
@@ -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)) {
+1 -1
View File
@@ -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;
}
}