Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rules-3458065
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
rules-3458065
Commits
5e844050
Commit
5e844050
authored
15 years ago
by
fago
Browse files
Options
Downloads
Patches
Plain Diff
fixed validating that variable names of newly added variables are unique, part 2
parent
1ac91973
No related branches found
Branches containing commit
Tags
9.0.3
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rules/rules.admin_rule_proxy.inc
+6
-9
6 additions, 9 deletions
rules/rules.admin_rule_proxy.inc
with
6 additions
and
9 deletions
rules/rules.admin_rule_proxy.inc
+
6
−
9
View file @
5e844050
...
...
@@ -255,10 +255,7 @@ class rules_admin_rule_proxy {
function
get_defined_variables
(
$id
=
NULL
)
{
$set_info
=
$this
->
get_set_info
();
$vars
=
$this
->
_get_available_variables
(
TRUE
)
+
$set_info
[
'arguments'
];
if
(
isset
(
$id
))
{
$vars
=
array_diff_assoc
(
$vars
,
$this
->
element_get_new_variables
(
$this
->
get_element
(
$id
)));
}
return
rules_admin_element_filter
(
$vars
);
return
array_filter
(
$vars
,
'rules_admin_element_filter'
);
}
/**
...
...
@@ -267,8 +264,8 @@ class rules_admin_rule_proxy {
* @param $all If set to TRUE all variables defined in this rule set will returned.
*/
function
_get_available_variables
(
$all
=
FALSE
)
{
if
(
!
isset
(
$this
->
_variables
))
{
$this
->
_variables
=
array
();
if
(
!
isset
(
$this
->
_variables
[
$all
]
))
{
$this
->
_variables
[
$all
]
=
array
();
$set
=
$this
->
get_set
();
//sort the rules
...
...
@@ -277,15 +274,15 @@ class rules_admin_rule_proxy {
foreach
(
element_children
(
$set
[
'rules'
])
as
$name
)
{
if
(
$name
==
$this
->
get_rule_name
())
{
if
(
!
$all
)
{
return
$this
->
_variables
;
return
$this
->
_variables
[
$all
]
;
}
}
foreach
(
$set
[
'rules'
][
$name
][
'#actions'
]
as
$action
)
{
$info
=
rules_get_element_info
(
$action
);
$this
->
_variables
+=
$info
[
'new variables'
];
$this
->
_variables
[
$all
]
+=
$info
[
'new variables'
];
}
}
}
return
$this
->
_variables
;
return
$this
->
_variables
[
$all
]
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment