Skip to content
Snippets Groups Projects
Commit 22ca1036 authored by Sven Schüring's avatar Sven Schüring Committed by Sven Schüring
Browse files

Fix #3384235: deprecation dynamic property

parent 1af2d20d
Branches
Tags
1 merge request!25Fix #3384235: deprecation dynamic property
......@@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
/**
* Provides a 'OpenReadspeakerBlock' block.
......@@ -28,6 +28,12 @@ class OpenReadspeakerBlock extends BlockBase implements ContainerFactoryPluginIn
*/
protected $configFactory;
/**
* The request stack.
*
* @var \Symfony\Component\HttpFoundation\RequestStack
*/
protected $requestStack;
/**
* Constructs a Drupal\Component\Plugin\PluginBase object.
*
......@@ -39,7 +45,7 @@ class OpenReadspeakerBlock extends BlockBase implements ContainerFactoryPluginIn
* The plugin implementation definition.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Symfony\Component\HttpFoundation\Request $request
* @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
* The current request.
*/
public function __construct(
......@@ -47,10 +53,10 @@ class OpenReadspeakerBlock extends BlockBase implements ContainerFactoryPluginIn
$plugin_id,
$plugin_definition,
ConfigFactoryInterface $config_factory,
Request $request) {
RequestStack $requestStack) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->configFactory = $config_factory;
$this->request = $request;
$this->requestStack = $requestStack;
}
/**
......@@ -62,7 +68,7 @@ class OpenReadspeakerBlock extends BlockBase implements ContainerFactoryPluginIn
$plugin_id,
$plugin_definition,
$container->get('config.factory'),
$container->get('request_stack')->getCurrentRequest()
$container->get('request_stack')
);
}
......@@ -128,9 +134,10 @@ class OpenReadspeakerBlock extends BlockBase implements ContainerFactoryPluginIn
$accountid = $config->get('open_readspeaker_accountid');
$cdn = $config->get('open_readspeaker_cdn_region');
$post_mode = $config->get('open_readspeaker_post_mode');
$request = $this->requestStack->getCurrentRequest();
$url = Url::fromRoute(
'<current>',
$this->request->query->all(),
$request->query->all(),
['absolute' => TRUE]
)->toString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment