Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
config_enforce_devel
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
config_enforce_devel
Commits
6a6fc642
Commit
6a6fc642
authored
4 years ago
by
Christopher Gervais
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3164885
: Fix enforcing dependencies.
parent
25c05f25
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Form/DevelFormHelperTrait.php
+8
-13
8 additions, 13 deletions
src/Form/DevelFormHelperTrait.php
with
8 additions
and
13 deletions
src/Form/DevelFormHelperTrait.php
+
8
−
13
View file @
6a6fc642
...
...
@@ -377,7 +377,14 @@ trait DevelFormHelperTrait {
* Return array of config enforce values from the form.
*/
protected
function
getConfigEnforceValuesFromForm
()
{
return
$this
->
formState
()
->
getValue
(
'config_enforce'
);
$values
=
$this
->
formState
()
->
getValue
(
'config_enforce'
);
// Some forms appear to wrap our settings in an array.
if
(
array_key_exists
(
'config_enforce'
,
$values
))
{
$values
=
$values
[
'config_enforce'
];
}
return
$values
;
}
/**
...
...
@@ -385,10 +392,6 @@ trait DevelFormHelperTrait {
*/
protected
function
getConfigEnforceValue
(
string
$field
)
{
$values
=
$this
->
getConfigEnforceValuesFromForm
();
if
(
$this
->
areConfigEnforceValuesWrapped
())
{
// Some forms appear to wrap our settings in an array.
$values
=
$values
[
'config_enforce'
];
}
return
$values
[
$this
->
getCurrentConfig
()][
$field
];
}
...
...
@@ -400,14 +403,6 @@ trait DevelFormHelperTrait {
return
array_key_exists
(
$field
,
$values
[
$this
->
getCurrentConfig
()]);
}
/**
* Determine whether config enforce values are wrapped in an extra array.
*/
protected
function
areConfigEnforceValuesWrapped
()
{
$values
=
$this
->
getConfigEnforceValuesFromForm
();
return
array_key_exists
(
'config_enforce'
,
$values
);
}
/**
* Return the new enabled setting from the form state.
*/
...
...
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