From: vyshane Date: Thu, 23 Mar 2006 06:20:48 +0000 (+0000) Subject: Fixed extra function argument in call for display_add_field() from add.php. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3a5a7928ea77f33b672f2eb1f6d9c8c6245807e9;p=moodle.git Fixed extra function argument in call for display_add_field() from add.php. --- diff --git a/mod/data/add.php b/mod/data/add.php index 4118576244..e332a4bc29 100755 --- a/mod/data/add.php +++ b/mod/data/add.php @@ -179,7 +179,7 @@ //for each field in the add form, add it to the data_content. foreach ($datarecord as $name => $value){ if (!in_array($name, $ignorenames)) { - $namearr = explode('_',$name); // Second one is the field id + $namearr = explode('_', $name); // Second one is the field id if (empty($field->field) || ($namearr[1] != $field->field->id)) { // Try to reuse classes $field = data_get_field_from_id($namearr[1], $data); } @@ -221,7 +221,7 @@ if (!$rid){ print_heading(get_string('newentry','data'), '', 2); } - + /****************************************** * Regular expression replacement section * ******************************************/ diff --git a/mod/data/lib.php b/mod/data/lib.php index e73f5ca13f..0c6cf2f9b6 100755 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -360,7 +360,6 @@ function data_generate_default_form($dataid, $mode){ * output: null * *********************************************************/ function data_generate_empty_add_form($id, $rid=0){ - $currentdata = get_record('data','id',$id); //check if there is an add entry if (!$currentdata->addtemplate){ @@ -383,7 +382,7 @@ function data_generate_empty_add_form($id, $rid=0){ $str .=''; $g = data_get_field($cfield, $currentdata); - $str .= $g->display_add_field($cfield->id,$rid); + $str .= $g->display_add_field($rid); $str .= ''; $str .= ''; unset($g); @@ -393,7 +392,6 @@ function data_generate_empty_add_form($id, $rid=0){ $str .= ''; } - echo $str; } }