Skip to content

Commit

Permalink
Excluded extra fields from config.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Aug 1, 2023
1 parent c03ad11 commit 77b3614
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@ public function filterWrite($name, array $data) {
}
}

// Exclude hidden fields added by the optional modules.
if (fnmatch('core.entity_view_display.*', $name)) {
unset($data['hidden']['search_api_excerpt']);
}

// Exclude processing for some properties of the blocks.
if (fnmatch('block.block.civictheme_*', $name)) {
// Unset dependencies.
unset($data['dependencies']['content']);

if (!empty($data['dependencies']['module'])) {
foreach ($data['dependencies']['module'] as $key => $module_name) {
if (in_array($module_name, ['block_content'])) {
unset($data['dependencies']['module'][$key]);
}
}
if (empty($data['dependencies']['module'])) {
unset($data['dependencies']['module']);
}
}
}

return $data;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,7 @@ function civictheme_provision_permissions_map() {
*
* @see https://www.drupal.org/node/2652542
* @SuppressWarnings(PHPMD.StaticAccess)
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
*
* @param bool $include_optional
* Whether to include optional dependencies. Defaults to TRUE.
Expand Down

0 comments on commit 77b3614

Please sign in to comment.