Author: mcantelon
Date: Wed Aug 29 17:33:03 2012
New Revision: 12231
Log:
Added error throw if a blank accession number is encountered.
Modified:
trunk/lib/task/import/csvAccessionImportTask.class.php
Modified: trunk/lib/task/import/csvAccessionImportTask.class.php
==============================================================================
--- trunk/lib/task/import/csvAccessionImportTask.class.php Wed Aug 29
17:25:49 2012 (r12230)
+++ trunk/lib/task/import/csvAccessionImportTask.class.php Wed Aug 29
17:33:03 2012 (r12231)
@@ -123,7 +123,7 @@
/* these values get stored to the rowStatusVars array */
'variableColumns' => array(
- 'ACCESSION NUMBER',
+ 'accessionNumber',
'TYPE',
'DONOR',
'EMAIL',
@@ -156,11 +156,16 @@
print 'Found '. $result->id ."\n";
$self->object = QubitAccession::getById($result->id);
} else {
- $self->object = false;
- $error = "Couldn't find accession # ". $accessionNumber .'...
creating.';
- print $error ."\n";
- $self->object = new QubitAccession();
- $self->object->identifier = $accessionNumber;
+ if (!$accessionNumber)
+ {
+ throw new sfException('Import aborted: stopped on blank accession
number.');
+ } else {
+ $self->object = false;
+ $error = "Couldn't find accession # ". $accessionNumber .'...
creating.';
+ print $error ."\n";
+ $self->object = new QubitAccession();
+ $self->object->identifier = $accessionNumber;
+ }
}
},
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.