summarize_time.cgi compares strings using numeric lt (<)

RESOLVED FIXED in Bugzilla 3.4

Status

()

Bugzilla
Bugzilla-General
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Frédéric Buclin, Assigned: wicked)

Tracking

({regression})

3.3.4
Bugzilla 3.4
regression
Bug Flags:
approval +
approval3.4 +
blocking3.4 +

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
summarize_time.cgi: Argument "2008-01-28" isn't numeric in numeric lt (<) at data/template/template/en/default/bug/summarize-time.html.tmpl line 499.

The line is:

  [% IF bugs.$id.deadline && global.deadline < bugs.$id.deadline %]


This is a regression due to bug 286452. Should be fixed before 3.4rc1.

Updated

9 years ago
Flags: blocking3.4+
(Assignee)

Updated

9 years ago
Assignee: general → wicked
Status: NEW → ASSIGNED
(Reporter)

Comment 1

9 years ago
You should try foo.deadline.replace("-", "") < bar.deadline.replace("-", ""). This should fix your problem as Perl is supposed to convert them to integers implicitly.
(Assignee)

Comment 2

9 years ago
Created attachment 373566 [details] [diff] [review]
Fix numeric compare, V1

It worked perfectly. Additionally this patch protects from comparing with blank global deadline field that happens before a first non-blank bug deadline field is found.
Attachment #373566 - Flags: review?(LpSolit)
(Reporter)

Comment 3

9 years ago
Comment on attachment 373566 [details] [diff] [review]
Fix numeric compare, V1

r=LpSolit
Attachment #373566 - Flags: review?(LpSolit) → review+
(Reporter)

Updated

9 years ago
Flags: approval3.4+
Flags: approval+
(Assignee)

Comment 4

9 years ago
Tip:
Checking in template/en/default/bug/summarize-time.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/summarize-time.html.tmpl,v  <--  summarize-time.html.tmpl
new revision: 1.15; previous revision: 1.14
done

3.4 branch:
Checking in template/en/default/bug/summarize-time.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/summarize-time.html.tmpl,v  <--  summarize-time.html.tmpl
new revision: 1.14.2.1; previous revision: 1.14
done
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.