MDL-20369 fixed incorrect fetching of data fields - this was causing major problem with incorrect defaultsort caused by restore bug

This commit is contained in:
skodak
2009-09-28 16:07:19 +00:00
parent 2ccfd7509d
commit 7d8cede29c
+2 -2
View File
@@ -482,7 +482,7 @@ function data_append_new_field_to_templates($data, $newfieldname) {
* this function creates an instance of the particular subfield class *
************************************************************************/
function data_get_field_from_name($name, $data){
$field = get_record('data_fields','name',$name);
$field = get_record('data_fields', 'name', $name, 'dataid', $data->id);
if ($field) {
return data_get_field($field, $data);
} else {
@@ -495,7 +495,7 @@ function data_get_field_from_name($name, $data){
* this function creates an instance of the particular subfield class *
************************************************************************/
function data_get_field_from_id($fieldid, $data) {
$field = get_record('data_fields','id',$fieldid);
$field = get_record('data_fields', 'id', $fieldid, 'dataid', $data->id);
if ($field) {
return data_get_field($field, $data);
} else {