Last Comment Bug 794389 - There is no field named 'actual_time' when generating reports
: There is no field named 'actual_time' when generating reports
Status: RESOLVED FIXED
: regression
Product: Bugzilla
Classification: Server Software
Component: Reporting/Charting (show other bugs)
: 4.2.3
: All All
: -- normal (vote)
: Bugzilla 4.2
Assigned To: Frédéric Buclin
: default-qa
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-26 01:43 PDT by Ahmed Ossama
Modified: 2012-10-04 04:31 PDT (History)
2 users (show)
LpSolit: approval+
LpSolit: approval4.4+
LpSolit: blocking4.4+
LpSolit: approval4.2+
LpSolit: blocking4.2.4+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch, v1 (870 bytes, patch)
2012-09-29 06:48 PDT, Frédéric Buclin
glob: review+
Details | Diff | Review

Description Ahmed Ossama 2012-09-26 01:43:21 PDT
User Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:13.0) Gecko/20100101 Firefox/13.0.1
Build ID: 20120707093031

Steps to reproduce:

User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:13.0) Gecko/20100101 Firefox/13.0.1
Perl: v5.10.1

I did a "Tabular reports" with Vertical axis set to "Actual Hours" and Horizontal axis set to "Assignee" and selected all Products, Components, Statuses and Resolutions. But the report always come out with "There is no field named 'actual_time'."

I am testing with an "admin" user and I have the parameter "timetrackinggroup" set to "timetracking" group; I have also tested the issue when "timetrackinggroup" is set to "editbugs" group in an attempt to test if this parameter is causing the issue, but the same issue still occurs.

I have also tried generating reports on Bugzilla 4.2.1 and the issue still takes place. And I installed a plain 4.3.3 to test this issue, and it still happens.

Steps to reproduce:
1. Reports > Tabular reports (and also Graphical reports)
2. Vertical Axis: Actual Hours
3. Horizontal Axis: Assignee
4. Select all Products, all Components, all Statuses and all Resolutions (and also tried selecting none)
5. Hit "Generate Report"


Actual results:

There is no field named 'actual_time'.


Expected results:

Display a tabular report with the "Actual Hours" against "Assignees"
Comment 1 Frédéric Buclin 2012-09-26 04:30:42 PDT
actual_time is the old name for work_time. Search.pm is supposed to take care of this, but this is clearly not the case.
Comment 2 Frédéric Buclin 2012-09-29 06:01:02 PDT
Ah, the problem is that Bugzilla::Search::COLUMNS states that:

    # Backward-compatibility for old field names. Goes new_name => old_name.
    # These are here and not in _translate_old_column because the rest of the
    # code actually still uses the old names, while the fielddefs table uses
    # the new names (which is not the case for the fields handled by
    # _translate_old_column).
    my %old_names = (
        creation_ts => 'opendate',
        delta_ts    => 'changeddate',
        work_time   => 'actual_time',
    );

So we have a mix of old and new field names within the codebase, which is responsible for this mess.
Comment 3 Frédéric Buclin 2012-09-29 06:15:47 PDT
I will have to hack report.cgi to take care of this. Moreover, all links are broken in tabular reports due to this actual_time/work_time mismatch. This seems to be the single field to suffer from this problem.
Comment 4 Frédéric Buclin 2012-09-29 06:48:38 PDT
Created attachment 666202 [details] [diff] [review]
patch, v1

This patch fixes both the "invalid name" problem thrown by Bugzilla::Field->check but also links in tabular reports.
Comment 5 Byron Jones ‹:glob› 2012-10-03 23:27:42 PDT
Comment on attachment 666202 [details] [diff] [review]
patch, v1

r=glob
Comment 6 Frédéric Buclin 2012-10-04 04:31:11 PDT
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified report.cgi
Committed revision 8410.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/
modified report.cgi
Committed revision 8405.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified report.cgi
Committed revision 8143.

Note You need to log in before you can comment on or make changes to this bug.