Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
f3a6b198
Commit
f3a6b198
authored
Oct 07, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not call afterAction() if beforeAction returned false
fixes #5379
parent
b9520596
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Controller.php
framework/base/Controller.php
+6
-4
No files found.
framework/CHANGELOG.md
View file @
f3a6b198
...
@@ -9,6 +9,7 @@ Yii Framework 2 Change Log
...
@@ -9,6 +9,7 @@ Yii Framework 2 Change Log
-
Bug #5314: Fixed typo in the implementation of
`yii\web\Session::getHasSessionId()`
(qiangxue)
-
Bug #5314: Fixed typo in the implementation of
`yii\web\Session::getHasSessionId()`
(qiangxue)
-
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: Date and time formatting now assumes UTC as the timezone for input dates unless a timezone is explicitly given (cebe)
-
Bug: Date and time formatting now assumes UTC as the timezone for input dates unless a timezone is explicitly given (cebe)
-
Enh #4040: Added
`$viewFile`
and
`$params`
to the
`EVENT_BEFORE_RENDER`
and
`EVENT_AFTER_RENDER`
events for
`View`
(qiangxue)
-
Enh #4040: Added
`$viewFile`
and
`$params`
to the
`EVENT_BEFORE_RENDER`
and
`EVENT_AFTER_RENDER`
events for
`View`
(qiangxue)
-
Enh #4275: Added
`removeChildren()`
to
`yii\rbac\ManagerInterface`
and implementations (samdark)
-
Enh #4275: Added
`removeChildren()`
to
`yii\rbac\ManagerInterface`
and implementations (samdark)
...
...
framework/base/Controller.php
View file @
f3a6b198
...
@@ -134,6 +134,7 @@ class Controller extends Component implements ViewContextInterface
...
@@ -134,6 +134,7 @@ class Controller extends Component implements ViewContextInterface
$modules
=
[];
$modules
=
[];
$runAction
=
true
;
$runAction
=
true
;
// call beforeAction on modules
foreach
(
$this
->
getModules
()
as
$module
)
{
foreach
(
$this
->
getModules
()
as
$module
)
{
if
(
$module
->
beforeAction
(
$action
))
{
if
(
$module
->
beforeAction
(
$action
))
{
array_unshift
(
$modules
,
$module
);
array_unshift
(
$modules
,
$module
);
...
@@ -145,17 +146,18 @@ class Controller extends Component implements ViewContextInterface
...
@@ -145,17 +146,18 @@ class Controller extends Component implements ViewContextInterface
$result
=
null
;
$result
=
null
;
if
(
$runAction
)
{
if
(
$runAction
&&
$this
->
beforeAction
(
$action
)
)
{
if
(
$this
->
beforeAction
(
$action
))
{
// run the action
$result
=
$action
->
runWithParams
(
$params
);
$result
=
$action
->
runWithParams
(
$params
);
$result
=
$this
->
afterAction
(
$action
,
$result
);
$result
=
$this
->
afterAction
(
$action
,
$result
);
}
}
// call afterAction on modules
foreach
(
$modules
as
$module
)
{
foreach
(
$modules
as
$module
)
{
/* @var $module Module */
/* @var $module Module */
$result
=
$module
->
afterAction
(
$action
,
$result
);
$result
=
$module
->
afterAction
(
$action
,
$result
);
}
}
}
$this
->
action
=
$oldAction
;
$this
->
action
=
$oldAction
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment