The Revision tab node/x/revisions is shown if I click on node/x/track. Switching back and forth to published version removes/adds the tab :-)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

richard.thomas’s picture

Status: Active » Needs review
FileSize
2 KB

I've run into the same issue with a tab I added, using drupal_get_form() as the page callback. It seems the code in workbench_moderation_menu_local_tasks_alter() is assuming the page argument order. I've simply changed the code to use menu_get_object() instead, it seems to handle all cases the previous code did, and I've tested it with my tab, the devel tab, and the statistics tab. I've attached a patch.

richard.thomas’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
stevector’s picture

Status: Needs review » Postponed (maintainer needs more info)

I think I'm following what's happening in this patch. Can you give me a clearer set of instructions on how to reproduce this bug?

richard.thomas’s picture

Enable moderation on a node type, then enable the core statistics module, go to a moderated node and you should now have a "Track" tab. Choose the track tab and the "Revisions" tab will reappear in the tab list, going back to the published version removes it from the local tasks again.

In my case I was seeing the issue on a custom tab I had added, but it will occur on any local action where the node is not the first page argument.

hass’s picture

Status: Postponed (maintainer needs more info) » Active
  • Click on node/x/track.
  • "Revision" tab node/x/revisions is shown and not "Moderation" only.
  • Switching back and forth between Track and Moderation tab shows/hides the Revision tab
stevector’s picture

Status: Active » Fixed

Got it, thanks. In the case of the stats case, I think the problem is in core and have filled an issue there: #1863260: Use the normal menu system approach for loading arguments on user/%user/track/navigation and node/%node/track

It's unlikely that'll get moved back to to 7.x any time soon. So I've gone ahead and committed this patch. Thanks guys! http://drupalcode.org/project/workbench_moderation.git/commitdiff/51b91d...

Richard, congrats on your first commit listed on your profile! http://drupal.org/user/1924680

Status: Fixed » Closed (fixed)

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

cschults’s picture

If this patch got accepted, what version of Workbench Moderation will it be applied to? I'm experiencing the same thing for custom Panel pages where the path is /node/x/some-action, but I've installed the latest stable release. Thanks.

cschults’s picture

Got around this issue by removing the permission "View content revisions" under "Node".

EclipseGc’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
FileSize
1.41 KB

Bad form to reopen old issues, I know, but this one warrants it I think. The fix for this seems a little suboptimal, and as cschults points out, we still run into this issue with custom page_manager deployed pages to node/%node/*. In order to more directly squash this, I wrote an additional access callback that checks if the node type in question is moderated and if it is, it routes through the normal workbench_moderation access checks, and if it's not moderated, then it gives core it's normal shot at this. Appears to work as desired for me. Pretty simple. I suspect the hook_menu_local_task_alter() stuff is unnecessary, but I've not attempted to remove it yet.

Eclipse

mvc’s picture

The patch from EclipseGc seems safe but didn't work for me when viewing unpublished drafts of webforms while logged in as a user with permission to moderate that draft. Here's another possible solution; I didn't roll it together with that one but it should be possible to apply both. I have tested this with 7.x-1.4 and it should apply safely to the latest 7.x-1.x. I suspect it still applies to 7.x-3.x but I'm not ready to update to that version.