Skip to content
Snippets Groups Projects
Commit 82bdf3bd authored by piggito's avatar piggito Committed by Julian Pustkuchen
Browse files

Issue #3148636 by piggito, taras.suliatitskiy, Anybody: Automated Drupal 9 compatibility fixes

parent a9677b92
No related branches found
No related tags found
1 merge request!1Issue #3148636: Automated Drupal 9 compatibility fixes
name: 'Restrict IP'
description: 'Restricts access to the site to a list of user defined IP addresses'
core: '8.x'
core_version_requirement: ^8 || ^9
type: 'module'
configure: restrict_ip.admin_page
......@@ -4,6 +4,7 @@ use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Asset\AttachedAssetsInterface;
use Drupal\block\BlockInterface;
Use Drupal\block\BlockRepositoryInterface;
/**
* Implementation of hook_block_access()
......@@ -38,7 +39,7 @@ function restrict_ip_preprocess_page(&$build)
{
if(\Drupal::service('restrict_ip.service')->userIsBlocked())
{
$regions = system_region_list(\Drupal::service('theme.manager')->getActiveTheme()->getName(), REGIONS_ALL);
$regions = system_region_list(\Drupal::service('theme.manager')->getActiveTheme()->getName(), BlockRepositoryInterface::REGIONS_ALL);
unset($regions['content']);
$whitelisted_regions = Drupal::service('module_handler')->invokeAll('restrict_ip_whitelisted_regions');
......
......@@ -125,6 +125,6 @@ class RestrictIpEventSubscriber implements EventSubscriberInterface
private function setMessage($message)
{
drupal_set_message($message);
\Drupal::messenger()->addStatus($message);
}
}
......@@ -190,7 +190,7 @@ class RestrictIpAccessTest extends RestrictIpBrowserTestBase
$counter = 1;
}
$node = $this->container->get('entity.manager')->getStorage('node')
$node = $this->container->get('entity_type.manager')->getStorage('node')
->create([
'type' => 'article',
'title' => 'Article ' . $counter,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment