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