Workflow history has disappeared after upgrading from 8.x-1.7 to 2.0.0

Created on 9 June 2025, about 1 month ago

Problem/Motivation

Workflow history in Workflow tab of each content has disappeared after upgrading from 8.x-1.7 to 2.0.0
On the other hand, preview of Workflow history in /admin/structure/views/view/workflow_entity_history still appears.
Could you take a look at this?

- Drupal 10.4.6
- workflow: 2.0.0
- workflow_notification: 3.0.0-beta5 (not completely compatible with workflow 2.0.0)
- PHP: 8.3.21

workflow 2.0.0: HTML text around workflow history in Workflow tab (no table data)

<div class="views-element-container">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view' -->
<!-- BEGIN OUTPUT from 'themes/contrib/bartik/templates/classy/views/views-view.html.twig' -->
<div class="view view-workflow-entity-history view-id-workflow_entity_history view-display-id-workflow_history_tab js-view-dom-id-e357989d6958c2128d169399d2a5a819841a1fa530e68c93cddae97a7d84e3d3">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'pager' -->
<!-- BEGIN OUTPUT from 'core/modules/system/templates/pager.html.twig' -->
<!-- END OUTPUT from 'core/modules/system/templates/pager.html.twig' -->
</div>
<!-- END OUTPUT from 'themes/contrib/bartik/templates/classy/views/views-view.html.twig' -->
</div>

workflow 8.x-1.7: HTML text around workflow history in Workflow tab (table data exist)

<div class="views-element-container">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view' -->
<!-- BEGIN OUTPUT from 'themes/contrib/bartik/templates/classy/views/views-view.html.twig' -->
<div class="view view-workflow-entity-history view-id-workflow_entity_history view-display-id-workflow_history_tab js-view-dom-id-a1eb1bf82531f9248327e572ababb967f81432def497f575d59147b3c5493e6c">
<div class="view-content">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view_table__workflow_entity_history' -->
<!-- FILE NAME SUGGESTIONS:
 - views-view-table--workflow-entity-history.html.twig
 - views-view-table--workflow-entity-history.html.twig
 v views-view-table.html.twig
-->
<!--  BEGIN CUSTOM TEMPLATE OUTPUT from 'themes/custom/bartik_custom/templates/views-view-table.html.twig' -->
<table class="views-table views-view-table cols-6">
<thead>
<tr>
<th id="view-timestamp-table-column" class="views-field views-field-timestamp" scope="col">Date</th>
<th id="view-from-sid-table-column" class="views-field views-field-from-sid" scope="col">From</th>
<th id="view-to-sid-table-column" class="views-field views-field-to-sid" scope="col">To</th>
<th id="view-uid-table-column" class="views-field views-field-uid" scope="col">Name</th>
<th id="view-comment-table-column" class="views-field views-field-comment" scope="col">Comment</th>
<th id="view-langcode-table-column" class="views-field views-field-langcode" scope="col">Lang</th>
</tr>
</thead>
<tbody>
...
</tbody>
</table>
<!-- END CUSTOM TEMPLATE OUTPUT from 'themes/custom/bartik_custom/templates/views-view-table.html.twig' -->
</div>
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'pager' -->
<!-- BEGIN OUTPUT from 'core/modules/system/templates/pager.html.twig' -->
<!-- END OUTPUT from 'core/modules/system/templates/pager.html.twig' -->
</div>
<!-- END OUTPUT from 'themes/contrib/bartik/templates/classy/views/views-view.html.twig' -->
</div>

Steps to reproduce

1. Upgrade from 8.x-1.7 to 2.0.0
composer require 'drupal/workflow:^2.0'
drush updb
drush cr
2. See Workflow tab of a content. Workflow history disappears.

Proposed resolution

Reverse to 8.x-1.7.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kubokura
  • 🇳🇱Netherlands johnv

    Please test again with new version 2.1.0 and report your findings.

  • @johnv, thank you for your response. Unfortunately the symptom is reproduced with version 2.1.0.

  • 🇳🇱Netherlands johnv

    Hmm, I wonder why this is note reported more often.
    Perhaps it is the same problem as 🐛 Upgrading from 1.7 to 1.8 Active .

    At some point, the programmed History view was replaced by a View (with still a fallback to the programmed list.)
    Do you have a customized History view?
    Please check page admin/structure/views/view/workflow_entity_history

  • 🇨🇭Switzerland ayalon

    I have no changes in the workflow_entity_history but If I try to load the history I get a fatal error. This error is also triggered if I open the view and add an example node in the context filter:

    
    Drupal\Core\Database\DatabaseExceptionWrapper: Exception in Arbeitsablaufentitätenverlauf[workflow_entity_history]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.force' in 'SELECT': SELECT "base"."hid" AS "hid", "base"."wid" AS "wid", "base"."langcode" AS "langcode", "base"."entity_type" AS "entity_type", "base"."entity_id" AS "entity_id", "base"."revision_id" AS "revision_id", "base"."field_name" AS "field_name", "base"."delta" AS "delta", "base"."uid" AS "uid", "base"."from_sid" AS "from_sid", "base"."to_sid" AS "to_sid", "base"."timestamp" AS "timestamp", "base"."comment" AS "comment", "base"."force" AS "force" FROM "workflow_transition_history" "base" WHERE "base"."hid" IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3); Array ( [:db_condition_placeholder_0] => 465 [:db_condition_placeholder_1] => 464 [:db_condition_placeholder_2] => 460 [:db_condition_placeholder_3] => 459 ) in main() (line 19 of index.php).
    
  • 🇨🇭Switzerland ayalon

    I have added a custom update hook in a custom module to fix it:

    use Drupal\Core\Field\BaseFieldDefinition;
    
    /**
     * Add force field to workflow_transition entity.
     */
    function my_module_update_9001() {
      $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
    
      // Create the field definition for the 'force' field
      $field_definition = BaseFieldDefinition::create('boolean')
        ->setLabel(t('Force transition'))
        ->setDescription(t('If this box is checked, the new state will be assigned even if workflow permissions disallow it.'))
        ->setDisplayOptions('form', [
          'type' => 'boolean_checkbox',
        ])
        ->setDisplayConfigurable('form', FALSE);
    
      // Install the new field definition
      $definition_update_manager->installFieldStorageDefinition('force', 'workflow_transition', 'workflow', $field_definition);
    }
    
  • 🇳🇱Netherlands johnv

    I noticed the error in #7 already.
    The field is now computed - it should not be saved.
    Please try 2.1.1

  • 🇳🇱Netherlands johnv

    You May need to rerun the most recent hook_update

  • 🇳🇱Netherlands johnv

    Please test v2.1.2 or v2.0.x-dev, run update.php, and report back.

  • @johnv, thank you for the update. Unfortunately the symptom is reproduced with version 2.1.2.

  • 🇳🇱Netherlands johnv
Production build 0.71.5 2024