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!

AttachmentSize
token_node_log.patch1.16 KB

#1

EmanueleQuinto - February 25, 2009 - 10:56

Patch for 6.x-1.x-dev.

AttachmentSize
token_node.inc_.patch 1.18 KB

#2

mErilainen - April 16, 2009 - 13:14

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

EmanueleQuinto - April 16, 2009 - 13:29

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

sdsheridan - April 16, 2009 - 14:52

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

mErilainen - April 17, 2009 - 08:20

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

sdsheridan - April 17, 2009 - 12:34

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

EmanueleQuinto - April 27, 2009 - 14:06
Version:5.x-1.10» 6.x-1.x-dev

Patch still works for 6.x-1.x-dev (2009-Apr-21).

#8

mErilainen - April 28, 2009 - 07:31

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

greggles - May 1, 2009 - 14:22
Status:needs review» needs work

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

EmanueleQuinto - May 4, 2009 - 13:53

Use filter_xss instead of check_plain

AttachmentSize
token_node.inc__7.patch 1.17 KB

#11

tobias - September 2, 2009 - 14:44

+1 this is very helpful - thanks! hope this patch makes it into the module.

#12

smithmb - September 16, 2009 - 03:30

Subscribing

 
 

Drupal is a registered trademark of Dries Buytaert.