diff --git a/feedme/services/FeedMeService.php b/feedme/services/FeedMeService.php index 61e90daa..76749c6b 100644 --- a/feedme/services/FeedMeService.php +++ b/feedme/services/FeedMeService.php @@ -245,10 +245,12 @@ public function deleteLeftoverEntries($settings, $feed, $processedEntries, $resu $entriesToDelete = $criteria->find(); try { - if (!craft()->entries->deleteEntry($entriesToDelete)) { - FeedMePlugin::log('FeedMeError - Something went wrong while deleting entries.', LogLevel::Error, true); - } else { - FeedMePlugin::log($feed->name . ': The following entries have been deleted: ' . print_r($deleteIds, true) . '.', LogLevel::Error, true); + if ($entriesToDelete) { + if (!craft()->entries->deleteEntry($entriesToDelete)) { + FeedMePlugin::log('FeedMeError - Something went wrong while deleting entries.', LogLevel::Error, true); + } else { + FeedMePlugin::log($feed->name . ': The following entries have been deleted: ' . print_r($deleteIds, true) . '.', LogLevel::Error, true); + } } } catch (\Exception $e) { FeedMePlugin::log($feed->name . ': FeedMeError: ' . $e->getMessage() . '.', LogLevel::Error, true); diff --git a/feedme/services/FeedMe_FieldsService.php b/feedme/services/FeedMe_FieldsService.php index 7d908629..fad53b21 100644 --- a/feedme/services/FeedMe_FieldsService.php +++ b/feedme/services/FeedMe_FieldsService.php @@ -193,7 +193,7 @@ public function prepDropdown($data, $field) { // find matching option label foreach ($options as $option) { - if ($data == $option['label']) { + if ($data == $option['value']) { $fieldData = $option['value']; break; }