Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
form_mode_control
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
form_mode_control
Commits
f9ae34bb
Commit
f9ae34bb
authored
Jul 27, 2024
by
Martin Anderson-Clutz
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3431354
by marthinal: Config schema is incorrect
parent
0f4970ce
Branches
8.x-2.x
Tags
8.x-2.4
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/schema/form_mode_control.settings.yml
+5
-4
5 additions, 4 deletions
config/schema/form_mode_control.settings.yml
form_mode_control.install
+29
-0
29 additions, 0 deletions
form_mode_control.install
with
34 additions
and
4 deletions
config/schema/form_mode_control.settings.yml
+
5
−
4
View file @
f9ae34bb
form_mode_control.settings
:
type
:
sequence
type
:
config_object
label
:
'
Form
Mode
Control
settings'
sequence
:
mapping
:
config_value
:
type
:
string
label
:
'
Config
value'
This diff is collapsed.
Click to expand it.
form_mode_control.install
0 → 100644
+
29
−
0
View file @
f9ae34bb
<?php
/**
* Implements hook_update_N().
* Update the schema of form_mode_control.settings configuration.
*/
function
form_mode_control_update_9001
()
{
$config_factory
=
\Drupal
::
configFactory
();
$config_name
=
'form_mode_control.settings'
;
// Load the old configuration.
$config
=
$config_factory
->
getEditable
(
$config_name
);
// Get the current sequence values.
$old_values
=
$config
->
get
(
'sequence'
);
// Transform old sequence values to new mapping structure.
if
(
is_array
(
$old_values
))
{
$new_values
=
[];
foreach
(
$old_values
as
$value
)
{
$new_values
[]
=
[
'config_value'
=>
$value
];
}
// Clear the old sequence and set the new mapping structure.
$config
->
clear
(
'sequence'
);
$config
->
set
(
'config_value'
,
$new_values
);
$config
->
save
();
}
}
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