From: myk%mozilla.org <> Date: Sat, 10 Sep 2005 05:22:41 +0000 (+0000) Subject: Fix for bug 300949: reverts fix for bug 274906 which eliminated [edit] link next... X-Git-Tag: bugzilla-2.20~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65b754264f68c9be3f74f72f1010c6da6341ebb7;p=thirdparty%2Fbugzilla.git 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 --- diff --git a/globals.pl b/globals.pl index 89e70e0a81..71d2bbe470 100644 --- a/globals.pl +++ b/globals.pl @@ -807,7 +807,7 @@ sub quoteUrls { ~$1$2~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; @@ -890,8 +890,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&action=edit"; - return qq{$link_text}; + $link_text =~ s/ \[edit\]$//; + my $linkval = "attachment.cgi?id=$attachid&action="; + # Whitespace matters here because these links are in
tags.
+ return qq||
+ . qq|$link_text|
+ . qq| [edit]|
+ . qq||;
}
else {
return qq{$link_text};