The module now has a beta release. Some functionalities may not have been ported yet. See the relevant issues fot that. Patches are welcome.

D7-version
Status per 1-jan-2015:
The current version of D7.x-2.x, contains the following steps:
- fix all/most open errors (per 1-1-2015) from D7.x-1.x (done)
- re-engineer code into D8-style objects and classes (done) - this should ease the migration to D8, and rationalise the existing code base.
- add support for Fields, by adding the 'Workflow Field' module, splitting old-style code into 'Workflow Node' submodule, and moving obsolete code into a separate include (done)
- add support for multiple Workflow Fields per Entity type (done, with some restrictions)
- incorporate some heavily used 3rd-party modules that were used for version 7.x-1.x in collaboration with the 3rd-marty maintainers, (done)

Release 2.5 is now out, waiting for feedback from the crowd, and to get a workload of new issues/errors.
The current functionality seems to be complete - most feature requests of the last 5 years have been rejected of accepted in the D7-2.x version.

D8-version
Status per 1-nov-2015:
Step 1, convert core-submodules:

  • convert workflow_admin_ui (done)
  • convert workflow_api (done)
  • convert workflow_field (done)
  • convert workflow_history_tab (done)
  • convert workflow_revert (done)
  • remove workflow_node (done)
  • remove workflow_search_api: it is included in entity definition
  • test hooks \Drupal::moduleHandler()->invokeAll and alter (done, introducing workflow_devel module)
  • convert workflow_history_cleanup

- In D7 'Workflow Field', the Workflow settings were moved to the Field settings. That was unnecessary, if not an error. Revert that.
- Implement the Drupal\Core\TypedData\OptionsProviderInterface (which defines a uniform way to show the possible options for a field.)
- Add possibility to make every Field a Workflow field. The OptionsProviderInterface is a great help for this.

