Closed Bug 603681 Opened 14 years ago Closed 14 years ago

quoteUrls : Changes to allow for use in newchangedmail

Categories

(Bugzilla :: Email Notifications, enhancement)

x86
macOS
enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 326826

People

(Reporter: docwhat, Unassigned)

Details

I have two changes to make quoteUrls be useful for people who want to use it in newchangedmail.

The first is to add at the top of quoteUrl() code like this:
    # If a number is passed in, convert it to a bug object.
    if ($bug =~ /^\d+$/) {
        $bug = new Bugzilla::Bug($bug);
    }

This is needed because some templates (such as newchangedmail) only get a bugid, not a bug object.


The second is to change current_bugurl to have a full URL:
    # Current bug ID this comment belongs to
    my $current_bugurl = $bug ? (Bugzilla->params->{"urlbase"} . "show_bug.cgi?id=" . $bug->id) : "";

This is needed since if the HTML is shown in an email client, it won't know where show_bug.cgi is.

Ciao!
I don't know what you are trying to achieve exactly with these changes, but Bugzilla 4.0 and newer already pass the bug object to the newchangedmail template. Also, $bug is already a bug object in quoteUrls(). About your 2nd code change, this is useless as bug 326826 already sets <base> correctly, and make it point to urlbase.

Unless you are using Bugzilla 4.1, we don't support HTML emails, and we won't take this change. If you are using Bugzilla 4.1, then your request is a duplicate of bug 326826.
Severity: normal → enhancement
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
I'm using Bugzilla 3.6.2.  Setting <base> probably works, I'll try it out.

The first change is so that it can be called from newchangedmail which does *not* have a bug object.  quoteUrls() used to accept a bug_id instead.  This allows quoteUrls() to accept a bug id again.

I didn't realize that 4.1 supports HTML emails.  I'll be very happy to stop maintaining these changes when 4.2 comes out.
You need to log in before you can comment on or make changes to this bug.