By rosk0 on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
main
Introduced in version:
TBD
Issue links:
Description:
New ContentModerationStateChangedEvent event has been added, which provides the ability to react to the state change on the moderated content entity.
Code example
final class ContentModerationStateChangedSubscriber implements EventSubscriberInterface {
public function onModerationStateChange(ContentModerationStateChangedEvent $event): void {
// Report, log or send an email.
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array {
return [
ContentModerationEvents::STATE_CHANGED => ['onModerationStateChange'],
];
}
}
Impacts:
Module developers