Commit 89fc3ba6 authored by myk%mozilla.org's avatar myk%mozilla.org

Fix for bug 300949: reverts fix for bug 274906 which eliminated [edit] link next…

Fix for bug 300949: reverts fix for bug 274906 which eliminated [edit] link next to attachments to avoid duplicate [edit] references and made the main attachment link go to the 'edit attachment' page; that fix unreasonably reduced Bugzilla usability by making it difficult to view attachments; this patch includes a different fix for bug 274906 that prevents those duplicate [edit] references; long-term we want to make the 'edit attachment' page the irresistable default and have a pop-up menu of links, at which point [edit] can truly go away, but for now it stays
parent fe43c2dc
......@@ -669,7 +669,7 @@ sub quoteUrls {
~<a href=\"mailto:$2\">$1$2</a>~igx;
# attachment links - handle both cases separately for simplicity
$text =~ s~((?:^Created\ an\ |\b)attachment\s*\(id=(\d+)\))
$text =~ s~((?:^Created\ an\ |\b)attachment\s*\(id=(\d+)\)(\s\[edit\])?)
~($things[$count++] = GetAttachmentLink($2, $1)) &&
("\0\0" . ($count-1) . "\0\0")
~egmx;
......@@ -752,8 +752,13 @@ sub GetAttachmentLink {
my ($title, $className) = @{$::attachlink{$attachid}};
# $title will be undefined if the attachment didn't exist in the database.
if (defined $title) {
my $linkval = "attachment.cgi?id=$attachid&amp;action=edit";
return qq{<a href="$linkval" class="$className" title="$title">$link_text</a>};
$link_text =~ s/ \[edit\]$//;
my $linkval = "attachment.cgi?id=$attachid&amp;action=";
# Whitespace matters here because these links are in <pre> tags.
return qq|<span class="$className">|
. qq|<a href="${linkval}view" title="$title">$link_text</a>|
. qq| <a href="${linkval}edit" title="$title">[edit]</a>|
. qq|</span>|;
}
else {
return qq{$link_text};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment