Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Install
Works with Drupal: 8.xUsing Composer to manage Drupal site dependencies
Alternative installation files
Download state_machine-8.x-1.0-rc1.tar.gztar.gz
28.04 KB
MD5: 1226d0bedbb21e5b0bd20ed152bea503
SHA-1: b0762f4ed109ffb90665c0ad0a2ea984eaa9d76a
SHA-256: 61985121a4db2c47f3e2090ea57ff7ea8a165b987d4714506b1d02666df8b2fe
Download state_machine-8.x-1.0-rc1.zipzip
56.62 KB
MD5: 298752062bc1c232209440f4f846cf1a
SHA-1: bea94c4def643f60d3134f9c5d8495ddb56c93dd
SHA-256: ce15fd3b81bd03d903c888dea277b2d9ab5346a237355738ee1f420247687c5e
Release notes
Major changes:
- Group-specific and generic events, dispatched on pre-transition and post-transition.
- WorkflowTransitionEvent now gives access to the entire transition object (getTransition()) and the state field name (getFieldName()).
- New method for applying transitions to a state field: applyTransitionById().
- New methods from getting the current and original state IDs from the state field: getId() and getOriginalId().
- Guard services now support priorities, can be generic (invoked for any workflow group)
Contributors (13)
bojanz, uniquename, joachim, idimopoulos, sardara, niko-, d70rr3s, skek, hlykos, pfrenssen, plopesc, josephdpurcell, nikathone
Changelog
Issues: 20 issues resolved.
Changes since 8.x-1.0-beta3:
Bug
- #2951243 by bojanz: Don't allow transitions to the same state
- #3012556 by bojanz, niko-: Guards don't support priorities
- #2745673 by idimopoulos: StateItemTest doesn't test guard usage properly
- #2846986 by idimopoulos, d70rr3s, skek, hlykos, pfrenssen, plopesc, bojanz: Static cache should be disabled if there is a workflow_callback
- #3012312 by bojanz: WorkflowTransitionEventSubscriber uses deprecated methods
- #2860279 by josephdpurcell, nikathone, bojanz: Multiple state transition form on the same page only update/act on the first one
- #2929131 by joachim, bojanz: docs for methods in WorkflowInterface should state what arrays are keyed by
- #2957078 by joachim: entity type specific comment
- #2838952 by sardara: Schema validation error when running functional tests
- #2832443 by sardara: WorkflowTest class not found when running tests
Feature
- #3013346 by bojanz: Allow guards to work with any workflow group
- #3012846 by bojanz: Add StateItem::applyTransitionById()
- #2982709 by uniquename, joachim, bojanz: Expand the available data in WorkflowTransitionEvent
- #2896479 by idimopoulos, bojanz: StateItem should have a getter for the original value of the field
- #2832415 by sardara, bojanz: Fire generic events when transition are applied
- #2982653 by uniquename, bojanz: Implement alter hooks for workflow and workflow group plugins