Closed
Bug 313534
Opened 20 years ago
Closed 19 years ago
Bugzilla wraps old comments too eagerly
Categories
(Bugzilla :: Creating/Changing Bugs, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: neil, Assigned: bugzilla-mozilla)
References
Details
If you look at bug 295941 comment 0 or bug 313155 comment 7 you'll see that a word on the first line of the comment has been wrapped on to its own line...
Updated•20 years ago
|
Assignee: justdave → create-and-change
Status: UNCONFIRMED → NEW
Component: Bugzilla: Other b.m.o Issues → Creating/Changing Bugs
Ever confirmed: true
Product: mozilla.org → Bugzilla
QA Contact: myk → default-qa
Version: other → 2.20
Comment 1•20 years ago
|
||
These can be fixed individually, but they're basically the result of a heuristic that I used to determine if a comment was "mis-wrapped." I believe the test is "if the first line is longer than 80 characters, the comment is mis-wrapped."
I recall that was going to make that "if the first line is longer than 83 characters" but it looks like I didn't do that. I could do that. But it won't fix the problem on bmo.
To fix the problem on bmo, you'd have to look for all instances of longdescs.thetext where the first line was longer than 80 characters but shorter than 85, and set already_wrapped to 1.
Assignee: create-and-change → mkanat
Summary: Bugzilla wraps too eagerly → Bugzilla wraps old comments too eagerly
Target Milestone: --- → Bugzilla 2.20
Assignee | ||
Comment 2•20 years ago
|
||
The heuristic is wrong. Quoting the relevant code:
> # If an old comment doesn't have a newline in the first 80 characters,
> # (or doesn't contain a newline at all) and it contains a space,
> # then it's probably a mis-wrapped comment and we should wrap it
> # at display-time.
> print "Fixing old, mis-wrapped comments...\n";
> $dbh->do(q{UPDATE longdescs SET already_wrapped = 0
> WHERE (} . $dbh->sql_position(q{'\n'}, 'thetext') . q{ > 80
> OR } . $dbh->sql_position(q{'\n'}, 'thetext') . q{ = 0)
> AND SUBSTRING(thetext FROM 1 FOR 80) LIKE '% %'});
The comment box is 80 characters wide. If such a sentence is exactly 80 characters wide, the newline character will be on character position 81. E.g. within the the SQL the '> 80' should be '> 81'.
There will still be a few cases with users saying 'Hi!' on the first row, then producing a very wide comment.. but not sure how to detect those easily.
Feel free to reassign to me.
Updated•20 years ago
|
Assignee: mkanat → bugzilla-mozilla
![]() |
||
Comment 3•19 years ago
|
||
Only security and dataloss fixes will be accepted on the 2.20 branch.
Target Milestone: Bugzilla 2.20 → Bugzilla 2.22
Comment 4•19 years ago
|
||
Max, Olav: is this still worth fixing?
Gerv
Comment 5•19 years ago
|
||
Actually, I ended up fixing this during the checksetup.pl re-write, just since I was in there moving that code anyway.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
Target Milestone: Bugzilla 2.22 → Bugzilla 3.0
![]() |
||
Updated•19 years ago
|
Target Milestone: Bugzilla 3.0 → ---
Comment 6•19 years ago
|
||
Bug 253403 comment 0 & 1 seem to exhibit the problem of this bug; I haven't been searching for others. I suppose it's possible those two comments were stored with hard line breaks at those positions...? Max, do you also see this?
Comment 7•19 years ago
|
||
(In reply to comment #6)
> Bug 253403 comment 0 & 1 seem to exhibit the problem of this bug; I haven't
> been searching for others. I suppose it's possible those two comments were
> stored with hard line breaks at those positions...? Max, do you also see this?
bmo had this problem when it upgraded, and so the problem will always exist on bmo unless repaired manually. This bug was only fixed for people who upgrade from 2.18 to 3.0.
You need to log in
before you can comment on or make changes to this bug.
Description
•