Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
a2f13e9a
Commit
a2f13e9a
authored
15 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
Roll back 'Make configDefaults() implementation optional.' - leads to infinite loops in some cases.
parent
af845f66
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/FeedsConfigurable.inc
+2
-28
2 additions, 28 deletions
includes/FeedsConfigurable.inc
with
2 additions
and
28 deletions
includes/FeedsConfigurable.inc
+
2
−
28
View file @
a2f13e9a
...
...
@@ -89,7 +89,7 @@ abstract class FeedsConfigurable {
* returned by configDefaults().
*/
public
function
setConfig
(
$config
)
{
$default_keys
=
$this
->
configDefaults
Merged
();
$default_keys
=
$this
->
configDefaults
();
$this
->
config
=
array_intersect_key
(
$config
,
$default_keys
);
}
...
...
@@ -102,7 +102,7 @@ abstract class FeedsConfigurable {
*/
public
function
addConfig
(
$config
)
{
$this
->
config
=
array_merge
(
$this
->
config
,
$config
);
$default_keys
=
$this
->
configDefaults
Merged
();
$default_keys
=
$this
->
configDefaults
();
$this
->
config
=
array_intersect_key
(
$this
->
config
,
$default_keys
);
}
...
...
@@ -137,32 +137,6 @@ abstract class FeedsConfigurable {
return
array
();
}
/**
* Return config defaults merged with the actual form definition. This is
* used for filtering values in setConfig and addConfig and allows
* implementers of configForm() to add form elements without necessarily
* declaring them in configDefaults().
*
* @todo Support nested form trees.
*/
protected
function
configDefaultsMerged
()
{
$form_state
=
array
();
$form
=
$this
->
configForm
(
$form_state
);
// Mimic Form API behavior.
drupal_prepare_form
(
'form_'
.
get_class
(
$this
)
.
'_feeds_config_form'
,
$form
,
$form_state
);
drupal_alter
(
'form_'
.
get_class
(
$this
)
.
'_feeds_config_form'
,
$form
,
$form_state
);
drupal_alter
(
'form'
,
$form
,
$form_state
,
get_class
(
$this
)
.
'_feeds_config_form'
);
unset
(
$form
[
'form_token'
]);
unset
(
$form
[
'form_id'
]);
$defaults
=
array
();
foreach
(
element_children
(
$form
)
as
$e
)
{
if
(
isset
(
$form
[
$e
][
'#default_value'
]))
{
$defaults
[
$e
]
=
$form
[
$e
][
'#default_value'
];
}
}
return
$this
->
configDefaults
()
+
$defaults
;
}
/**
* Return configuration form for this object. The keys of the configuration
* form must match the keys of the array returned by configDefaults().
...
...
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