From 89fc3ba62b1a5e3db02d21c06f83c8cbc4dbf75b Mon Sep 17 00:00:00 2001 From: "myk%mozilla.org" <> Date: Sat, 10 Sep 2005 05:22:41 +0000 Subject: 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 --- globals.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'globals.pl') diff --git a/globals.pl b/globals.pl index 7605ffe0f..ac502f39a 100644 --- a/globals.pl +++ b/globals.pl @@ -669,7 +669,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; @@ -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&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};
-- 
cgit v1.2.3-24-g4f1b