You are here

public function WorkflowScheduledTransition::validate in Workflow 8

This is a hack to avoid the following error, because ScheduledTransition is not a bundle of Workflow: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "entity:workflow_scheduled_transition:first" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 60 of core\lib\Drupal\Component\Plugin\Discovery\DiscoveryTrait.php).

Overrides ContentEntityBase::validate

File

src/Entity/WorkflowScheduledTransition.php, line 76

Class

WorkflowScheduledTransition
Implements a scheduled transition, as shown on Workflow form.

Namespace

Drupal\workflow\Entity

Code

public function validate() {

  // Since this function generates an error in one use case (using WorkflowTransitionForm)
  // and is not called in the other use case (using the Workflow Widget),
  // this function is disabled for now.
  // @todo This function is only called in the WorkflowTransitionForm, not in the Widget.
  // @todo Repair https://www.drupal.org/node/2896650 .
  //
  // The following is from return parent::validate();
  $this->validated = TRUE;

  // $violations = $this->getTypedData()->validate();
  // return new EntityConstraintViolationList($this, iterator_to_array($violations));
  $violations = [];
  return new EntityConstraintViolationList($this, $violations);
}