This issue is very similar to http://drupal.org/node/1269186. I'm using the latest stable releases of Views (7.x-3.0) and Workbench (7.x-1.1). The Actions column of My Edits is blank; I'm using my site's admin account so it's not a permissions problem.

Here is what I've surmised: Workbench creates a view called workbench_edited. This view is of type Content Revision. Content Revision views don't expose [Content: edit link] or [Content Revision: edit link] as fields. The workbench_edited view has [Content: edit link] as a field, hence it's blank (perhaps this worked in the past and Views changed?)

I don't know if this is a Views bug, or by design (I looked on Views issue queue, couldn't find anything on this). If it's by design in Views, then Workbench should be changed to work within these paramaters. If not, then this should be reported as a bug on the Views issue queue.

For now for those looking for a workaround, you have to edit the workbench_edited view (it's exposed as an editable view). Here's what I did:

Created a new field for Content revision: Vid. Label: Actions.
Rewrite Results -> Rewrite the output of this field -> edit.
Rewrite Results -> Output this field as a link -> node/[vid]/edit?destination=admin/workbench.
Saved that and changed the Content: Edit link field above to exclude from display.

Comments

fasdalf@fasdalf.ru’s picture

Subscribing. Same for "link this field to piece of content" on node titles.
sethfisher, dindn't you mean [nid]? Since you have at least one node with more than one revision vid token stops work as you wrote here.

fasdalf@fasdalf.ru’s picture

StatusFileSize
new21.29 KB

I have exported my workbench_edited view (attached). It have this changes:

  • edit link field removed.
  • nid field not counted, but rewrited into edit link.
  • nid field moved into view's end
  • added count(vid) field to reduce duplicate rows.

Now i have one line for one node and edit link.

knowledges33ker’s picture

I had the same problem. Fixed it by going into the "my sections" tab inside workbench. Even though I had the top level (parent) taxonomy term selected, I also had to manually select the child list terms in that taxonomy. Once I selected them, bingo the edit link appeared in the view. Hope this helps.

sethfisher’s picture

I used [vid] because I assumed the purpose of My Edits (since it's a Content Revision view) is to allow you to list and edit revisions. If it used the [nid], then if there were multiple revisions of a node listed, they would all have the same edit link. If you were to use [nid], then this view might as well be a Content view instead of Content Revision.

You certainly could use [nid]. I thought about doing that, but went with [vid] based on this reasoning.

fasdalf@fasdalf.ru’s picture

2 knowledges33ker
Thank you, i'll remember this if i need workbench access.

2 sethfisher
Shouldn't your link be /node/[nid]/revisions/[vid]/edit ? There is no option to edit any revision but current or new draft. There is no node/%node/revisions/%revision/edit path to edit other revisions. Also there is GROUPIG FIELD TO FORCE DISTINCT in my edits view and author mention edited pieces of content in screencasts. So i think there are one line for one node by design.
Also does your view work in "two nodes - four revisions" case?

BenWrighton’s picture

+ 1 For "link this field to piece of content" on node titles.

Fix above worked fine for me (I'm using the Menus not Taxonomy for sections) so
Thanks sethfisher!

But I don't understand why linking-the-Title-to-their-node in the My Edits block view isn't the default setting.

agentrickard’s picture

I suspect it's a problem with the field handler being used. I had to write a custom edit link handler for Workbench Access.

drupalmonkey’s picture

Status: Active » Needs review
StatusFileSize
new7.03 KB

sethfisher:
Using [vid] is wrong.
Scenario: Say you have a nid of 5, and that node has vids of 6 and 10. If you use node/[vid]/edit in the where your vid = 10.. you are going to be editing node/10, not node/5 with vid of 10. fasdalf is right, you cannot edit a revision, you can only make a new revision. The My Edit section should not be showing duplicates like it does.. it's not meant to show a list of revisions. If you want to see a list of revisions for a particular node, use the Moderate tab on that node.

The following patch fixes the duplicates issue and makes the edit link show in the Actions column. You might need to revert the workbench_edited view after applying the patch (this will undo any other changes you've made to this View).

anandkp’s picture

Awesome stuff drupalmonkey!

Thanks for the patch, worked like a charm!

Applied to version 7.x-1.1

agentrickard’s picture

Not sure I'm comfortable with this from a security perspective. Putting the link in like this could be an access bypass:

+$handler->display->display_options['fields']['nid_1']['alter']['text'] = '<a href="/node/[nid_1]/edit?destination=admin/workbench">edit</a>';
stevector’s picture

Status: Needs review » Needs work

The duplicates were just fixed in #1630702: My Edits list contains multiple dupes. I agree with agentrickard that something more robust that the token link should be used. For now, I've removed the broken actions column.

drupalmonkey’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.34 KB

With the new release of Workbench and the changes to the My Edits view, adding the Edit links back in was easy.

Here is a patch.

hass’s picture

How about naming it Operations like we are doing everywhere else in core and other contrib modules?

drupalmonkey’s picture

StatusFileSize
new3.82 KB

That makes sense. Updated the patch.

hass’s picture

RTBC

hass’s picture

Status: Needs review » Reviewed & tested by the community
agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

   38f6f5f..16a8fff  7.x-1.x -> 7.x-1.x

Status: Fixed » Closed (fixed)

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