Browse Source

i can't get the dependency injection of config correct

d9_islandora
ezoller 4 years ago
parent
commit
da26e5e5a7
  1. 15
      src/Plugin/Action/AbstractGenerateDerivative.php

15
src/Plugin/Action/AbstractGenerateDerivative.php

@ -2,7 +2,7 @@
namespace Drupal\islandora\Plugin\Action; namespace Drupal\islandora\Plugin\Action;
use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
@ -54,7 +54,7 @@ class AbstractGenerateDerivative extends EmitEvent {
/** /**
* The configFactory. * The configFactory.
* *
* @var \Drupal\Core\Config\ConfigFactory * @var \Drupal\Core\Config\ConfigFactoryInterface
*/ */
protected $configFactory; protected $configFactory;
@ -85,7 +85,7 @@ class AbstractGenerateDerivative extends EmitEvent {
* Token service. * Token service.
* @param \Drupal\Core\Messenger\MessengerInterface $messenger * @param \Drupal\Core\Messenger\MessengerInterface $messenger
* The messenger. * The messenger.
* @param \Drupal\Core\Config\ConfigFactory $configFactory * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory. * The config factory.
*/ */
public function __construct( public function __construct(
@ -101,7 +101,7 @@ class AbstractGenerateDerivative extends EmitEvent {
MediaSourceService $media_source, MediaSourceService $media_source,
TokenInterface $token, TokenInterface $token,
MessengerInterface $messenger, MessengerInterface $messenger,
ConfigFactory $configFactory ConfigFactoryInterface $config_factory
) { ) {
parent::__construct( parent::__construct(
$configuration, $configuration,
@ -113,13 +113,13 @@ class AbstractGenerateDerivative extends EmitEvent {
$stomp, $stomp,
$auth, $auth,
$messenger, $messenger,
$configFactory $config_factory
); );
$this->config = $configFactory;
$this->utils = $utils; $this->utils = $utils;
$this->mediaSource = $media_source; $this->mediaSource = $media_source;
$this->token = $token; $this->token = $token;
$this->messenger = $messenger; $this->messenger = $messenger;
$this->configFactory = $config_factory;
} }
/** /**
@ -147,6 +147,7 @@ class AbstractGenerateDerivative extends EmitEvent {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function defaultConfiguration() { public function defaultConfiguration() {
dsm($this->configFactory->get('system.file')->get('default_scheme'));
return [ return [
'queue' => 'islandora-connector-houdini', 'queue' => 'islandora-connector-houdini',
'event' => 'Generate Derivative', 'event' => 'Generate Derivative',
@ -155,7 +156,7 @@ class AbstractGenerateDerivative extends EmitEvent {
'mimetype' => '', 'mimetype' => '',
'args' => '', 'args' => '',
'destination_media_type' => '', 'destination_media_type' => '',
'scheme' => $this->config->get('default_scheme'), 'scheme' => $this->configFactory->get('system.file')->get('default_scheme'),
'path' => '[date:custom:Y]-[date:custom:m]/[node:nid].bin', 'path' => '[date:custom:Y]-[date:custom:m]/[node:nid].bin',
]; ];
} }

Loading…
Cancel
Save