3

We need to keep the usernames of the latest editors of content, along with the edit date.

How can we do so? Or should we use custom code?

We do not want to enable revisioning, as it is more complex than we want.

2
  • Just use Views (on nodes) with a relationship 'content revision: user'. Else if it is absolutely necessary to have a log, try Event log Commented Nov 25, 2014 at 16:41
  • @J.Reynolds ... or use the "Message" module? Commented Feb 7, 2017 at 19:27

3 Answers 3

2

The Activity module does some user activity logging that may covert your need.

The Activity module keeps track of the things people do on your site and provides mini-feeds of these activities in blocks, in a specialized table, and via RSS. The module is extensible so that any other module can integrate with it. The messages that are produced are customizable via the admin interface and are context sensitive. Some theoretical example messages include:

  • You wrote a comment in response to "example comment title"
  • Jim wants to be your friend. Approve this friendship here
  • Nancy is Phil's latest fan
4
  • Haven't tried it but for Drupal 7, which is what we are using, it is still under development.
    – Maggie
    Commented Nov 25, 2014 at 15:11
  • 1
    For what it's worth, there are still almost the same number of users for D7 as there are for D6 for that module - drupal.org/project/usage/activity
    – rooby
    Commented Nov 25, 2014 at 20:41
  • @rooby : looks like your prior comment may need an update about that "number of users" ... apart from that, how about the "Message" module? Commented Feb 7, 2017 at 19:31
  • @Pierre.Vriens: I think it's alright, since the comment has a date on it and comments inherently go out of date eventually. Plus I cannot edit it :)
    – rooby
    Commented Feb 7, 2017 at 23:08
1

One option is the Event Log module:

This module logs specific events. The events are saved in the database and can be viewed on the page admin/reports/events. Furthermore, a views integration is provided in which you can relate for instance a node to its events. You could use this to display the total number of views, or the number of times that the node has been modified and by which users.

Currently, the following events are supported:

  • User authentication (login/logout/request password)
  • Node operations (CRUD)
  • User operations (CRUD)
  • Menu operations (custom menu's and menu items CUD operations)
  • Taxonomy operations (vocabulary and term CUD operations)

The event log can be easily extended with custom events. For more information please have a look at the API documentation and the available sub modules.

There is no configuration required except for enabling/disabling the sub-modules you require - there is a sub-module for each of the 5 event types in the module description above.

3
  • Interesting alternative also. Not to hijack your answer, but can it be used as a Rules action (to create an event log entry)? Commented Feb 7, 2017 at 23:31
  • @Pierre.Vriens there is currently no rules integration, there is only an API that developers can use to add their own event logs. It should be possible to develop an add-on rules integration module but I don't think one exists yet. It does come with views integration so you can easily create custom reports of the logged data.
    – rooby
    Commented Feb 8, 2017 at 7:40
  • Hm, you're confirming what I was guessing. However, as per the Views part of it, it seems to me that one might then consider using the "views_rules" module to possibly integrate the current version of this module with Rules. Something like this sample rule: "If Rules Event X happens, and Y Rules Conditions are true, then perform a Rules Action to loop over all Event Log entries contained in some Views result and for each entry perform Rules Action Z". THAT opens lots of new IFTTT-like scenarios! Commented Feb 8, 2017 at 7:54
1

IMO the Message module would be a perfect fit to answer this question, and which doesn't require revisioning. Using this module, you can create your own custom "Events logging" (to register things that happened in a site).

Specific to this question here, I'd create a so called "Message type" that contains data about:

  • the usernames (of the latest editors of content).
  • the edit date.
  • any data about the actual node you want to track, such as the node's id (of course), its title, author, some fields, etc.

You could even track how those node related data looked like before and after they got updated, a kind of "light" revisioning (only for those node attributes you want to know about).

About Message types: think of them as equivalent to Content types, whereas you create messages (instead of nodes) of a specific Message type (instead of Content type).

Rules integration

A really interesting facility of the Message module is its perfect integration with the Rules module. Have a look at the answer to "How to implement a follow author (or user) function?" for way more details on that.

In your case, you'd simply create a (rather basic) custom rule which uses:

  • a Rules Event like "Before saving a new node", of "After updating an existing node" (or variations of these events).
  • a Rules Action to "Create a message" (of a selected Message type).

That's really it ...

Example included in Commerce Kickstart

A great sample of this can be found in Commerce Kickstart, which uses the Commerce Message module, to create such "Events logging". In that case in the format of an Order History, as shown in this screenprint (from this module's project page).

Replicate/replace the Activity module

Should you want to do so, it seems perfectly possible to build a view (report) that contains the data similar to what you can do with the Activity module as shown in this screenprint (from this module's project page).

More info about the Message module

The Message module is an amazing module, it is fully entity based, which implies that it perfectly (out of the box) integrates with modules such as Views and Rules.

Though there is not a lot of documentation about it (which is what makes it a hidden D7 gem ...). A possible way to get started with it, and to get an idea of the kind of things it can be used for, is to have a look at the answers to:

Tutorials:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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