Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCIR-246 : Refactor islandora_entity_status - Events #7

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Prashant-bd
Copy link
Contributor

No description provided.

/**
* Defines an event subscriber for Islandora Media.
*/
class IslandoraNodeEntitySubscriber implements EventSubscriberInterface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for convention purposes, shouldn't this be named IslandoraNodeEventSubscriber instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to IslandoraNodeEventSubscriber

foreach ($results as $result) {
$processed_nodes_message .= $result . '<br>';
}
$messenger->addMessage(new Markup($processed_nodes_message, 'html'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be using Markup here? Would a render array be preferred?

We could instead add the node messages to a list:

$messages = [];
foreach ($results as $result) {
  $messages[] = $result;
}

$message = [
  '#theme' => 'item_list',
  '#items' => $messages,
  '#title' => $this->t('Processed Nodes'),
];

$this->messenger->addMessage(\Drupal::service('renderer')->renderRoot($message));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, changed to render array.

protected $messenger;

/**
* Constructs a new IslandoraMediaSubscriber object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this is just a copypasta error, should be IslandoraNodeEventSubscriber / IslandoraNodeEntitySubscriber (depending on what the name ends up being)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to IslandoraNodeEventSubscriber

/**
* Defines an event subscriber for Islandora Media.
*/
class IslandoraMediaEntitySubscriber implements EventSubscriberInterface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be IslandoraMediaEventSubscriber right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to IslandoraMediaEventSubscriber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants