Is it possible to make the workflow tab on the node edit page load in the admin theme?
It also needs an update, due to Entity support in version 2.x. See also #2160375

Comments

bendev’s picture

same question...

Bastlynn’s picture

Status: Active » Closed (won't fix)

Not by default within the module as far as I know. It would take additional code.

Since this request is over a year old, I'm going to assume a solution was found or you've moved on. If not, please get updated to the latest versions of all modules and make a request for it against Drupal 7 and I'll be glad to take a look at it.

tomyinhauser’s picture

Version: 6.x-1.1 » 7.x-1.1
Status: Closed (won't fix) » Active

Faced the same situation on 7.x-1.1. Managed to open workflow tab on admin theme using the following custom code:

function hook_admin_paths() {
  $paths['node/*/workflow'] = TRUE;
  return $paths;
}

Would be nice to have this by default on workflow module, since the workflow is an administrative feature, not something to show to your end users.

nancydru’s picture

On my big site, it is, indeed, something the end users access. And they don't want it (or edit) in the admin theme.

nancydru’s picture

We could, perhaps do something like this:

/**
 * Implements hook_admin_paths_alter().
 * If node edits are done in admin mode, then workflow will be too.
 */
function workflow_admin_paths_alter(&$paths) {
  if (isset($path['node/*/edit'])) {
    $path['node/*/workflow'] = $path['node/*/edit'];
  }
}
nancydru’s picture

Assigned: Unassigned » nancydru
Status: Active » Fixed

For better or worse, this got committed.

tomyinhauser’s picture

Makes sense. Thanks!

Status: Fixed » Closed (fixed)

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

johnv’s picture

The proposed patch in #5 is committed as such, but that cannot work due to a typo in the argument.

johnv’s picture

Version: 7.x-1.1 » 7.x-2.x-dev
Status: Closed (fixed) » Needs work
johnv’s picture

This function also needs to be adapted for all entity types, just like workflow_menu_alter already does.

  • Commit f52e565 on 7.x-2.x by johnv:
    Issue #0443094: Fixed typo in workflow_admin_paths_alter().
    
johnv’s picture

Version: 7.x-2.x-dev » 7.x-2.2
Category: Support request » Feature request
Status: Needs work » Fixed

I encountered a test situation, and fixed the typo.

Status: Fixed » Closed (fixed)

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

johnv’s picture

Version: 7.x-2.2 » 8.x-1.x-dev
Assigned: nancydru » Unassigned
Status: Closed (fixed) » Active

In D8, the hook workflow_admin_paths_alter(&$paths) will not workfr any more, so this functionality is lost in D8, until it is repaired.
The hook will be removed from workflow.module.
See #1316692: Convert hook_admin_paths() into declarative properties on routes for the relevant D8-change. I could not find a change notice.

The current code is :

/**
 * Implements hook_admin_paths_alter().
 *
 * If entity edits are done in admin mode, then workflow history tab will be too.
 *
 * @todo: add support for every $entity_type.
 */
function workflow_admin_paths_alter(&$paths) {
  if (isset($paths['node/*/edit'])) {
    $paths['node/*/workflow'] = $paths['node/*/edit'];
  }
  if (isset($paths['user/*/edit'])) {
    $paths['user/*/workflow'] = $paths['user/*/edit'];
  }
}

  • johnv committed e522257 on 8.x-1.x
    Issue #443094: Remove hook_admin_paths_alter()
    
jamiehollern’s picture

In Drupal 8, routes must be declared as admin routes. Please see the attached patch.

jamiehollern’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 17: workflow-443094-workflow-tab-admin-theme-17.patch, failed testing.

The last submitted patch, 17: workflow-443094-workflow-tab-admin-theme-17.patch, failed testing.

jamiehollern’s picture

Status: Needs work » Needs review

CI failed the last two times for some reason.

  • johnv committed abb7ffa on 8.x-1.x authored by jamiehollern
    Issue #443094 by jamiehollern: Workflow tab doesn't load in admin theme
    
johnv’s picture

Status: Needs review » Fixed

Committed. Thanks.

Status: Fixed » Closed (fixed)

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