Import: handle empty sets

This commit is contained in:
Thomas Gelf 2015-08-29 01:10:56 +02:00
parent 38c4c06c77
commit dd06be4a58
1 changed files with 11 additions and 2 deletions

View File

@ -102,8 +102,17 @@ continue;
$db->beginTransaction();
if (! $this->rowSetExists($rowset)) {
$newRows = $this->newChecksums('imported_row', $rowSums);
$newProperties = $this->newChecksums('imported_property', array_keys($props));
if (empty($rowSums)) {
$newRows = array();
} else {
$newRows = $this->newChecksums('imported_row', $rowSums);
}
if (empty($rowSums)) {
$newProperties = array();
} else {
$newProperties = $this->newChecksums('imported_property', array_keys($props));
}
$db->insert('imported_rowset', array('checksum' => $rowset));