Commit 7ba770eb by Qiang Xue

Fixes #5408: Gii console command incorrectly reports errors when there is actually no error

parent 9c359d14
...@@ -4,6 +4,7 @@ Yii Framework 2 gii extension Change Log ...@@ -4,6 +4,7 @@ Yii Framework 2 gii extension Change Log
2.0.0 under development 2.0.0 under development
----------------------- -----------------------
- Bug #5408: Gii console command incorrectly reports errors when there is actually no error (qiangxue)
- Bug: Fixed table name regression caused by changed introduced in #4971 (samdark) - Bug: Fixed table name regression caused by changed introduced in #4971 (samdark)
......
...@@ -262,7 +262,7 @@ abstract class Generator extends Model ...@@ -262,7 +262,7 @@ abstract class Generator extends Model
* @param array $answers * @param array $answers
* @param string $results this parameter receives a value from this method indicating the log messages * @param string $results this parameter receives a value from this method indicating the log messages
* generated while saving the code files. * generated while saving the code files.
* @return boolean whether there is any error while saving the code files. * @return boolean whether files are successfully saved without any error.
*/ */
public function save($files, $answers, &$results) public function save($files, $answers, &$results)
{ {
......
...@@ -44,7 +44,7 @@ class DefaultController extends Controller ...@@ -44,7 +44,7 @@ class DefaultController extends Controller
$generator->saveStickyAttributes(); $generator->saveStickyAttributes();
$files = $generator->generate(); $files = $generator->generate();
if (isset($_POST['generate']) && !empty($_POST['answers'])) { if (isset($_POST['generate']) && !empty($_POST['answers'])) {
$params['hasError'] = $generator->save($files, (array) $_POST['answers'], $results); $params['hasError'] = !$generator->save($files, (array) $_POST['answers'], $results);
$params['results'] = $results; $params['results'] = $results;
} else { } else {
$params['files'] = $files; $params['files'] = $files;
......
...@@ -13,6 +13,7 @@ Yii Framework 2 Change Log ...@@ -13,6 +13,7 @@ Yii Framework 2 Change Log
- Bug #5323: Nested dropdown does not work for `yii\bootstrap\DropDown` (aryraditya) - Bug #5323: Nested dropdown does not work for `yii\bootstrap\DropDown` (aryraditya)
- Bug #5336: `yii\bootstrap\DropDown` should register bootstrap plugin asset (zelenin) - Bug #5336: `yii\bootstrap\DropDown` should register bootstrap plugin asset (zelenin)
- Bug #5379: `Module::afterAction()` was called even when `beforeAction()` returned false (cebe) - Bug #5379: `Module::afterAction()` was called even when `beforeAction()` returned false (cebe)
- Bug #5408: Gii console command incorrectly reports errors when there is actually no error (qiangxue)
- Bug #5423: `yii\behaviors\Cors` causes "undefined index" error when its `cors` is configured (qiangxue) - Bug #5423: `yii\behaviors\Cors` causes "undefined index" error when its `cors` is configured (qiangxue)
- Bug #5424: `Html::addCssStyle()` wasn't correctly setting style passed in array (kartik-v, samdark) - Bug #5424: `Html::addCssStyle()` wasn't correctly setting style passed in array (kartik-v, samdark)
- Bug #5435: Added extra checks to `yii\rbac\DbManager` to prevent database exceptions when `$userId` is empty (samdark) - Bug #5435: Added extra checks to `yii\rbac\DbManager` to prevent database exceptions when `$userId` is empty (samdark)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment