Problem/Motivation

We are currently applying blindly shipment transitions, without actually checking whether the transition we're applying is "allowed".

Following the fix from #3083407: Fire intended events when invoking a specific transition, if a transition was previously not allowed, the state was updated, but the event was skipped.

Perhaps the right fix should live in State machine that should ensure only allowed transitions are applied, but in the meantime, it still doesn't hurt for commerce_shipping to properly check that as well.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jsacksick created an issue. See original summary.

jsacksick’s picture

Status: Active » Needs review
FileSize
3.24 KB

There's an OrderWorkflowTest, that currently tests the interaction between order and shipping workflows.

We should probably expand the tests there, but at least the tests should still ensure that the expected transition is applied.

Status: Needs review » Needs work

The last submitted patch, 2: 3219843-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jsacksick’s picture

FileSize
3.81 KB

$shipment->getState()->getTransitions() already returns the list of allowed transitions, so there's no need to make the more complex than it should be...

Tests failures are unrelated, will open another issue for that.

  • jsacksick committed 7479011 on 8.x-2.x
    Issue #3219843 by jsacksick: Ensure shipment transitions are allowed...
jsacksick’s picture

Status: Needs work » Fixed

Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.