From 0014f13c5b30a3e7e3382cf8656e0837e4e8a0cf Mon Sep 17 00:00:00 2001 From: nagyad Date: Wed, 5 Apr 2023 12:13:16 +0200 Subject: [PATCH 1/2] EWPP-3080: Make getNextTransitions public and NULL out unused argument. --- .../src/CorporateWorkflowStateTransitionValidation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/oe_editorial_corporate_workflow/src/CorporateWorkflowStateTransitionValidation.php b/modules/oe_editorial_corporate_workflow/src/CorporateWorkflowStateTransitionValidation.php index 2abb09e..e8cc3b1 100755 --- a/modules/oe_editorial_corporate_workflow/src/CorporateWorkflowStateTransitionValidation.php +++ b/modules/oe_editorial_corporate_workflow/src/CorporateWorkflowStateTransitionValidation.php @@ -59,7 +59,7 @@ public function getValidTransitions(ContentEntityInterface $entity, AccountInter * * @param \Drupal\workflows\StateInterface $current_state * The actual state. - * @param \Drupal\Core\Entity\ContentEntityInterface $entity + * @param \Drupal\Core\Entity\ContentEntityInterface|null $entity * The entity under moderation. * @param array $next_transitions * The next available transitions in the chain that we keep track of by @@ -68,7 +68,7 @@ public function getValidTransitions(ContentEntityInterface $entity, AccountInter * @return array * The next available transitions in the chain. */ - protected function getNextTransitions(StateInterface $current_state, ContentEntityInterface $entity, array &$next_transitions = []): array { + public function getNextTransitions(StateInterface $current_state, ?ContentEntityInterface $entity = NULL, array &$next_transitions = []): array { $transitions = $current_state->getTransitions(); if (empty($next_transitions)) { $next_transitions = $transitions; From a6d9a86a8a176b09c2dc59cc450434a54e92269f Mon Sep 17 00:00:00 2001 From: nagyad Date: Fri, 26 May 2023 12:39:49 +0200 Subject: [PATCH 2/2] EWPP-3080: Deprecate entity parameter in getNextTransitions(). --- .../src/CorporateWorkflowStateTransitionValidation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/oe_editorial_corporate_workflow/src/CorporateWorkflowStateTransitionValidation.php b/modules/oe_editorial_corporate_workflow/src/CorporateWorkflowStateTransitionValidation.php index e8cc3b1..de11f1b 100755 --- a/modules/oe_editorial_corporate_workflow/src/CorporateWorkflowStateTransitionValidation.php +++ b/modules/oe_editorial_corporate_workflow/src/CorporateWorkflowStateTransitionValidation.php @@ -60,7 +60,8 @@ public function getValidTransitions(ContentEntityInterface $entity, AccountInter * @param \Drupal\workflows\StateInterface $current_state * The actual state. * @param \Drupal\Core\Entity\ContentEntityInterface|null $entity - * The entity under moderation. + * (deprecated) The entity under moderation. The parameter is + * deprecated in 2.0.0 and will be removed from 3.0.0. * @param array $next_transitions * The next available transitions in the chain that we keep track of by * recursion.