1

In admin/content, how might I override this display to list the User who last updated a piece of content. We can see the initial author and that's fine. But I'd like a running trail on who touched a node.

What I've tried

  • Revisions: However, some Content Types use a field by Jquery Tabs which lose their content when going back to a certain revision.
  • Then use Revisions to see which user last updated the node and do not use them to go back to a previous version? – Neograph734 May 5 '16 at 15:55
  • 1
    Too much risk to take. If someone does go back a revision, jQuery Tabs loses that content. The sky breaks open. People begin to panic. You get the picture. – Rick May 5 '16 at 15:57
  • 1
    Do you need revisioning? You could probably alter the forms to remove the Go back to this version links. – Neograph734 May 5 '16 at 15:58
  • @Neograph734 Ah! That's worth a try. Can you package that into an answer below? I like how you're thinking there. Comment upvote. – Rick May 5 '16 at 15:59
3

Use Administration Views module to replace default content page for admins.

Find new View created by that module and add Relationship -

Content revision: User

Then add field to your View "User: Name" and use that relationship on it. It will show you the username of the User who edited content last.

  • You'd still need revisions to be enabled for that right? Otherwise Drupal does not save the user that edited the node. – Neograph734 May 5 '16 at 15:59
  • @Neograph734 Good point. You dont need revisions enabled. I.e. I have content that has "Create new revision" checkbox turned off in content type settings, and I still can use Content Revision relationship. Also, no need for Revision module for this approach to work, although it would probably add more flexibility/options while building Admin Views – oksana-c May 5 '16 at 16:04
  • @Neograph734 for the purpose of list the User who last updated in content table, the approach with Administration Views is minimal, effective and the most important - can be expanded on indefinitely. – oksana-c May 5 '16 at 16:09
  • I didn't know it would work without enabling revisions on the content type. Nice trick. Thanks! – Neograph734 May 5 '16 at 16:17
  • 1
    @Neograph734, yeah, the default functionality of D7 node revisions is as simple as storing the info of node's last revision only in node_revision table (unless "Create Rev" checkbox is on). Besides that the functionality of it is very limited. I guess that's why everyone goes for more elaborate solutions like Revisions module. – oksana-c May 5 '16 at 16:31
1

In order for Drupal to be able to save the user that edited the Node, you need to have revisions enabled on the node. So the way to go is to enable revisioning, but prevent users from going back to previous versions.

Drupal comes with the revert revisions permission. So just make sure none of the users is able to revert revisions and you should be good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.