Download & Extend

Define additional comment activity tokens

Project:Activity
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)
Issue tags:activity-6.x-1-0-rc1

Issue Summary

Hi,

Thank you for the module, happy NY.

On my activity feed instead of displaying the comment subject line it's displaying the following:

01/03/2009 - 11:43 new Merlin says [comment-subject-link] to blog entry Sri Lanka get home, just.

Thanks,
H

Comments

#1

Does this have anything to do with the fact that [comment-subject-link] is not a valid token? And it should be [comment-link]?

#2

You should reset your tokens for all of the contrib modules you are using to be safe as many changes have been made. I made an update to the project page http://drupal.org/project/activity as a sort of mini announcement...So try that and comment here if you still encounter problems with the tokens.

#3

Priority:normal» critical

Thank you for the reply but resetting wiped out all default settings.....I am now left with a open bracket '['

Meaning there were no default settings under 'Comment module activity settings'.

#4

I'm royally shafted now..Because I dont even recall how the previous default settings looked and I have to manually enter all tokens.

#5

Also what's the difference between 'Parent comment author' and the 'author' role in the comment module activity settings? Anybody know the difference in [parent-node-link] and [praent-node-title] is one the title with no link?

Sorry I am trying to get things working again after I hit the reset to default..thankfully i only reset the comment settings...

#6

Status:active» fixed

fixed in CVS

parent comment author is for threaded comments where a comment is made on a comment (not tested) so in this case the comment that is triggering the activity has user of 'author'. The comment will be on a node so the parent node has author parent-node-author and the parent comment author was just explained.

parent-node-link is a link with the title as the link text
parent-node-title is just the title string

#7

Status:fixed» active

The problem in #4 still exists in the latest dev snapshot, but that's OT for this issue. Would you prefer a new issue be started? Also, reinstalling the module doesn't fix the defaults.

Michelle

#8

Status:active» needs review

I found the culprit for #4:

On line 308 of activity.module, change

'#default_value' => variable_get($token_field, $role['#default'][$op_name]),

to

'#default_value' => variable_get($token_field, $role['#default']),

That makes resetting to default work properly. $role['#default'] is a string, not an array.

Michelle

#9

I;ll have to double-check with my current code but I had this working ok for me. Regarding #9 actually the module supports both a string and an array. The reasoning being that the original version of Activity only had a string which meant a single message string regardless of the operation. So for nodeactivity for example the message string was the same whether it was node create/update/delete. And so on for other modules.

This approach was pretty limiting as you can imagine. So the code was changed to allow for an array of default message strings with the relevant operations as array keys.

Right now the only activity contrib that doesn't have an array is commentactivity which is why this issue was raised initially. So the proposed change in #9 will break the other modules that all have arrays of default message strings.

I'll go back and look and reset defaults for all activity modules to double-check.

#10

Status:needs review» active

Ah, sorry, jaydub. I only tested it with the comment activity, since that's where I was having the problem. So I guess the real solution is making comment activity use arrays like everything else. Setting this back to active since my "patch" isn't the answer.

Michelle

#11

If you have good suggestions for tokens for comments for the relevant operations then post them here...

operations are:

'insert', 'update', 'delete', 'publish', 'unpublish'

right now we just have a default token of:

[author] left the comment [comment-link] on the [parent-node-type] [parent-node-link]

of course that doesn't make much sense for delete or unpublish...

I think that for most of the removal operations such as delete/unpublish and such across all the contrib modules it would more often be a case where the site admin would want to -not- track those type of activities but who's to say...

#12

Seems like they should just say what happened...

[author] deleted the comment [comment-subject] from [parent-node-link]
[author] unpublished the comment [comment-subject] on [parent-node-link]
[author] published the comment [comment-link] on [parent-node-link]

I don't know if [comment-subject] exists. If not, would be a good one to add for this.

Michelle

#13

I fixed this by downloading the latest release and doing the following.

Manually going into the activity settings page and removing the token [node-link-title] and just using [node-link].

#14

@Prodigy: That doesn't fix the fact that reset to defaults is broken.

Michelle

#15

Jaydub, which is it?

Does activity plan to:

* support a #default string for when the string applies to all ops.
* support a #default array with the keys being the ops.

OR does it plan to ONLY:

* support a #default array with the keys being the ops.

If it's the first scenario, then the code from activity_install_activity_defaults(), specifically:

$default = (is_array($role['#default']) ? $role['#default'][$op_name] : $role['#default']);

needs to be added to the settings pages so that a "Reset defaults" works. Since it's not in there (and always defaults to the #default array variant), a Reset defaults causes problems. And note that not only is commentactivity not working (due to #default string) but also nodeactivity too (same, due to #default string).

Personally, I support supporting both #default as string and #default as array.

#16

The former is the design.

I thought I had committed the changes to deal with this to CVS but I must have had an error on commit and just not paid attention...let me go through and check and attempt the commit again.

#17

Title:Comment subject not showing on activity» Define additional comment activity tokens
Category:bug report» task
Priority:critical» normal

The changes referred to in #9 and #16 were committed. Changing the subject to reflect one open issue mentioned here which is to define additional comment activity tokens.

#18

tagging

#19

Status:active» closed (won't fix)

closing. 1.x no longer supported.

nobody click here