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
4424f0ee
Commit
4424f0ee
authored
2 years ago
by
ambient.impact
Browse files
Options
Downloads
Patches
Plain Diff
Updated hooks to work with new Config Devel issue fork:
https://www.drupal.org/project/config_enforce_devel/issues/3345668
parent
9fdf4f8c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!17
Updated hooks to work with new Config Devel issue fork and updated patch:
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config_enforce_devel.module
+4
-4
4 additions, 4 deletions
config_enforce_devel.module
src/ConfigDevelHelper.php
+9
-4
9 additions, 4 deletions
src/ConfigDevelHelper.php
with
13 additions
and
8 deletions
config_enforce_devel.module
+
4
−
4
View file @
4424f0ee
...
...
@@ -17,9 +17,9 @@ function config_enforce_devel_form_alter(&$form, FormStateInterface &$form_state
}
/**
* Implements hook_config_devel_auto_import().
* Implements hook_config_devel_auto_import
_files
().
*/
function
config_enforce_devel_config_devel_auto_import
()
{
function
config_enforce_devel_config_devel_auto_import
_files
()
{
return
ConfigDevelHelper
::
autoImport
();
}
...
...
@@ -31,9 +31,9 @@ function config_enforce_devel_config_devel_post_auto_import($auto_import) {
}
/**
* Implements hook_config_devel_auto_export().
* Implements hook_config_devel_auto_export
_files
().
*/
function
config_enforce_devel_config_devel_auto_export
()
{
function
config_enforce_devel_config_devel_auto_export
_files
()
{
return
ConfigDevelHelper
::
autoExport
();
}
...
...
This diff is collapsed.
Click to expand it.
src/ConfigDevelHelper.php
+
9
−
4
View file @
4424f0ee
...
...
@@ -12,12 +12,12 @@ class ConfigDevelHelper {
/**
* Provide Config Devel module with configs to read from disk.
*
* @see
hook
_config_devel_auto_import()
* @see
\config_enforce_devel
_config_devel_auto_import
_files
()
*/
public
static
function
autoImport
()
{
$auto_import
=
[];
foreach
((
new
EnforcedConfigCollection
())
->
getEnforcedConfigs
()
as
$config_name
=>
$settings
)
{
$auto_import
[
$config_name
]
=
[
$auto_import
[]
=
[
'filename'
=>
$settings
[
'config_file_path'
],
'hash'
=>
isset
(
$settings
[
'hash'
])
?
$settings
[
'hash'
]
:
''
,
];
...
...
@@ -28,7 +28,7 @@ class ConfigDevelHelper {
/**
* Provide Config Devel module with config files to write to disk.
*
* @see
hook
_config_devel_auto_export()
* @see
\config_enforce_devel
_config_devel_auto_export
_files
()
*/
public
static
function
autoExport
()
{
$auto_export
=
[];
...
...
@@ -41,7 +41,7 @@ class ConfigDevelHelper {
/**
* Save hashes of auto-imported config files.
*
* @see config_enforce_devel_config_devel_post_auto_import()
* @see
\
config_enforce_devel_config_devel_post_auto_import()
*/
public
static
function
postAutoImport
(
array
$auto_import
)
{
$registries
=
(
new
TargetModuleCollection
())
->
getRegistryConfigNames
();
...
...
@@ -52,6 +52,11 @@ class ConfigDevelHelper {
// @see EnforcedConfigRegistry::updateEnforcedConfigs().
if
(
in_array
(
$config_name
,
$registries
))
continue
;
// Skip configs that we don't enforce.
if
(
!
\array_key_exists
(
$config_name
,
$enforced_configs
))
{
continue
;
}
// Check for missing hash elements, and fill them in to ensure they get regenerated.
if
(
!
isset
(
$results
[
'hash'
]))
{
$results
[
'hash'
]
=
'missing_from_config_devel_result'
;
...
...
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