Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-widgets2-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hrzg
yii2-widgets2-module
Commits
6cdb5a0b
Commit
6cdb5a0b
authored
Jul 19, 2016
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed redirects for global widgets
parent
ce1ee30b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
WidgetController.php
src/controllers/crud/base/WidgetController.php
+2
-10
No files found.
src/controllers/crud/base/WidgetController.php
View file @
6cdb5a0b
...
...
@@ -132,7 +132,7 @@ class WidgetController extends Controller
{
$model
=
$this
->
findModel
(
$id
);
if
(
$model
->
load
(
$_POST
)
&&
$model
->
save
())
{
if
(
$model
->
load
(
$_POST
)
&&
$model
->
save
()
&&
Url
::
previous
(
$model
->
route
)
)
{
return
$this
->
redirect
(
Url
::
previous
(
$model
->
route
));
}
else
{
return
$this
->
render
(
'update'
,
[
...
...
@@ -162,15 +162,7 @@ class WidgetController extends Controller
return
$this
->
redirect
(
Url
::
previous
());
}
// TODO: improve detection
$isPivot
=
strstr
(
'$id'
,
','
);
if
(
$isPivot
==
true
)
{
return
$this
->
redirect
(
Url
::
previous
());
}
elseif
(
isset
(
\Yii
::
$app
->
session
[
'__crudReturnUrl'
])
&&
\Yii
::
$app
->
session
[
'__crudReturnUrl'
]
!=
'/'
)
{
Url
::
remember
(
null
);
$url
=
\Yii
::
$app
->
session
[
'__crudReturnUrl'
];
\Yii
::
$app
->
session
[
'__crudReturnUrl'
]
=
null
;
if
(
Url
::
previous
(
$redirectUrl
))
{
return
$this
->
redirect
(
Url
::
previous
(
$redirectUrl
));
}
else
{
return
$this
->
redirect
([
'index'
]);
...
...
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