Menu Local Tasks Does Not Show For "View"

hoyer - September 4, 2009 - 08:06
Project:Diff
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:Local Tasks, missing, revisioning
Description

(This holds for 2.6 also.)

I'm using Workflow, Revisioning and Module Grants like described in [#408052]. The latter two in latest Dev version.

If I create a new article and then view it, it is shown in "Versions" - "View" as a local task. The other local tasks are displayed also ("List all revisions", "Edit", "Publish This").

I then create a new revision. In the Versions List, I click on the date of the new version to go to the view page. This 2nd revision isn't shown with the local tasks menu anymore, but in the old "View Current" parent menu! To edit a specific revision, I have to manually edit the URL (replacing "view" by "edit"). Doing this, the menu local tasks appear. But only for Editing.

Using Revisioning w/o Workspace on a clean new installation, same code base, this doesn't hold anymore and everything works fine.

I think it's because of the theme. I tested it with Garland, Minelli and my custom theme.

AttachmentSize
capture_04092009_091146.jpg35.54 KB
capture_04092009_091313.jpg46.39 KB
capture_04092009_091320.jpg34.52 KB

#1

hoyer - September 4, 2009 - 08:09

Description of the 3 attached screenshots:

1st: Local tasks are shown for "View" if only one revision exists.
(2nd: Versions list after creating a second revision)
3rd: Local tasks are NOT shown anymore for more than one revision - the revision isn't shown in "Versions", but in "View current"

#2

hoyer - September 4, 2009 - 08:58

More info:

I have discovered, that _revision_tasks_menu_access_callback is called a few times each time you "view" the article.
The interesting thing is the output of args(), when two revisions exists:

* Revision Callback #1, view revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 353 [4] => view )
* Displaying pending revision of story Test-Artikel für Revisioning, last modified by hoyer on 04.09.2009 - 10:49
* Revision Callback #1, view revisions .Array ( [0] => node [1] => 281 )
* Revision Callback #1, view current .Array ( [0] => node [1] => 281 )
* Revision Callback #1, view revisions .Array ( [0] => node [1] => 281 )
* Revision Callback #1, edit current .Array ( [0] => node [1] => 281 )
* Revision Callback #1, view revisions .Array ( [0] => node [1] => 281 )

As can be seen, the args #2 and #3 (specifying the %vid), get lost after the first call.

In contrast to the situation when only one version exists:

* Revision Callback #1, view revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Displaying current, published revision of story Test-Artikel für Revisioning, last modified by hoyer on 04.09.2009 - 09:14
* Revision Callback #1, view revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, view current .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, view revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, publish revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, unpublish current revision .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, revert revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, compare revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, view revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, edit current .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, view revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )
* Revision Callback #1, delete revisions .Array ( [0] => node [1] => 281 [2] => revisions [3] => 351 [4] => view )

Here, the arguments don't get lost! But don't know how to fix this...

#3

hoyer - September 4, 2009 - 09:07

Deactivated "Diff" and it works

#4

hoyer - September 4, 2009 - 10:47
Project:Revisioning» Diff
Version:6.x-2.x-dev» 6.x-2.x-dev
Status:active» needs work
Issue tags:+revisioning

As I found out, the problem is in Diff. The following hack "steals" the arguments #2 and #3. Commenting line 147 does solve the problem.

    145       // @TODO: This is a bad hack that should instead be a patch agains        t the node module.
    146
    147       menu_set_active_item("node/{$node->nid}");
    148

This seems to be a VERY bad hack. Changing Issue Project to Diff.

#5

boringgeek - September 11, 2009 - 00:27

I'm having the same exact issue as well... When you click a revision to view it, the local task tabs disappear on the view page and you manually have to type "edit" in the URL... Then the tabs work fine. One of our developers found a quick way around it (for time purposes) by adding a 3 line conditional statement to menu.inc file and it seems to be working again. However we never want to modify the core modules like this. I would love to see this get resolved by a patch...

#6

bluerobot - October 19, 2009 - 17:41

I have this issue too with 6.x-2.1-alpha2. Thanks for posting the information about this.

 
 

Drupal is a registered trademark of Dries Buytaert.