$type=$ef[$arr['extra_field_id']]['field_type'];
if (($type == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) || ($type==ARTIFACT_EXTRAFIELDTYPE_MULTISELECT)) {
//accumulate a sub-array of values in cases where you may have multiple rows
- if (!is_array($this->extra_field_data[$arr['extra_field_id']])) {
+ if (!array_key_exists($arr['extra_field_id'], $this->extra_field_data) || !is_array($this->extra_field_data[$arr['extra_field_id']])) {
$this->extra_field_data[$arr['extra_field_id']] = array();
}
$this->extra_field_data[$arr['extra_field_id']][]=$arr['field_data'];
$this->sort=$_sort_ord;
$this->order_col=$_order_col;
$this->status=$_status;
- if (gettype($_assigned_to) === 'integer' ||
- gettype($_assigned_to) === 'string') {
- $this->assigned_to=$_assigned_to;
- }
+ $this->assigned_to=$_assigned_to;
$this->extra_fields=$_extra_fields;
$this->setChangedFrom($_changed);
}
return false;
} else {
db_commit();
+
+ //
+ // Now set up our internal data structures
+ //
+ if (!$this->fetchData($id)) {
+ return false;
+ }
+
// If time is set, no need to add to history, will be done in batch
if (!array_key_exists('time', $importData)){
$this->Artifact->addHistory('File Added',$id.': '.$filename);
return false;
}
+ $result = db_query_params('SELECT count(*) AS count FROM artifact_group_list WHERE group_id=$1 AND name=$2 AND group_artifact_id!=$3',
+ array ($this->Group->getID(), $name, $this->getID()));
+ if (! $result) {
+ $this->setError('ArtifactType::Update(): '.db_error());
+ return false;
+ }
+ if (db_result($result, 0, 'count')) {
+ $this->setError(_('Tracker name already used'));
+ return false;
+ }
+
if ($email_address) {
$invalid_emails = validate_emails($email_address);
if (count($invalid_emails) > 0) {