|
|
@ -14,6 +14,7 @@ use Drupal\Core\Session\AccountInterface; |
|
|
|
use Drupal\Core\StringTranslation\StringTranslationTrait; |
|
|
|
use Drupal\Core\StringTranslation\StringTranslationTrait; |
|
|
|
use Drupal\islandora\Event\StompHeaderEvent; |
|
|
|
use Drupal\islandora\Event\StompHeaderEvent; |
|
|
|
use Drupal\islandora\Event\StompHeaderEventException; |
|
|
|
use Drupal\islandora\Event\StompHeaderEventException; |
|
|
|
|
|
|
|
use Drupal\islandora\Exception\IslandoraDerivativeException; |
|
|
|
use Stomp\Exception\StompException; |
|
|
|
use Stomp\Exception\StompException; |
|
|
|
use Stomp\StatefulStomp; |
|
|
|
use Stomp\StatefulStomp; |
|
|
|
use Stomp\Transport\Message; |
|
|
|
use Stomp\Transport\Message; |
|
|
@ -157,10 +158,6 @@ abstract class EmitEvent extends ConfigurableActionBase implements ContainerFact |
|
|
|
|
|
|
|
|
|
|
|
$user = $this->entityTypeManager->getStorage('user')->load($this->account->id()); |
|
|
|
$user = $this->entityTypeManager->getStorage('user')->load($this->account->id()); |
|
|
|
$data = $this->generateData($entity); |
|
|
|
$data = $this->generateData($entity); |
|
|
|
// If $data is the bool false, then abort. No error, but don't emit event. |
|
|
|
|
|
|
|
if ($data === FALSE) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$event = $this->eventDispatcher->dispatch( |
|
|
|
$event = $this->eventDispatcher->dispatch( |
|
|
|
StompHeaderEvent::EVENT_NAME, |
|
|
|
StompHeaderEvent::EVENT_NAME, |
|
|
@ -172,6 +169,10 @@ abstract class EmitEvent extends ConfigurableActionBase implements ContainerFact |
|
|
|
$event->getHeaders()->all() |
|
|
|
$event->getHeaders()->all() |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
catch (IslandoraDerivativeException $e) { |
|
|
|
|
|
|
|
$this->logger->info($e->getMessage()); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
catch (StompHeaderEventException $e) { |
|
|
|
catch (StompHeaderEventException $e) { |
|
|
|
$this->logger->error($e->getMessage()); |
|
|
|
$this->logger->error($e->getMessage()); |
|
|
|
$this->messenger->addError($e->getMessage()); |
|
|
|
$this->messenger->addError($e->getMessage()); |
|
|
|