Skip to content
Snippets Groups Projects
Commit 8ff25334 authored by Jay Friendly's avatar Jay Friendly Committed by Jay Friendly
Browse files

Issue #2976569 by zenimagine, Jaypan: The action block does not work anymore

parent 128606a6
No related branches found
Tags 8.x-2.0-beta13
No related merge requests found
......@@ -5,7 +5,6 @@ namespace Drupal\private_message\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Block\BlockPluginInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Routing\ResettableStackedRouteMatchInterface;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\Core\Url;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -30,13 +29,6 @@ class PrivateMessageActionsBlock extends BlockBase implements BlockPluginInterfa
*/
protected $currentUser;
/**
* The current route matcher.
*
* @var \Drupal\Core\Routing\ResettableStackedRouteMatchInterface
*/
protected $currentRouteMatcher;
/**
* Constructs a PrivateMessageForm object.
*
......@@ -48,20 +40,16 @@ class PrivateMessageActionsBlock extends BlockBase implements BlockPluginInterfa
* The plugin definition.
* @param \Drupal\Core\Session\AccountProxyInterface $currentUser
* The current user.
* @param \Drupal\Core\Routing\ResettableStackedRouteMatchInterface $currentRouteMatcher
* The current route matcher.
*/
public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
AccountProxyInterface $currentUser,
ResettableStackedRouteMatchInterface $currentRouteMatcher
AccountProxyInterface $currentUser
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->currentUser = $currentUser;
$this->currentRouteMatcher = $currentRouteMatcher;
}
/**
......@@ -72,8 +60,7 @@ class PrivateMessageActionsBlock extends BlockBase implements BlockPluginInterfa
$configuration,
$plugin_id,
$plugin_definition,
$container->get('current_user'),
$container->get('current_route_match')
$container->get('current_user')
);
}
......@@ -81,7 +68,7 @@ class PrivateMessageActionsBlock extends BlockBase implements BlockPluginInterfa
* {@inheritdoc}
*/
public function build() {
if ($this->currentUser->hasPermission('use private messaging system') && $this->currentRouteMatcher->getRouteName() == 'private_message.private_message_page') {
if ($this->currentUser->hasPermission('use private messaging system')) {
$url = Url::fromRoute('private_message.private_message_create');
$block['links'] = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment