Closed Bug 344521 Opened 18 years ago Closed 18 years ago

Make custom fields optionally functional on enter_bug.cgi

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.23
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 2 obsolete files)

Sometimes you want a custom field to appear on enter_bug.cgi, sometimes you don't.

Also, sometimes you want the value to be mandatory, but we can do that in another bug.
Status: NEW → ASSIGNED
Depends on: 344513
Attached patch v1 (obsolete) — Splinter Review
This is a patch that assumes that the patch from bug 344513 is already applied.

I tested this patch.
Attachment #229085 - Flags: review?(LpSolit)
Comment on attachment 229085 [details] [diff] [review]
v1

Could you do a better diff? When viewing this patch with PatchViewer, it mixes everything in a single file (and interdiff doesn't work btw).
Attached patch v1.1 (obsolete) — Splinter Review
Okay, let's see if this version of the patch works.

The patch can still be applied, even if PatchReader doesn't understand it. (We should probably file a bug against PatchReader).
Attachment #229085 - Attachment is obsolete: true
Attachment #229418 - Flags: review?(LpSolit)
Attachment #229085 - Flags: review?(LpSolit)
Comment on attachment 229418 [details] [diff] [review]
v1.1

>diff -u template/en/default/bug/field.html.tmpl template/en/default/bug/field.html.tmpl

>         <input name="[% field.name FILTER html %]"
>                value="[% value FILTER html %]"
>+               [% "colspan=\"$value_span\"" IF value_span %]
>                size="60">

Doesn't pass tests 008filter.t. Add SET at the beginning of the directive.



>+++ template/en/default/bug/create/create.html.tmpl	17 Jul 2006 00:17:13 -0000

>+    [% SET value = ${field.name} IF ${field.name}.defined %]
>+    [% value %]

Huh? Not only is [% value %] unfiltered, but it has nothing to do here. bug/field.html.tmpl will display what is necessary to display.

Nit: also, field.name is *always* defined. I don't understand what you tried to do here.


>+      [% PROCESS bug/field.html.tmpl editable=1 value_span=3%]

Nit: add a whitespace after value_span=3.



>+++ checksetup.pl	17 Jul 2006 00:17:13 -0000

>+$dbh->bz_add_column('fielddefs', 'enter_bug', 
>+    {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'});

This has nothing to do in the --ADMIN-- section.
Attachment #229418 - Flags: review?(LpSolit) → review-
Attached patch v2Splinter Review
It's not a SET. It's something that prints. I added FILTER none.

I'm not calling field.name.defined. I'm calling ${field.name}.defined. That checks if a variable with the name ${field.name} is defined.

That stuff ended up in the ADMIN section only because of a fuzz when I re-created the patch. Fixed now.
Attachment #229418 - Attachment is obsolete: true
Attachment #229561 - Flags: review?(LpSolit)
Comment on attachment 229561 [details] [diff] [review]
v2

>Index: Bugzilla/Field.pm

>+=over
>+
>+=item C<enter_bug>
>+
>+A boolean specifying whether or not this field should appear on 
>+enter_bug.cgi
>+
>+=cut

You should really install Pod::Checker on your machine to run 011pod.t:

*** ERROR: =over on line 186 without closing =back (at head2) at line 200 in file Bugzilla/Field.pm
not ok 82 - Bugzilla/Field.pm has incorrect POD syntax --ERROR

There is missing =back before =cut. Fix that on checkin. Else your patch works fine. r=LpSolit
Attachment #229561 - Flags: review?(LpSolit) → review+
Flags: approval?
Flags: approval? → approval+
Okay, did the checkin fix. landfill does have Pod::Checker, I just don't always run the tests.

Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.508; previous revision: 1.507
done
Checking in enter_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v  <--  enter_bug.cgi
new revision: 1.143; previous revision: 1.142
done
Checking in post_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v  <--  post_bug.cgi
new revision: 1.157; previous revision: 1.156
done
Checking in Bugzilla/Field.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Field.pm,v  <--  Field.pm
new revision: 1.13; previous revision: 1.12
done
Checking in Bugzilla/DB/Schema.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v  <--  Schema.pm
new revision: 1.55; previous revision: 1.54
done
Checking in template/en/default/bug/field.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/field.html.tmpl,v  <--  field.html.tmpl
new revision: 1.5; previous revision: 1.4
done
Checking in template/en/default/bug/create/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl,v  <--  create.html.tmpl
new revision: 1.62; previous revision: 1.61
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: