This function would erroneously return 'false' if the $msg array contained errors prior to
entry into the function. This sometimes caused unexplained IMS CC import failures when
inserting new lessons into the database.
Use a local return result to ensure accurate result.
private function isFieldsValid($action_type, $row_id, $title)
{
global $msg;
+ $result = true;
$missing_fields = array();
if ($missing_fields)
{
- $missing_fields = implode(', ', $missing_fields);
- $msg->addError(array('EMPTY_FIELDS', $missing_fields));
+ $msg->addError(array('EMPTY_FIELDS', implode(', ', $missing_fields)));
+ $result = false;
}
- if (!$msg->containsErrors())
- return true;
- else
- return false;
+ return $result;
}
}
-?>
\ No newline at end of file
+?>