/** * {@inheritdoc} */ public function getTitle() { if (!$this->moderationInfo->isModeratableEntity($this->entity)) { // Moderation isn't enabled. return parent::getTitle(); } // @todo write a test for this. return $this->moderationInfo->isLiveRevision($this->entity) ? $this->t('New draft') : $this->t('Edit draft'); }