Crash when trying to file a bug in a closed product

RESOLVED FIXED in Bugzilla 3.6

Status

()

--
major
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: LpSolit, Assigned: gregaryh)

Tracking

({regression})

Bugzilla 3.6
regression
Bug Flags:
approval +

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Reporter)

Description

10 years ago
Can't locate object method "disallow_new" via package "Bugzilla::Product" at Bugzilla/User.pm line 727.
 at Bugzilla/User.pm line 727
	Bugzilla::User::can_enter_product('Bugzilla::User=HASH(0xaee8990)', 'TestProduct', 1) called at /var/www/html/bugzilla-pg/enter_bug.cgi line 164


There are still some instances of disallow_new in the Bugzilla code:

./Bugzilla/User.pm 731:
    elsif ($product->disallow_new) {

./template/en/default/bug/field.html.tmpl 143:
    || (field.name == "product" && legal_value.disallow_new)

./template/en/default/admin/components/confirm-delete.html.tmpl 86:
  <TD VALIGN="top">[% IF product.disallow_new %]Yes[% ELSE %]No[% END %]</td>
(Assignee)

Comment 1

10 years ago
Created attachment 379704 [details] [diff] [review]
V1
Assignee: create-and-change → ghendricks
Attachment #379704 - Flags: review?(LpSolit)
(Assignee)

Comment 2

10 years ago
Created attachment 379707 [details] [diff] [review]
V2
Attachment #379704 - Attachment is obsolete: true
Attachment #379707 - Flags: review?(LpSolit)
Attachment #379704 - Flags: review?(LpSolit)
(Reporter)

Comment 3

10 years ago
Comment on attachment 379707 [details] [diff] [review]
V2

>Index: template/en/default/admin/components/confirm-delete.html.tmpl

>   <TD VALIGN="top">Closed for [% terms.bugs %]:</TD>
>-  <TD VALIGN="top">[% IF product.disallow_new %]Yes[% ELSE %]No[% END %]</td>
>+  <TD VALIGN="top">[% IF product.is_active %]No[% ELSE %]Yes[% END %]</td>

The logic must be changed to match what editproducts.cgi uses, i.e. "Open for new bugs" rather than "Closed for new bugs".



>Index: template/en/default/bug/field.html.tmpl

>+                       || (field.name == "product" && legal_value.is_active == 0)

Nit: it's better to write !legal_value.is_active.



>Index: Bugzilla/User.pm

>+    elsif ($product->is_active == 0) {

Nit: same here: elsif (!$product->is_active). So we don't care if ->is_active is 0, undefined or "".
Attachment #379707 - Flags: review?(LpSolit) → review-
(Assignee)

Comment 4

10 years ago
Created attachment 379709 [details] [diff] [review]
V3
Attachment #379707 - Attachment is obsolete: true
Attachment #379709 - Flags: review?
(Assignee)

Comment 5

10 years ago
Created attachment 379710 [details] [diff] [review]
V4
Attachment #379709 - Attachment is obsolete: true
Attachment #379710 - Flags: review?(LpSolit)
Attachment #379709 - Flags: review?
(Reporter)

Comment 6

10 years ago
Comment on attachment 379710 [details] [diff] [review]
V4

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

Updated

10 years ago
Flags: approval+
(Assignee)

Comment 7

10 years ago
    Checking in Bugzilla/User.pm;
    /cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v  <--  User.pm
    new revision: 1.189; previous revision: 1.188
    done
    Checking in template/en/default/admin/components/confirm-delete.html.tmpl;
    /cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/confirm-delete.html.tmpl,v  <--  confirm-delete.html.tmpl
    new revision: 1.13; previous revision: 1.12
    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.27; previous revision: 1.26
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.