diff options
| author | 2017-09-23 12:32:35 +0200 | |
|---|---|---|
| committer | 2017-09-23 12:32:35 +0200 | |
| commit | 28db5dd2858002b376c920ec1d1aaad4ef254d54 (patch) | |
| tree | 4310b06531acb71792fb2ae290aad528fa06f22a /app/Controllers/importExportController.php | |
| parent | 3fa63217cdf339b894c29ffe7f9af8c477c724fb (diff) | |
Fix SQL constraint insert into entrytmp table
https://github.com/FreshRSS/FreshRSS/issues/1614
Diffstat (limited to 'app/Controllers/importExportController.php')
| -rw-r--r-- | app/Controllers/importExportController.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index a69490e70..a76dd9a2b 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -426,7 +426,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { } // For this feed, check existing GUIDs already in database. $existingHashForGuids = $this->entryDAO->listHashForFeedGuids($feed->id(), $newGuids); - unset($newGuids); + $newGuids = array(); // Then, articles are imported. $this->entryDAO->beginTransaction(); @@ -455,6 +455,11 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $entry->_id(min(time(), $entry->date(true)) . uSecString()); $entry->_tags($tags); + if (isset($newGuids[$entry->guid()])) { + continue; //Skip subsequent articles with same GUID + } + $newGuids[$entry->guid()] = true; + $entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry); if ($entry == null) { // An extension has returned a null value, there is nothing to insert. |
