Closed Bug 124937 Opened 23 years ago Closed 23 years ago

Templatise show_activity.cgi

Categories

(Bugzilla :: User Interface, defect)

2.15
defect
Not set
blocker

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: gerv, Assigned: gerv)

References

Details

Attachments

(1 file, 4 obsolete files)

Here's another one - this is reasonably simple. We're knocking them off... 

Gerv
Attached patch Patch v0.5 (obsolete) — Splinter Review
This isn't quite ready yet - it changes DumpBugActivity significantly
(templatisation and cleanup) but doesn't change process_bug.cgi to use the new
version, so that will break. Still, a quick glance over it to tell me if I've
made egregious errors would be appreciated.

Gerv
does this take into account bug 94303?
Blocks: 94303
Ook. No it doesn't. But it could. I'll take it into account while producing
version 1.0.

Gerv
Attached patch Patch v0.9 (obsolete) — Splinter Review
Now fixes bug 94303, but doesn't change process_bug, as it's being templatised
over in bug 125660 , and there are other templatisation patches which touch
that exact part of process_bug.

Gerv
Attachment #68940 - Attachment is obsolete: true
Depends on: 125660
Target Milestone: --- → Bugzilla 2.16
Keywords: patch, review
Why does GetBugActivity poke $::vars directly, rather than just return 2 vars?
How do you return two vars? 

return $foo, $bar;

?

Gerv
Return a two element array or list.
Actually, but 110012 is the real dependency, because it touches process_bug.cgi.

Gerv
Depends on: 110012
No longer depends on: 125660
+            [% IF change.attachid %]
+              <a href="attachment.cgi?id=[% change.attachid %]&action=view">
+              Attachment #[% change.attachid %]</a>         

...should read &amp;action=view.

Attached patch Patch v.1 (obsolete) — Splinter Review
This should be it, just about. I've changed comments.tmpl to use "comments"
instead of "bug.comments", which seems more correct.

Gerv
Attachment #71071 - Attachment is obsolete: true
Comment on attachment 76307 [details] [diff] [review]
Patch v.1

>Index: template/default/show/activity.html.tmpl
>===================================================================
>RCS file: template/default/show/activity.html.tmpl
>diff -N template/default/show/activity.html.tmpl
>--- /dev/null	1 Jan 1970 00:00:00 -0000
>+++ template/default/show/activity.html.tmpl	26 Mar 2002 23:57:23 -0000
>@@ -0,0 +1,91 @@
>+  #     attach_id: integer. If the change was adding an attachment, its id.
>+  # incomplete_data: boolean. True if some of the data is incomplete (because
>+  #                  it was affected by an old Bugzilla bug.)
>+  #%]
>+ 

Can you mention the bug # here, in the comment? Of course, 'starts with ?' is a
really bad heruistic,
but you're not changing that.

>+        [% FOREACH change = operation.changes %]
>+          [% "<tr>" IF loop.index > 0 %]
>+            <td>
>+              [% IF change.attachid %]
>+                <a href="attachment.cgi?id=[% change.attachid %]&action=view">
>+                Attachment #[% change.attachid %]</a>         
>+              [% END %]
>+              [% change.field %]

This should be FILTER html, too, except that then you'd lose the attachment
links.

We don't ahve any fields with objectionable names, so I guess you can leave
this for the moment.

r=bbaetz
Attachment #76307 - Flags: review+
Comment on attachment 76307 [details] [diff] [review]
Patch v.1

>Index: CGI.pl

>+    my $operation = {};
>+    my $changes = ();

"$changes = ()" --> "$changes = []" since you are initializing an array
reference
(just like you use "{}" when initializing a hash reference).


>+        # Check for the results of an old Bugzilla data corruption bug
>+        $incomplete_data = 1 if ($added =~ /^\?/ || $removed =~ /^\?/);

Nit: unnecessary parentheses.


>+            $operation = {};
>+            $changes = ();

"$changes = ()" --> "$changes = []" since you are initializing an array
reference.


Fix these problems and I'll r= it.
Attachment #76307 - Flags: review-
Attached patch Patch v.2 (obsolete) — Splinter Review
> >+	    # Check for the results of an old Bugzilla data corruption bug
> >+	    $incomplete_data = 1 if ($added =~ /^\?/ || $removed =~ /^\?/);
> 
> Nit: unnecessary parentheses.

Because it's a double-barrelled clause, I think keeping them aids readability.

> Can you mention the bug # here, in the comment?

If I knew what it was :-| I don't think any of the old comments said.

Gerv
Attachment #76307 - Attachment is obsolete: true
Attached patch Patch v.3Splinter Review
v.2 is the same patch as v.1. Oops. :-)

Gerv
Attachment #77222 - Attachment is obsolete: true
Comment on attachment 77223 [details] [diff] [review]
Patch v.3

Works, looks good.  r=myk
Attachment #77223 - Flags: review+
>Because it's a double-barrelled clause, I think keeping them aids readability.

My mistake, you are right.  Nit rescinded. :-)
Comment on attachment 77223 [details] [diff] [review]
Patch v.3

WFM, too. the corruption bug was just an extra biut on the orignal checkin, so
don't bother with it.

r=bbaetz
Attachment #77223 - Flags: review+
Oh, and you need to change multiple.tmpl, too:

  [% PROCESS show/comments.tmpl comments=bug.comments %]

else comments don't show up on the long list stuff.
Fixed.

Checking in show_activity.cgi;
/cvsroot/mozilla/webtools/bugzilla/show_activity.cgi,v  <--  show_activity.cgi
new revision: 1.8; previous revision: 1.7
done
Checking in CGI.pl;
/cvsroot/mozilla/webtools/bugzilla/CGI.pl,v  <--  CGI.pl
new revision: 1.140; previous revision: 1.139
done
Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi
new revision: 1.120; previous revision: 1.119
done
RCS file:
/cvsroot/mozilla/webtools/bugzilla/template/default/show/activity.html.tmpl,v
done
Checking in template/default/show/activity.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/default/show/activity.html.tmpl,v 
<--  activity.html.tmpl
initial revision: 1.1
done
RCS file:
/cvsroot/mozilla/webtools/bugzilla/template/default/show/bug-activity.html.tmpl,v
done
Checking in template/default/show/bug-activity.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/default/show/bug-activity.html.tmpl,v
 <--  bug-activity.html.tmpl
initial revision: 1.1
done
Checking in template/default/show/comments.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/default/show/comments.tmpl,v  <-- 
comments.tmpl
new revision: 1.3; previous revision: 1.2
done
Checking in template/default/show/show_bug.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/default/show/show_bug.html.tmpl,v 
<--  show_bug.html.tmpl
new revision: 1.8; previous revision: 1.7
done
Checking in template/default/show/multiple.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/default/show/multiple.tmpl,v  <-- 
multiple.tmpl
new revision: 1.2; previous revision: 1.1
done

Gerv
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: