The statement beginning on line 259 of notify.inc should be changed from
$comment_body .= t('%count new comments attached to %type posted by %author: %title',
array('%count' => count($comment), '%title' => $nodes[$nid]->title,
'%type' => _node_names('name', $nodes[$nid]), '%author' =>
($nodes[$nid]->name ? $nodes[$nid]->name : variable_get('anonymous', 'Anonymous'))))."\n";
to
$comment_body .= t('%count new comments attached to %type posted by %author: %title',
array('%count' => count($comment), '%title' => $nodes[$node->nid]->title,
'%type' => _node_names('name', $nodes[$node->nid]), '%author' =>
($nodes[$node->nid]->name ? $nodes[$node->nid]->name : variable_get('anonymous', 'Anonymous'))))."\n";
i.e. replace the index $nid with $node->nid four times, otherwise the replacement variables are empty.
Also, consider breaking the line before the %title to avoid an awkward line break after the first word of the title, and maybe comments with comment(s) inside the string.
Comments
Comment #1
RobRoy commentedThanks, could you post a unified diff patch like described here?
http://drupal.org/diffandpatch
Thanks!
Comment #2
kthagen commentedActually, a fix for this problem is already in HEAD.
A patch for this would be easy, but is there any reason why the current version of HEAD shouldn't be committed into the 4.7 branch? As far as I can tell, the current bugs (not counting those fixed in pending patches) exist in both branches, and HEAD fixes some significant problems. So what are we waiting for?
BTW, if for some reason you do want to patch against 4.7 rather than use HEAD, the correct fix is to change $node->nid to $nid in line 252:
Comment #3
RobRoy commentedI'm going to port all these changes from HEAD to the 4.7.x-1.x-dev branch probably later tonight. I think I needed someone to get on my case. Thanks kthagen!
Comment #4
salvisOk, thank you for the correct patch instructions.
An updated version in 4.7.x (or an official word to use HEAD) would be nice...
Comment #5
toma commentedStill have the same problem
email subject : Notification de nouveau contenu de Immobilier Maroc pour %name
webmaster,
------------------------------------------------------------------------------
Contenu récent - 1 new post
------------------------------------------------------------------------------
1. RECHERCHE LOCATION VILLA APPART MAISON URGENT
Immobilier Maroc Publié par chisa-2b : %title
Its in french but as u can see %name and %title
Thanks
Comment #6
RobRoy commented@toma - I verified that these fixes are in 4.7.x-1.x-dev and think I know what your problem is.
1. The subject string is "%sitename new content notification for %username" in English so you need to change your French translation to use %username instead of %name.
2. %title should work for the other one. Make sure you have the latest 4.7.x-1.x-dev.
You should see this on line 412:
Comment #7
gisleMore than five years old, obsolete version, and OP hasn't provided the information requested.
I also think #6 answers is the needed solution.