From 47bcd020fff582395db8fe9e00598acad0257922 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 27 May 2015 12:32:04 +0200 Subject: [PATCH] fixed bug in console controller pass correct action name to options when $id is empty (default action) --- framework/CHANGELOG.md | 1 + framework/console/Controller.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 8b6b58be29..5d21c23dc5 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -13,6 +13,7 @@ Yii Framework 2 Change Log - Bug #8506: Cleaning of output buffer in `Widget::run()` conflicts with `Pjax` widget which did the cleanup itself (cebe, joester89) - Bug #8544: Fixed `yii\db\ActiveRecord` does not updates attribute specified at `optimisticLock()` after save (klimov-paul) - Bug: Fixed string comparison in `BaseActiveRecord::unlink()` which may result in wrong comparison result for hash valued primary keys starting with `0e` (cebe) +- Bug: Pass correct action name to `yii\console\Controller::options()` when default action was requested (cebe) - Enh #6043: Specification for 'class' and 'style' in array format added to `yii\helpers\Html` (klimov-paul) - Enh #7169: `yii\widgets\ActiveField` now uses corresponding methods for default parts rendering (klimov-paul) - Enh #8070: `yii\console\controllers\MessageController` now sorts created messages, even if there is no new one, while saving to PHP file (klimov-paul) diff --git a/framework/console/Controller.php b/framework/console/Controller.php index 8446914138..51ecc044b3 100644 --- a/framework/console/Controller.php +++ b/framework/console/Controller.php @@ -77,7 +77,7 @@ class Controller extends \yii\base\Controller { if (!empty($params)) { // populate options here so that they are available in beforeAction(). - $options = $this->options($id); + $options = $this->options($id === '' ? $this->defaultAction : $id); foreach ($params as $name => $value) { if (in_array($name, $options, true)) { $default = $this->$name;