When a notification email is sent which includes a node that has links (e.g. <a href="www.drupal.org">Drupal</a>) in its body text, the following appears in the mail:

....
Drupal [1]
....
[1] http://www.drupal.org

This is fine except for when more than 1 recipient receives the mail. The first recipient will have the [1] label on the link, while the second recipient will have [2], and so on.

I've attached a patch that fixes this. It also resets the link numbers back to 1 on each new node/comment included in the one email. If you don't want this, then let me know and I'll add an alternative patch.

CommentFileSizeAuthor
notify_url_count.patch1009 bytesstella
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

beginner’s picture

Status: Needs review » Needs work

I have been able to reproduce the bug.

The patch includes a regex change that is best kept out. It is relevant to that issue: http://drupal.org/node/94118 .

It also resets the link numbers back to 1 on each new node/comment included in the one email.

Is this why you declare $urls = array() here:

  global $urls;
  $urls = array();

If I understand well, this would actually reset $urls to an empty array. Is your comment above the reason for this?

Also, the patch won't apply:

$ patch -p0 < notify_url_count.patch
patching file notify.module
patch: **** malformed patch at line 8:

See http://drupal.org/patch/create

matt2000’s picture

Status: Needs work » Fixed

AFAIK, this issue no longer exists since we now use drupal_html_to_text()

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.