Skip to content

Commit

Permalink
Merge pull request #350 from localgovdrupal/3.x
Browse files Browse the repository at this point in the history
3.1.3 release
  • Loading branch information
stephen-cox authored Mar 5, 2024
2 parents 2a0c687 + d699c08 commit 02351d8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions localgov_directories.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,26 @@ function localgov_directories_post_update_replace_node_type_condition() {
}
}
}

/**
* Updates the node type visibility condition again.
*
* Because we'd still been installing old config.
* https://github.com/localgovdrupal/localgov_directories/pull/342/files.
*/
function localgov_directories_post_update_replace_node_type_condition_again() {
$config_factory = \Drupal::configFactory();
foreach ($config_factory->listAll('block.block.') as $block_config_name) {
$block = $config_factory->getEditable($block_config_name);

if ($block->get('visibility.node_type')) {
$configuration = $block->get('visibility.node_type');
if ($configuration['id'] == 'node_type') {
$configuration['id'] = 'entity_bundle:node';
$block->set('visibility.entity_bundle:node', $configuration);
$block->clear('visibility.node_type');
$block->save(TRUE);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function __construct(EntityTypeManagerInterface $etm, ModuleExtensionList
/**
* Entity type manager service.
*
* @var Drupal\Core\Entity\EntityTypeManagerInterface
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected EntityTypeManagerInterface $etm;

Expand Down
2 changes: 1 addition & 1 deletion src/ConfigurationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ConfigurationHelper implements ContainerInjectionInterface {
/**
* The Search API directory index.
*
* @var \Drupal\search_api\Entity\IndexInterface
* @var \Drupal\search_api\IndexInterface
*/
protected ?IndexInterface $index;

Expand Down

0 comments on commit 02351d8

Please sign in to comment.