Handle publication status of entities that have a published flag.
4 unresolved threads
Handle publication status of viable entities.
Closes #3478179
Merge request reports
Activity
changed this file in version 3 of the diff
- src/Event/RdfSyncEvent.php 0 → 100644
11 /** 12 * Occurs before syncing the entities to the endpoint. 13 * 14 * Subscribers are able to alter the list of entities to be synced or perform 15 * additional actions. 16 */ 17 class RdfSyncEvent extends Event { 18 19 /** 20 * Constructs a new event class instance. 21 * 22 * @param \Drupal\rdf_sync\Model\SyncMethod $syncMethod 23 * The sync method. 24 * @param ContentEntityInterface[] $entities 25 * The objects to be synced. 26 */ changed this line in version 3 of the diff
26 * Filters out unpublished entities. 27 * 28 * @param \Drupal\rdf_sync\Event\RdfSyncEvent $event 29 * The event object. 30 */ 31 public function filterOutUnpublished(RdfSyncEvent $event): void { 32 $entities = $event->getEntities(); 33 $entities = array_filter($entities, function ($entity): bool { 34 // Do not filter out entities that do not implement 35 // EntityPublishedInterface as we cannot determine their publication 36 // status and might filter out entities that should be synced. 37 if (!$entity instanceof EntityPublishedInterface) { 38 return TRUE; 39 } 40 41 return $entity->isPublished(); changed this line in version 3 of the diff
1 services: 2 rdf_sync_published.sync.subscriber: 3 class: Drupal\rdf_sync_published\EventSubscriber\RdfSyncPublishedSubscriber 4 tags: 5 - { name: event_subscriber } changed this line in version 3 of the diff
added 1 commit
- 4bbe7484 - Ensure state cache is cleared when the state is updated in Drush.
Please register or sign in to reply