Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
49bb1d9a
Commit
49bb1d9a
authored
Oct 09, 2012
by
Angie Byron
Browse files
Issue
#1788084
by andyceo, sun: Convert actions variable(s) to CMI.
parent
c10a2536
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/action/action.module
View file @
49bb1d9a
...
...
@@ -141,8 +141,9 @@ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a
// $stack tracks the number of recursive calls.
static
$stack
;
$stack
++
;
if
(
$stack
>
variable_get
(
'action_max_stack'
,
35
))
{
watchdog
(
'action'
,
'Stack overflow: too many calls to actions_do(). Aborting to prevent infinite recursion.'
,
array
(),
WATCHDOG_ERROR
);
$recursion_limit
=
config
(
'action.settings'
)
->
get
(
'recursion_limit'
);
if
(
$stack
>
$recursion_limit
)
{
watchdog
(
'action'
,
'Stack overflow: recursion limit for actions_do() has been reached. Stack is limited by %limit calls.'
,
array
(
'%limit'
=>
$recursion_limit
),
WATCHDOG_ERROR
);
return
;
}
$actions
=
array
();
...
...
core/modules/action/lib/Drupal/action/Tests/LoopTest.php
View file @
49bb1d9a
...
...
@@ -48,7 +48,9 @@ function testActionLoop() {
// recursion level should be kept low enough to prevent the xdebug
// infinite recursion protection mechanism from aborting the request.
// See http://drupal.org/node/587634.
variable_set
(
'action_max_stack'
,
7
);
config
(
'action.settings'
)
->
set
(
'recursion_limit'
,
7
)
->
save
();
$this
->
triggerActions
();
}
...
...
@@ -61,10 +63,11 @@ protected function triggerActions() {
$this
->
drupalGet
(
'<front>'
,
array
(
'query'
=>
array
(
'trigger_action_on_watchdog'
=>
$this
->
aid
)));
$expected
=
array
();
$expected
[]
=
'Triggering action loop'
;
for
(
$i
=
1
;
$i
<=
variable_get
(
'action_max_stack'
,
35
);
$i
++
)
{
$recursion_limit
=
config
(
'action.settings'
)
->
get
(
'recursion_limit'
);
for
(
$i
=
1
;
$i
<=
$recursion_limit
;
$i
++
)
{
$expected
[]
=
"Test log #
$i
"
;
}
$expected
[]
=
'Stack overflow:
too many calls to actions_do(). Aborting to prevent infinite recursion
.'
;
$expected
[]
=
'Stack overflow:
recursion limit for actions_do() has been reached. Stack is limited by %limit calls
.'
;
$result
=
db_query
(
"SELECT message FROM
{
watchdog
}
WHERE type = 'action_loop_test' OR type = 'action' ORDER BY wid"
);
$loop_started
=
FALSE
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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