I've created a patch to automatically add the Workflow tab to all core and custom entities.

It tries to build the entity URI using a dummy entity and then simply adds /workflow to the end. This process might fail for custom entities that require real data when constructing the entity or it's URI, so I've added a try/catch block and some @-signs to keep things quiet. If you have some suggestions to improve this process please let me know!

Patch forthcoming...

Comments

matthijs’s picture

Status: Active » Needs review
StatusFileSize
new4.11 KB

The patch as promised...

johnv’s picture

StatusFileSize
new3.78 KB

Thanks for this wonderful patch.
Please find my revised version attached:
1- IMO we can now remove hook_menu(), in favour of hook_menu_alter();
[EDIT] Wrong: we still need this for the Workflow Node module.
2- In hook_menu_alter(), you add the 'workflow' tab twice:
-- what is the function of the first ('admin ui')? Where can I see its usage? (Happy to leave it in, oif it works for you)
-- the second did not use $entity_position, generating an error on a taxonomy_term.

[EDIT] I think I'll move hook_menu to Workflow Node, and hook_menu_alter to Workflow Field, keeping a comment in workflow.module file.

johnv’s picture

Version: 7.x-2.x-dev » 7.x-2.0-beta7
Status: Needs review » Fixed

I committed this here.

The hook_menu could be moved to workflownode.module, and the hook_menu_alter could be moved to workflowfield.module, but this seems confusing. Thanks.

johnv’s picture

Status: Fixed » Needs work

For a complete implementation, workflow_admin_paths_alter(&$paths) needs a rework, too.
ATM it doesn't work at all. See the related issue.

matthijs’s picture

Hi,

Thanks for your quick review/commit.

The "admin ui" is used by Entity API for its own Admin UI, see https://drupal.org/node/1021576

johnv’s picture

Status: Needs work » Fixed

This can be closed, since I've re-opened the other issue.

Status: Fixed » Closed (fixed)

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