Closed
Bug 308663
Opened 19 years ago
Closed 16 years ago
Cryptic "'' is not a legal date" error from time summaries (missing start date when splitting results by month)
Categories
(Bugzilla :: Bugzilla-General, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.4
People
(Reporter: wicked, Assigned: selsky)
Details
Attachments
(1 file, 1 obsolete file)
|
2.17 KB,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
Summarize_time.cgi says |'' is not a legal date.| when Split by month is selected but period start date field is left empty. User error is thrown from line 434 which is commented as follows: # unfortunately it's not too easy to guess a start date, since # it depends on what bugs we're looking at. We risk bothering # the user here. XXX: perhaps run a query to see what the # earliest activity in longdescs for all bugs and use that as a # start date. Best fix would be use some default start date just like we do with any other combination of options. Failing that, the error message should atleast be enhanced to say what the actual reason is. There's no way an user knows what went wrong with that kind of error message..
Updated•18 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 1•16 years ago
|
||
Guess a starting date by using the 1st day of the 1st month with bug activity.
Attachment #362469 -
Flags: review?
| Assignee | ||
Updated•16 years ago
|
Attachment #362469 -
Flags: review? → review?(LpSolit)
Comment 2•16 years ago
|
||
Comment on attachment 362469 [details] [diff] [review] Guess a start date >+ my $times = $dbh->selectcol_arrayref( >+ "SELECT MIN(bug_when) >+ FROM longdescs >+ WHERE bug_id IN ($buglist) >+ AND work_time > 0"); >+ >+ my $time = str2time(shift @{$times}); >+ return format_time(scalar localtime($time), '%Y-%m-01'); You must use $dbh->sql_in('bug_id', $bugids) instead of the hardcoded "IN ($buglist)" due to a limitation in Oracle. Also, I think the DB server should format the output itself, using $dbh->sql_date_format(), as it may return a string which is not parsable by str2time(). Not sure you can combine it with MIN(bug_when), you will have to test. Also, to avoid this "shift" hack, use $dbh->selectrow_array() instead; it's cleaner. Otherwise looks good.
Attachment #362469 -
Flags: review?(LpSolit) → review-
Updated•16 years ago
|
Assignee: general → selsky
| Assignee | ||
Comment 3•16 years ago
|
||
Tested on MySQL 5.0.x
Attachment #362469 -
Attachment is obsolete: true
Attachment #372253 -
Flags: review?(LpSolit)
Updated•16 years ago
|
Attachment #372253 -
Flags: review?(LpSolit) → review+
Comment 4•16 years ago
|
||
Comment on attachment 372253 [details] [diff] [review] Guess a start date v2 Tested successfully with MySQL 5.0.67 and PostgreSQL 8.3.7. Thanks for the patch! r=LpSolit
Updated•16 years ago
|
Status: NEW → ASSIGNED
Flags: approval3.4+
Flags: approval+
Target Milestone: --- → Bugzilla 3.4
Comment 5•16 years ago
|
||
tip: Checking in summarize_time.cgi; /cvsroot/mozilla/webtools/bugzilla/summarize_time.cgi,v <-- summarize_time.cgi new revision: 1.25; previous revision: 1.24 done 3.3.4: Checking in summarize_time.cgi; /cvsroot/mozilla/webtools/bugzilla/summarize_time.cgi,v <-- summarize_time.cgi new revision: 1.24.2.1; previous revision: 1.24 done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: relnote
Resolution: --- → FIXED
Summary: Cryptic '' is not a legal date error from time summaries → Cryptic "'' is not a legal date" error from time summaries (missing start date when splitting results by month)
You need to log in
before you can comment on or make changes to this bug.
Description
•