Step 2, convert bridge-submodules, in case a stable-enough release exists for partner module:
- convert workflow_access (depending on D7-node_access() )
- convert workflow_notify ("Notify roles of Workflow transitions.")
- convert workflow_actions (todo: rename to workflow_trigger)
- convert workflow_vbo (done, converted into 2 Action plugins; the submodule is removed.)
- convert workflow_rules (depending on https://www.drupal.org/project/rules )
- convert workflow_views (depending on core Views)
- convert workflow.features.inc ?? (depending on https://www.drupal.org/project/features )
- convert workflow.tokens.inc (depending on core and/or https://www.drupal.org/project/token )

Step 3, for each converted submodule:
- remove workflow.deprecated.inc;
- remove text 'deprecated' from files;
- remove checks for: workflow_field, workflow_node, if ($field_name) ; (a field_name now always exist);
- #2354655: [D8-port task] Rename machine_name of workflow_vbo, workflow_actions

For the remaining tasks, a subtask is attached. Volunteers are welcome to post patches.

Comments

johnv’s picture

Issue summary: View changes
johnv’s picture

Issue summary: View changes

  • johnv committed 9a95f7c on 8.x-1.x
    Issue #2351299: D8-port: remove old files
    
johnv’s picture

Issue summary: View changes

  • johnv committed 5fd252d on 8.x-1.x
    Issue #2351299: D8-port: rename directory includes to src
    

  • johnv committed ecd7972 on 7.x-2.x
    Issue #2351299: Prepare D8-Port: split class files
    

  • johnv committed e01a703 on 8.x-1.x
    Issue #2351299: Prepare D8-Port: split class files
    
johnv’s picture

Issue summary: View changes

  • johnv committed 07db77b on 8.x-1.x
    Issue #2351299: D8-Port: create modules directory
    

  • johnv committed 0a38929 on 8.x-1.x
    Issue #2351299: D8-Port: rename module workflow_admin_ui to workflow_ui...

  • johnv committed eca15dc on 8.x-1.x
    Issue #2351299: D8-port: update .info file
    

  • johnv committed 761cec0 on 8.x-1.x
    Issue #2351299: D8-port: remove obsolete files entity.inc and deprecated...

  • johnv committed 2ecbe07 on 8.x-1.x
    Issue #2351299: D8-port: added initial workflow.*.yml files
    

  • johnv committed de86233 on 8.x-1.x
    Issue #2351299: D8-port: Porting Workflow UI: Workflow object completed...
johnv’s picture

  • johnv committed 903c895 on 8.x-1.x
    Issue #2351299: D8-port: Porting Workflow UI: Workflow object completed...

  • johnv committed fdfc2f8 on 8.x-1.x
    Issue #2351299: D8-port: Porting Workflow UI: WorkflowState object...

  • johnv committed 5bc2730 on 8.x-1.x
    Issue #2351299: D8-port: Porting Workflow UI: better page titles
    

  • johnv committed 686d277 on 8.x-1.x
    Issue #2351299: D8-port: Porting Workflow UI: WorkflowState
    

  • johnv committed 34bb9f3 on 8.x-1.x
    Issue #2351299: D8-port: Porting Workflow UI: WorkflowConfigTransition...

  • johnv committed 26d5652 on 8.x-1.x
    Issue #2351299: D8-port: Workflow UI: move calls to...
johnv’s picture

The current status so far:

The Workflow UI module is now ported, except for the 'labels' page. (This is the second list builder for the same ConfigEntityType 'workflow_config_transition'. Any suggestions how to do that? I suppose I should create 2 Form classes, and switch them via the formBuilder() in WorkflowonfigTransitionsListBuilder class.
See https://www.drupal.org/node/2188851 )

- #2571697: D8-port: remove 'Permissions page' from Workflow UI.
- #2571093: [D8-port task] The machine_name of WorkflowState needs attention

There are more issues left. See the 'TODO' string in code.

Next step: Implement Workflow Field.

  • johnv committed 55a7c93 on 8.x-1.x
    Issue #2351299: D8-port: re-add 2 tables for Workflow transitions
    

  • johnv committed eaea421 on 8.x-1.x
    Issue #2351299: D8-port: remove dpm()
    

  • johnv committed 861404e on 8.x-1.x
    Issue #2351299: D8-port: workflow_field: prepare by moving files around.
    

  • johnv committed 2046cec on 8.x-1.x
    Issue #2351299: D8-port: workflow_field: WorkflowItem completed.
    

  • johnv committed 3fece45 on 8.x-1.x
    Issue #2351299: D8-port: workflow_field: WorkflowItem completed -2-.
    

  • johnv committed e1da179 on 8.x-1.x
    Issue #2351299: D8-port: workflow_field: WorkflowDefaultWidget completed...
johnv’s picture

After above commit, a rudimentary Workflow Field is functional. You can:
- maintain Workflows with states and transitions (no labels).
- add a Workflow field to your entity type (WorkflowItem).
- change the value of the Workflow state (using the WorkflowDefaultWidget).

Some functionalitiy is lacking:
- you see always all states in the Widget, not only the permitted states; (here are some problems with D8-api.)
- when saving an entity, the state is updated, but no transition is logged or scheduled. (this is the next step.)
- The formatter is yet to be done (using WorkflowDefaultFormatter). The default string-formatter is used.

  • johnv committed fe53043 on 8.x-1.x
    Issue #2351299: D8-port: replace deprecated 'fieldset' in forms.
    

  • johnv committed 127e9cd on 8.x-1.x
    Issue #2351299: D8-port: replace deprecated 'fieldset' in forms. -2-
    
johnv’s picture

Issue summary: View changes

  • johnv committed c37fdb5 on 8.x-1.x
    Issue #2351299: D8-port: fixed filtering of allowed transitions in...

  • johnv committed ba8e302 on 8.x-1.x
    Issue #2351299: D8-port: removed remains of workflow_node in workflow....
johnv’s picture

In case anyone is actively listening to this channel, I will leave this as-is for the next days. So now is the time to test the current situation and give some feedback. Thanks.

  • johnv committed 915aef9 on 8.x-1.x
    Issue #2351299: D8-port: merged hook_help for orkflow_field
    

  • johnv committed e4a86cf on 8.x-1.x
    Issue #2351299: D8-port: merged hook_help for orkflow_field -2-
    

  • johnv committed 430c30d on 8.x-1.x
    Issue #2351299: D8-port: workflow_field now works with core formatters...

  • johnv committed b3731b3 on 8.x-1.x
    Issue #2351299: D8-port: Porting Workflow UI: Labels page added
    
johnv’s picture

Issue summary: View changes
johnv’s picture

For testing purposes, I removed the special permissions for User 1 (enabling him to sue every state transition)

src/Entity/WorkflowState.php://    elseif($user && $user->id() == 1) {
src/Entity/WorkflowTransition.php://    elseif($user && $user->id() == 1) {

  • johnv committed 6d13301 on 8.x-1.x
    Issue #2351299: D8-port: harmonize , ,
    
johnv’s picture

Issue summary: View changes

Todo : test the hooks \Drupal::moduleHandler()->invokeAll and alter

  • johnv committed 9e2da43 on 8.x-1.x
    Issue #2351299: D8-port: WorkflowDefaultWidget saves History
    
Maouna’s picture

I am very interested in a Drupal 8 version of your module. In order to get an overview of it, I tried installing it. Unfortunately that failed because of the missing WorkflowTransitionInterface. In case this module is what I am looking for, I am happy to contribute to its developement. Please let me know, how to get started.

johnv’s picture

@Maouna , indeed. I forgot to include this file in the last commit. It will be repaired in the next one. Apologies.
Thanks for your interest.

  • johnv committed d7d8ccf on 8.x-1.x
    Issue #2351299: D8-port: Widget also reads/saves ScheduledTransition
    

  • johnv committed 38ddb61 on 8.x-1.x
    Issue #2351299: D8-port: hook_cron() also executes ScheduledTransition
    

  • johnv committed e1438d9 on 8.x-1.x
    Issue #2351299: D8-port: move some hooks to new WorkflowManager class
    

  • johnv committed cc6b508 on 8.x-1.x
    Issue #2351299: D8-port: converted workflow_get_<type>_names() functions...

  • johnv committed d343a5e on 8.x-1.x
    Issue #2351299: D8-port: replaced 'node' by 'entity' in comments and...

  • johnv committed b37780d on
    Issue #2351299: D8-port: replaced 'node' by 'entity' in comments and...

  • johnv committed 9607d4b on 8.x-1.x
    Issue #2351299: D8-port: move classes around.
    

  • johnv committed dcdb346 on 8.x-1.x
    Issue #2351299: D8-port: move classes around.
    

  • johnv committed 00ac219 on 8.x-1.x
    Issue #2351299: D8-port: move helper functions for Form to separate...

  • johnv committed 91b05f2 on 8.x-1.x
    Issue #2351299: D8-port: remove obsolete function workflow_reset_cache...

  • johnv committed 64941a1 on 8.x-1.x
    Issue #2351299: D8-port: added Workflow History tab (still without form)
    
  • johnv committed 6d30ab1 on 8.x-1.x
    Issue #2351299: D8-port: added Workflow History tab (remove obsolete...
johnv’s picture

The Workflow History tab is now added to D8.
Still to do:
- the row theming is lost.
- add the workflow form abovve the list.
- add this page to every entity, not only nodes.
- add Operations column to list (to revert, edit transitions).

  • johnv committed 9104943 on 8.x-1.x
    Issue #2351299: D8-port: added Workflow History tab (remove obsolete...

  • johnv committed c9d0d56 on 8.x-1.x
    Issue #2351299: D8-port: added Workflow History tab (remove obsolete...

  • johnv committed 0939508 on 8.x-1.x
    Issue #2351299: D8-port: ported legacy functions from workflow.module
    

  • johnv committed 8b53fd1 on 8.x-1.x
    Issue #2351299: D8-port: ported legacy function from workflow.module
    

  • johnv committed 7800726 on 8.x-1.x
    Issue #2351299: D8-port: add helper function workflow_debug().
    

  • johnv committed 8396c21 on 8.x-1.x
    Issue #2351299: D8-port: introduce WorkflowTransitionElement.
    

  • johnv committed 85821a3 on 8.x-1.x
    Issue #2351299: D8-port: fixed error when maintaining ConfigTransitions.
    

  • johnv committed f5735e6 on 8.x-1.x
    Issue #2351299: D8-port: add Workflow History tab (only for nodes).
    
johnv’s picture

The Workflow History is now converted to D8 for Nodes.

Todo for the History tab:
- add menu items for every Entity Type, not only Nodes.

The next commit allows the Workflow Field to be used on non-Nodes entity types.

  • johnv committed 4123c9d on 8.x-1.x
    Issue #2351299: D8-port: add Workflow for non-Nodes. (no History tab yet...
eyilmaz’s picture

\Drupal\workflow\Plugin\Derivative\WorkflowLocalTask
doesn't exists currently. Did you forgot to add it?

johnv’s picture

@eyilmaz. No, it shouldn't have been there. Fixed it . Thanks.

  • johnv committed cfcda10 on
    Issue #2351299: D8-port: remove reference to unwanted LocalTask class
    

  • johnv committed bc067f0 on 8.x-1.x
    Issue #2351299: D8-port: WorkflowStateListBuilder: review code + disable...
johnv’s picture

This is what is todo for the Workfow UI WorkflowState list:
- enable Operations column + hook_workflow_operations + edit permissions.
- enable De-activate state: status column + reassign + count.
- enable interactive machine_name element.

  • johnv committed 3238cce on 8.x-1.x
    Issue #2351299: D8-port: fixed WorkflowState->count().
    

  • johnv committed 2e53b36 on 8.x-1.x
    Issue #2351299: D8-port: Fixed WorkflowHistory Tab for Nodes and Terms,...

  • johnv committed 487909c on 8.x-1.x
    Issue #2351299: D8-port: Fixed errormessage when creating new entity.
    

  • johnv committed ea0ccd2 on 8.x-1.x
    Issue #2351299: D8-port: Fixed errormessage when creating new entity.
    

  • johnv committed eaad72d on 8.x-1.x
    Issue #2351299: D8-port: Fixed delete() methods; removed delete function...
johnv’s picture

Above commit removes the custom 'delete' hooks. You can use the core hook_entity_delete() and hook_entity_predelete() hooks. This is documented in workflow.api.php:

diff --git a/workflow.api.php b/workflow.api.php
@@ -67,18 +68,12 @@ function hook_workflow($op, $id, $new_sid, $entity, $force, $entity_type = '', $
       break;
 
     case 'transition delete':
     case 'state delete':
     case 'workflow delete':
+      // These hooks are removed in D8, in favour of the core hooks:
+      // - workflow_entity_predelete(EntityInterface $entity)
+      // - workflow_entity_delete(EntityInterface $entity)
+      // See examples at the bottom of this file.
       break;
   }
johnv’s picture

This commit bcbf7a4 converts the WorkflowTransitionBlock, which used to be part of the workflow_extensions module.

Todo:
- when the block is shown, and a state is scheduled, the form elements are wrapped oddly.
- add to user documentation that the 'formatter' that showed a widget does not exist. If you want to be able to change a state on a Node Page, you need to add this block.
- add to use documentation how to add the block.
- add a configuration, so the block is added immediately upon install??

  • johnv committed f046aa7 on 8.x-1.x
    Issue #2351299: D8-port: Fixed orphaned transition_history records when...

  • johnv committed 121fa74 on 8.x-1.x
    Issue #2351299: D8-port: Fixed missing watchdog messages when using...

  • johnv committed be4983c on 8.x-1.x
    Issue #2351299: D8-port: Fixed missing watchdog messages with schedule...

  • johnv committed 8016810 on 8.x-1.x
    Issue #2351299: D8-port: Removed calls to dpm().
    

  • johnv committed 92941bb on 8.x-1.x
    Issue #2351299: D8-port: reorg code for submitting Transition Form
    

  • johnv committed 5f0b64f on 8.x-1.x
    Issue #2351299: D8-port: move file for class WorkfflowTransitionForm
    

  • johnv committed b8e7952 on 8.x-1.x
    Issue #2351299: D8-port: remove dependency on devel module
    

  • johnv committed 30a3ec8 on 8.x-1.x
    Issue #2351299: fixed better naming for ConfigEntities.
    
  • johnv committed 35edc9f on 8.x-1.x
    Issue #2351299: D8-port: review of Workflow*Transition code
    
  • johnv committed 3f262a2 on 8.x-1.x
    Issue #2351299: fixed error on Element when state is deleted.
    
  • johnv committed 7173402 on 8.x-1.x
    Issue #2351299: removed selection on langcode. Needs separate task to...
  • johnv committed ee5d805 on 8.x-1.x
    Issue #2351299: fixed error on Element when state is deleted.
    

  • johnv committed 1b128e4 on 8.x-1.x
    Issue #2351299: update to D8RC1 interfaces.
    

  • johnv committed 8019030 on 8.x-1.x
    Issue #2351299: update to D8RC1 interfaces.
    

  • johnv committed abf7088 on 8.x-1.x
    Issue #2351299: Implement EntityOwnerInterface
    

  • johnv committed 7572384 on 8.x-1.x
    Issue #2351299: Move some permissions to workflow_operations
    

  • johnv committed 8a32240 on 8.x-1.x
    Issue #2351299: update to D8RC1 interfaces.
    

  • johnv committed 5b53c50 on 8.x-1.x
    Issue #2351299: fix workflow_url_get_entity().
    

  • johnv committed bc59ba9 on 7.x-2.x
    Issue #2351299: Undo Prepare D8-Port: split class files
    

  • johnv committed 8efab56 on 7.x-2.x
    Issue #2351299: Undo Prepare D8-Port: split class files
    

  • johnv committed 00c6958 on 7.x-2.x
    Issue #2351299: Prepare D8-port: move forms in own file.
    

  • johnv committed a11a62c on 8.x-1.x
    Issue #2351299: Remove unused D7-info files, D7-css files
    

  • johnv committed 06cd77a on 8.x-1.x
    Issue #2351299: Fixed error in workflow_ui when url has prefixes.
    

  • johnv committed cf9fd8d on 8.x-1.x
    Issue #2351299: Fixed error in workflow_ui when url has prefixes.
    
johnv’s picture

Issue summary: View changes

  • johnv committed 2cabb1d on 8.x-1.x
    Issue #2351299: Refurbish WorkflowTransitionInterface and properties
    

  • johnv committed fbacaca on 8.x-1.x
    Issue #2351299: Refurbish some code
    

  • johnv committed 2c8ad27 on 8.x-1.x
    Issue #2351299: Fixed warning
    

  • johnv committed 54d979d on 8.x-1.x
    Issue #2351299: Fixed small errors in DefaultWidget.
    

  • johnv committed 897164d on 8.x-1.x
    Issue #2351299: deprecated workflow_execute_transition
    

  • johnv committed 7464cbd on 8.x-1.x
    Issue #2351299: Remove unused WORKFLOWFIELD_PROPERTY_TYPE
    

  • johnv committed 63a40cb on 8.x-1.x
    Issue #2351299: Move WorkflowTransitionListBuilder.php
    

  • johnv committed ac88b42 on 8.x-1.x
    Issue #2351299: Fixed error when creating Scheduled Transition
    

  • johnv committed f849af6 on 8.x-1.x
    Issue #2351299: Fixed duplicated Formatter
    
johnv’s picture

Today I created a beta1 release. Tested agains rc2.
When drupal 8.0.0. is out, I'll test against that version.

  • johnv committed 5692c88 on 8.x-1.x
    Issue #2351299: Add canonical entity-links
    

  • johnv committed 70fe3ee on 8.x-1.x
    Issue #2351299: Add canonical entity-links
    
johnv’s picture

Status: Active » Fixed

A beta2 version is out now. Thanks for your interest.

We still need some volunteers to complete the Token support and Views support. If someone could lend a hand,, ...

johnv’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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