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

RobRoy’s picture

Status: Needs review » Needs work

Thanks, could you post a unified diff patch like described here?

http://drupal.org/diffandpatch

Thanks!

kthagen’s picture

Actually, 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:

          if (!array_key_exists($nid, $nodes)) {
            $nodes[$nid] = node_load($nid);
          }
RobRoy’s picture

I'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!

salvis’s picture

Ok, thank you for the correct patch instructions.

An updated version in 4.7.x (or an official word to use HEAD) would be nice...

toma’s picture

Still 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

RobRoy’s picture

Category: bug » support
Status: Needs work » Postponed (maintainer needs more info)

@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_body .= t('%count attached to %type posted by %author: %title', 
array('%count' => format_plural(count($comment), '1 new comment', '%count new comments'), 
'%title' => $nodes[$nid]->title, '%type' => _node_names('name', $nodes[$nid]), 
'%author' => $nodes[$nid]->name ? $nodes[$nid]->name : variable_get('anonymous', 'Anonymous'))) ."\n";
gisle’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

More than five years old, obsolete version, and OP hasn't provided the information requested.
I also think #6 answers is the needed solution.