mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fix error in FixtureTask
The options are always set, use empty() instead. Fixes #2373
This commit is contained in:
parent
0b7d0d7c94
commit
dd335cb183
1 changed files with 2 additions and 2 deletions
|
@ -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'));
|
||||
|
|
Loading…
Add table
Reference in a new issue