Closed Bug 939844 Opened 11 years ago Closed 11 years ago

seconds are no longer shown on a comment's time

Categories

(Bugzilla :: User Interface, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: glob, Assigned: glob)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

seconds are no longer shown on a comment's time. this is because the time FILTER is incorrectly defined, and the value of $format is inherited from the previous call if not defined. when displaying a comment's time the format isn't provided, so it's using the format from the attachment table, which skips comments.
Depends on: 937180
Keywords: regression
Target Milestone: --- → Bugzilla 5.0
Attached patch 939844_1.patch (obsolete) — Splinter Review
Attachment #8333917 - Flags: review?(simon)
There are much more regressions than this, as expected. The creation and modifications times in bug reports now display seconds when they didn't before, same for attachment creation times, same when editing attachments.
Comment on attachment 8333917 [details] [diff] [review] 939844_1.patch indeed; something weird is going on here, will figure it out. using a format in one place in the template shouldn't impact other locations.
Attachment #8333917 - Attachment is obsolete: true
Attachment #8333917 - Flags: review?(simon)
Attached patch 939844_2.patch (obsolete) — Splinter Review
how template-toolkit's filter cache works is if an alias is provided then the sub returned by the filter factory will be cached. this cache is used when the filter is subsequently called without any arguments. the current behaviour is to unconditionally cache a sub. the problem this causes is when a filter has default values for parameters, such as the time filter. when the filter is called from the attachments table, the format without the seconds displayed is cached. when the comment time is formatted, it's called without parameters which results in it re-using the cached sub including its format. the fix is to not cache filters if arguments are passed to them. the normal case of | something FILTER time | is cached correctly even with this change.
Attachment #8334379 - Flags: review?(simon)
Attached patch 939844_3.patchSplinter Review
of course after attaching i realised i (1) left in some debugging code, and (2) don't need to touch the filter at all.
Attachment #8334379 - Attachment is obsolete: true
Attachment #8334379 - Flags: review?(simon)
Attachment #8334380 - Flags: review?(simon)
Comment on attachment 8334380 [details] [diff] [review] 939844_3.patch Nice catch! r=LpSolit
Attachment #8334380 - Flags: review?(simon) → review+
The filter cache was implemented in Bugzilla 5.0, see bug 797636, so this cache issue affects trunk only.
Status: NEW → ASSIGNED
Depends on: 797636
Flags: approval?
Flags: approval? → approval+
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Template/Context.pm Committed revision 8815.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: