Add token for node->log
isaac.niebeling - April 28, 2008 - 16:35
| Project: | Token |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
Attached is a patch to add a token for the log message attached to each node. Four lines added, and now I can include the log message in the email that workflow-ng sends to my users. Take a look.
(patch is against 1.10 since 1.11 just came out today and I haven't had a chance to update yet)
Thanks!
| Attachment | Size |
|---|---|
| token_node_log.patch | 1.16 KB |

#1
Patch for 6.x-1.x-dev.
#2
Should this show up in the "available tokens" list?
I'm trying to include the possible log-message in email using Messaging and Notifications modules.
For example:
A [type-name] was updated in group "[ogname]" with title "[title]"Log message: "[log]"
View page [node-url].
This should print something like:
A Wikipage was updated in group "Development" with title "Problems"
Log message: "Changes in the listing order"
View page http://www.example.com/wiki/problems
#3
In our site we use something like this (and it works):
[user:user] has edited the country page [node:title] and your action is required.
Summary of changes:
[node:log]
#4
Great little patch. Just one question, and sorry if this is the wrong place for it, but it appears that only user 1 on my site actually has the "log:" field displaying on nodes, and not the regular authenticated users. I've not figured out why yet, and wondering if anyone might know.
Drupal 5.16 is the version i'm using.
Thanks in advance, Shawn
#5
What is this [node:title] syntax? I've only seen [node-title] syntax and in the patch there is no token labeled [node:log].
#6
Re #4, never mind... figured it out myself... revisions have to be on for the node type. Works like a charm now.
Thx, shawn
#7
Patch still works for 6.x-1.x-dev (2009-Apr-21).
#8
I can confirm that the patch works nicely.
Now I just need to find a way to force users to write that log message, which is always forgotten.
#9
I think check_plain is too aggressive of a filtering function. Core uses filter_xss for this: http://cvs.drupal.org/viewvc.py/drupal/drupal/modules/node/node.pages.in...
. (($revision->log != '') ? '<p class="revision-log">'. filter_xss($revision->log) .'</p>' : ''),#10
Use filter_xss instead of check_plain
#11
+1 this is very helpful - thanks! hope this patch makes it into the module.
#12
Subscribing