Permalink
Browse files

Fix error in FixtureTask

The options are always set, use empty() instead.

Fixes #2373
  • Loading branch information...
markstory committed Dec 14, 2011
1 parent 0b7d0d7 commit dd335cb18393e833733730830d0ce03f32982ee1
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Cake/Console/Command/Task/FixtureTask.php
@@ -222,14 +222,14 @@ public function bake($model, $useTable = false, $importOptions = array()) {
$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'));

0 comments on commit dd335cb

Please sign in to comment.