Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rules-3457134
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-3457134
Commits
24ca91e3
Commit
24ca91e3
authored
14 years ago
by
Wolfgang Ziegler
Browse files
Options
Downloads
Patches
Plain Diff
fix entity_create configuration UI
parent
d9729d4d
No related branches found
Branches containing commit
Tags
7.95
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rules/modules/data.eval.inc
+15
-14
15 additions, 14 deletions
rules/modules/data.eval.inc
with
15 additions
and
14 deletions
rules/modules/data.eval.inc
+
15
−
14
View file @
24ca91e3
...
...
@@ -124,21 +124,22 @@ function rules_action_entity_create($args, $element) {
* Info alteration callback for the entity create action.
*/
function
rules_action_entity_create_info_alter
(
&
$element_info
,
RulesAbstractPlugin
$element
)
{
$element
->
settings
+=
array
(
'type'
=>
NULL
);
$wrapper
=
entity_metadata_wrapper
(
$element
->
settings
[
'type'
]);
// Add the data type's needed parameter for loading to the parameter info.
foreach
(
$wrapper
as
$name
=>
$child
)
{
$info
=
$child
->
info
();
if
(
!
empty
(
$info
[
'required'
]))
{
$info
+=
array
(
'type'
=>
'text'
);
// Prefix parameter names to avoid name clashes with existing parameters.
$element_info
[
'parameter'
][
'param_'
.
$name
]
=
array_intersect_key
(
$info
,
array_flip
(
array
(
'type'
,
'label'
,
'description'
)));
$element_info
[
'parameter'
][
'param_'
.
$name
][
'options list'
]
=
$child
->
optionsList
()
?
'rules_action_entity_parameter_options_list'
:
FALSE
;
if
(
!
empty
(
$element
->
settings
[
'type'
]))
{
$wrapper
=
entity_metadata_wrapper
(
$element
->
settings
[
'type'
]);
// Add the data type's needed parameter for loading to the parameter info.
foreach
(
$wrapper
as
$name
=>
$child
)
{
$info
=
$child
->
info
();
if
(
!
empty
(
$info
[
'required'
]))
{
$info
+=
array
(
'type'
=>
'text'
);
// Prefix parameter names to avoid name clashes with existing parameters.
$element_info
[
'parameter'
][
'param_'
.
$name
]
=
array_intersect_key
(
$info
,
array_flip
(
array
(
'type'
,
'label'
,
'description'
)));
$element_info
[
'parameter'
][
'param_'
.
$name
][
'options list'
]
=
$child
->
optionsList
()
?
'rules_action_entity_parameter_options_list'
:
FALSE
;
}
}
$element_info
[
'provides'
][
'entity_created'
][
'type'
]
=
$element
->
settings
[
'type'
];
if
((
$bundleKey
=
$wrapper
->
entityKey
(
'bundle'
))
&&
isset
(
$element
->
settings
[
'param_'
.
$bundleKey
]))
{
$element_info
[
'provides'
][
'entity_created'
][
'bundle'
]
=
$element
->
settings
[
'param_'
.
$bundleKey
];
}
}
$element_info
[
'provides'
][
'entity_created'
][
'type'
]
=
$element
->
settings
[
'type'
];
if
((
$bundleKey
=
$wrapper
->
entityKey
(
'bundle'
))
&&
isset
(
$element
->
settings
[
'param_'
.
$bundleKey
]))
{
$element_info
[
'provides'
][
'entity_created'
][
'bundle'
]
=
$element
->
settings
[
'param_'
.
$bundleKey
];
}
}
...
...
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