Skip to content

Commit

Permalink
fix for dropdown matching by label
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Jul 5, 2016
1 parent 5113318 commit 3141168
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions feedme/services/FeedMeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion feedme/services/FeedMe_FieldsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3141168

Please sign in to comment.