From dd335cb18393e833733730830d0ce03f32982ee1 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 13 Dec 2011 20:40:30 -0500 Subject: [PATCH] Fix error in FixtureTask The options are always set, use empty() instead. Fixes #2373 --- lib/Cake/Console/Command/Task/FixtureTask.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Console/Command/Task/FixtureTask.php b/lib/Cake/Console/Command/Task/FixtureTask.php index 11b6e0331..36c51e3d7 100644 --- a/lib/Cake/Console/Command/Task/FixtureTask.php +++ b/lib/Cake/Console/Command/Task/FixtureTask.php @@ -222,14 +222,14 @@ class FixtureTask extends BakeTask { $schema = $this->_generateSchema($tableInfo); } - if (!isset($importOptions['records']) && !isset($importOptions['fromTable'])) { + if (empty($importOptions['records']) && !isset($importOptions['fromTable'])) { $recordCount = 1; if (isset($this->params['count'])) { $recordCount = $this->params['count']; } $records = $this->_makeRecordString($this->_generateRecords($tableInfo, $recordCount)); } - if (isset($this->params['records']) || isset($importOptions['fromTable'])) { + if (!empty($this->params['records']) || isset($importOptions['fromTable'])) { $records = $this->_makeRecordString($this->_getRecordsFromTable($model, $useTable)); } $out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields'));