From b26f3819aa05b2a2e1b4300b1905a8cde9933e3b Mon Sep 17 00:00:00 2001 From: Bob Olde Hampsink Date: Wed, 21 May 2014 13:57:48 +0200 Subject: [PATCH] Bugfix: Criteria matching now checks all statuses and has no limit --- README.md | 3 +++ services/ImportService.php | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bb17ca..6734003 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,9 @@ Map fields (2) Changelog ================= +###0.6.7### + - Bugfix: Criteria matching now checks all statuses and has no limit + ###0.6.6### - Added an "onBeforeImportDelete" event, so your plugin can intervene on deletion by this plugin diff --git a/services/ImportService.php b/services/ImportService.php index 4a4c68b..2fe7d69 100644 --- a/services/ImportService.php +++ b/services/ImportService.php @@ -60,9 +60,12 @@ public function row($row, $data, $settings) { // Match with current data $criteria = craft()->elements->getCriteria(ElementType::Entry); + $criteria->limit = null; + $criteria->status = isset($settings['map']['status']) ? $settings['map']['status'] : null; $criteria->sectionId = $settings['section']; + foreach($settings['map'] as $key => $value) { - if(isset($settings['unique'][$key]) && $settings['unique'][$key] == 1) { + if(isset($criteria->$settings['map'][$key]) && isset($settings['unique'][$key]) && $settings['unique'][$key] == 1) { $criteria->$settings['map'][$key] = $fields[$value]; } }