diff --git a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRule.php b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRule.php index ad8d82252a..54d8db0be9 100644 --- a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRule.php +++ b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRule.php @@ -11,7 +11,10 @@ class ConsistentStepMapRule implements WorkflowNodeVisitor { public function initialize(Workflow $workflow): void { foreach ($workflow->getSteps() as $id => $step) { if ($id !== $step->getId()) { - throw Exceptions::workflowStructureNotValid(__('TODO', 'mailpoet')); + // translators: %1$s is the ID of the step, %2$s is its index in the steps object. + throw Exceptions::workflowStructureNotValid( + sprintf(__("Step with ID '%1\$s' stored under a mismatched index '%2\$s'.", 'mailpoet'), $step->getId(), $id) + ); } } } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRuleTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRuleTest.php index d760719627..cc156fd7f4 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRuleTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRuleTest.php @@ -15,7 +15,7 @@ class ConsistentStepMapRuleTest extends WorkflowRuleTest { ]]); $this->expectException(UnexpectedValueException::class); - $this->expectExceptionMessage('Invalid workflow structure: TODO'); + $this->expectExceptionMessage("Invalid workflow structure: Step with ID 'a' stored under a mismatched index 'root'."); (new WorkflowWalker())->walk($workflow, [new ConsistentStepMapRule()]); }