summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-03-26 19:23:37 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-03-26 19:23:37 +0200
commite7b153fc7f2f70d963adf21555edd41b35e776a0 (patch)
tree960f18ff4cca3eb7f614a8527cd3bc4daf453f70 /app
parentfd028c6114ff7d66cf717f9964ae0b9702df46de (diff)
parent1b34142e7d249363517d326b11eda42446ee85d2 (diff)
Merge remote-tracking branch 'FreshRSS/dev' into 1464-improve-english-translations
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/importExportController.php9
-rw-r--r--app/Models/EntryDAO.php6
2 files changed, 7 insertions, 8 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 afcde3d7f..96790c69c 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -152,12 +152,12 @@ 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)) {
return $this->addEntry($valuesTmp);
- } elseif ((int)($info[0] / 1000) !== 23) { //Filter out "SQLSTATE Class code 23: Constraint Violation" because of expected duplicate entries
+ } elseif ((int)((int)$info[0] / 1000) !== 23) { //Filter out "SQLSTATE Class code 23: Constraint Violation" because of expected duplicate entries
Minz_Log::error('SQL error addEntry: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
. ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title']);
}
@@ -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)) {