Browse Source

remove pager and unncessary comments, wrap adding isNewVersion in a check for not being a generate derivative message

pull/733/head
Eli Zoller 6 years ago
parent
commit
0f91ce59c6
  1. 6
      src/EventGenerator/EventGenerator.php

6
src/EventGenerator/EventGenerator.php

@ -100,13 +100,14 @@ class EventGenerator implements EventGeneratorInterface {
$event["type"] = ucfirst($data["event"]); $event["type"] = ucfirst($data["event"]);
$event["summary"] = ucfirst($data["event"]) . " a " . ucfirst($entity_type); $event["summary"] = ucfirst($data["event"]) . " a " . ucfirst($entity_type);
} }
if ($data['event'] != "Generate Derivative") {
$isNewRev = FALSE; $isNewRev = FALSE;
if ($entity->getEntityType()->isRevisionable()) { if ($entity->getEntityType()->isRevisionable()) {
\Drupal::logger('islandora')->notice('its revisionable');
$isNewRev = $this->isNewRevision($entity); $isNewRev = $this->isNewRevision($entity);
\Drupal::logger('is new revision')->notice($isNewRev);
} }
$event["object"]["isNewVersion"] = $isNewRev; $event["object"]["isNewVersion"] = $isNewRev;
}
// Add REST links for non-file entities. // Add REST links for non-file entities.
if ($entity_type != 'file') { if ($entity_type != 'file') {
@ -187,7 +188,6 @@ class EventGenerator implements EventGeneratorInterface {
->allRevisions() ->allRevisions()
->condition($media->getEntityType()->getKey('id'), $media->id()) ->condition($media->getEntityType()->getKey('id'), $media->id())
->sort($media->getEntityType()->getKey('revision'), 'DESC') ->sort($media->getEntityType()->getKey('revision'), 'DESC')
->pager(50)
->execute(); ->execute();
return array_keys($result); return array_keys($result);
} }

Loading…
Cancel
Save