aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Controllers/importExportController.php9
-rw-r--r--app/Models/EntryDAO.php4
2 files changed, 6 insertions, 7 deletions
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php
index 6ae89defb..af3c0bf46 100644
--- a/app/Controllers/importExportController.php
+++ b/app/Controllers/importExportController.php
@@ -464,15 +464,14 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
}
$values = $entry->toArray();
+ $ok = false;
if (isset($existingHashForGuids[$entry->guid()])) {
- $id = $this->entryDAO->updateEntry($values);
+ $ok = $this->entryDAO->updateEntry($values);
} else {
- $id = $this->entryDAO->addEntry($values);
+ $ok = $this->entryDAO->addEntry($values);
}
+ $error |= ($ok === false);
- if (!$error && ($id === false)) {
- $error = true;
- }
}
$this->entryDAO->commit();
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 0167695ca..96790c69c 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -152,7 +152,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
}
if ($this->addEntryPrepared && $this->addEntryPrepared->execute()) {
- return $this->bd->lastInsertId();
+ return true;
} else {
$info = $this->addEntryPrepared == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $this->addEntryPrepared->errorInfo();
if ($this->autoUpdateDb($info)) {
@@ -212,7 +212,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
}
if ($this->updateEntryPrepared && $this->updateEntryPrepared->execute()) {
- return $this->bd->lastInsertId();
+ return true;
} else {
$info = $this->updateEntryPrepared == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $this->updateEntryPrepared->errorInfo();
if ($this->autoUpdateDb($info)) {