niwadhwa / bugzilla-vcs

Automatically exported from code.google.com/p/bugzilla-vcs
0 stars 0 forks source link

SVN Commit Message Includes BR Tags #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. SVN Commit changes with reference to "bug 123" in comment
2. Execute sync.pl script manually
3. Observe posted SVN comment in bug 123 display page

What is the expected output? What do you see instead?
Expected output is original comment text + linkified bug & number. 
E.g.-> 
<a class="bz_bug_link bz_status_RESOLVED  bz_closed" title="RESOLVED FIXED - 
[Admin] General tracking task" href="show_bug.cgi?id=95">95</a>

Observed results include a pair of line break tags in the middle of the anchor 
tag, which confuses the HTML. 
E.g.->
<a class="bz_bug_link <br>bz_status_INACTIVE "<br>   title="INACTIVE --- - Bug 
Title Text Here"<br>   href="show_bug.cgi?id=17">bug 17</a>

What version of the product are you using? On what operating system?
Using VCS 0.2 Oct 31, 2010
Using Bugzilla 4.1.1
On Fedora 14 w/ Apache 2.2.17

Please provide any additional information below.
As shown in the observed/expected results, other Bugzilla-generated links come 
out OK. The VCS-generated links have the problem. It's a low-importance box, so 
testing changes shouldn't be a problem. 

Original issue reported on code.google.com by rickg...@gmail.com on 15 Mar 2011 at 8:51

GoogleCodeExporter commented 9 years ago
Well. That's certainly weird. Will look into it.

Original comment by avatrax...@gmail.com on 25 Mar 2011 at 3:49

GoogleCodeExporter commented 9 years ago
My perl & regex isn't great, but as a personal workaround, commenting out the 
line in Extension.pm in the _filter_br function appears to generate the right 
link:

sub _filter_br {
    my ($value) = @_;
    $value =~ s/\r//g;
    $value =~ s/\s+$//sg;
#    $value =~ s/\n/<br>/sg;
    return $value;
}

Original comment by rickg...@gmail.com on 25 Mar 2011 at 1:53

GoogleCodeExporter commented 9 years ago
That change fixed the link for me (also using Bugzilla 4.1.1), but then it no 
longer displays newlines within the commit message.  Perhaps if you change the 
CSS for vcs_commit_message to use "white-space: pre", then the br filter would 
not be necessary.  For my own installation, as a temp fix I changed the before 
mentioned br filter to this:

sub _filter_br {
    my ($value) = @_;
    $value =~ s/\r//g;
    $value =~ s/\s+$//sg;
    $value = "<pre>$value</pre>";
#$value =~ s/\n/<br>/sg;
    return $value;
}

Also, in case this helps speed up your troubleshooting...  in 4.1.1 I guess it 
converts "bug ###" into a link.  The link it converts it to looks like this 
(without your br filter applied):

<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - ............"
   href="show_bug.cgi?id=62">Bug 62</a>

That's why it is messing things up, with the link like it is, the br filter 
ends up inserting br tags in the middle of the <a ..> tag.  Hope that helps...

Original comment by ohhe...@gmail.com on 27 Apr 2011 at 11:04

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Oops my solution makes the commit message really long on long commit messages 
with no newlines.  Better solution:  use style of "white-space: pre-line" for 
style of the vcs_commit_message.

Original comment by ohhe...@gmail.com on 27 Apr 2011 at 11:34

GoogleCodeExporter commented 9 years ago
Here's a patch this fixes this issue, and also some other minor changes. It was 
tested against 4.4, and should work on 4.2 too. Not sure about 4.0 since I 
never used it.

Original comment by sgreen%redhat.com@gtempaccount.com on 23 Apr 2013 at 7:34

Attachments:

GoogleCodeExporter commented 9 years ago
if i used the patch in #6, do i still have to do the change in #3? 

Original comment by jameslee...@gmail.com on 25 Jul 2013 at 11:28

GoogleCodeExporter commented 9 years ago
> if i used the patch in #6, do i still have to do the change in #3? 

No. This part does the same thing.

- [% commit.message FILTER quoteUrls(bug) FILTER vcs_br %]
+ [% commit.message FILTER vcs_br FILTER quoteUrls(bug) %]

Original comment by sgreen%redhat.com@gtempaccount.com on 25 Jul 2013 at 11:35

GoogleCodeExporter commented 9 years ago
but i got TWO weird commits session as pic show. Or this is where the "tested 
against 4.4" is?
my system as below:
svn 1.6.11
bugzilla 4.4
VCS bugzilla extension 0.2
perl v5.10.1
Linux 2.6.32-220.el6.x86_64

Original comment by jameslee...@gmail.com on 25 Jul 2013 at 11:48

Attachments:

GoogleCodeExporter commented 9 years ago
Have you run checksetup since making the changes in comment #6 to have the 
templates regenerated?

Original comment by sgreen%redhat.com@gtempaccount.com on 25 Jul 2013 at 11:50

GoogleCodeExporter commented 9 years ago
problem solved.
the reason is i don't know how to use patch file. so, i just simply add '#' in 
the head of line which i want take off. but they are not really commented, so 
there are two commits sessions and a lot of '#' sign.

still thanks sgreen.

Original comment by jameslee...@gmail.com on 26 Jul 2013 at 12:31

GoogleCodeExporter commented 9 years ago
modified template/en/default/hook/bug/edit-after_custom_fields.html.tmpl
modified template/en/default/vcs/commits.html.tmpl
modified web/style.css
Committed revision 24.                                                         

Original comment by sgreen%redhat.com@gtempaccount.com on 13 Dec 2013 at 11:37

GoogleCodeExporter commented 9 years ago
Issue 20 has been merged into this issue.

Original comment by sgreen%redhat.com@gtempaccount.com on 13 Dec 2013 at 11:38