Closed
Bug 449390
Opened 16 years ago
Closed 16 years ago
"Add Product" fails with software error "Column 'defaultmilestone' cannot be null"
Categories
(Bugzilla :: Administration, task)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.4
People
(Reporter: chumak, Assigned: LpSolit)
References
Details
(Keywords: regression)
Attachments
(1 file)
(deleted),
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16
From the query it appears that none of the values for the product are set and therefore it fails on columns which are supposed to be non-null. I entered the name and description, leaving other fields untouched.
Reproducible: Always
Steps to Reproduce:
1. Go to Administration
2. Click Products
3. Fill in Name and Description
4. Click Add
Actual Results:
Software error:
DBD::mysql::db do failed: Column 'defaultmilestone' cannot be null [for Statement "INSERT INTO products (defaultmilestone, votesperuser, disallownew, name, classification_id, milestoneurl, maxvotesperbug, description, votestoconfirm) VALUES (?,?,?,?,?,?,?,?,?)"] at Bugzilla/Object.pm line 352
Bugzilla::Object::insert_create_data('Bugzilla::Product', 'HASH(0x17a31540)') called at Bugzilla/Product.pm line 106
Bugzilla::Product::create('Bugzilla::Product', 'HASH(0x18dcf9e0)') called at /PATH_TO/bugs/editproducts.cgi line 171
For help, please send mail to the webmaster (MY_EMAIL), giving this error message and the time and date of the error.
Expected Results:
New product was supposed to be created
Reporter | ||
Updated•16 years ago
|
Version: unspecified → 3.3
Assignee | ||
Comment 1•16 years ago
|
||
I thought that undef would automatically trigger the default value for the DB column, but it doesn't. The column must not appear at all in the SQL call. Good to know! :)
Assignee: administration → LpSolit
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #332527 -
Flags: review?(mkanat)
Assignee | ||
Comment 2•16 years ago
|
||
Max, I know you prefer '---' to be stored in a constant, as suggested in bug 313122 comment 19, but the goal of this bug is to fix the crash. Yet another bug.
Depends on: 313122
Keywords: regression
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 4.0
Comment 3•16 years ago
|
||
Comment on attachment 332527 [details] [diff] [review]
patch, v1
Hmm, I'd rather rely on the DB default and not duplicate it in the code, in case somebody wants to customize it.
You could have run_create_validators delete defaultmilestone if it's undef--I think that'd do it, no?
Assignee | ||
Comment 4•16 years ago
|
||
(In reply to comment #3)
> Hmm, I'd rather rely on the DB default and not duplicate it in the code, in
> case somebody wants to customize it.
This problem can wait till the "Put --- in a constant" bug is fixed.
> You could have run_create_validators delete defaultmilestone if it's undef--I
> think that'd do it, no?
Unless this is done in a central way in Object.pm, no. I don't want run_create_validators() in Project.pm to work differently. Probably Object->create() could drop undefined fields before creating the SQL to create the entry in the DB.
Comment 5•16 years ago
|
||
(In reply to comment #4)
> I don't want run_create_validators() in Project.pm to work differently.
Oh, I just meant specifically check for this field. You could also do it inside Product->create()
> Probably
> Object->create() could drop undefined fields before creating the SQL to create
> the entry in the DB.
No, we wouldn't do that, we want undef to mean explicitly NULL.
Assignee | ||
Comment 6•16 years ago
|
||
(In reply to comment #5)
> Oh, I just meant specifically check for this field. You could also do it
> inside Product->create()
Hum, in this case, this behavior would apply to most fields in Product->create as I hardcoded most default values in validators.
Comment 7•16 years ago
|
||
(In reply to comment #6)
> Hum, in this case, this behavior would apply to most fields in Product->create
> as I hardcoded most default values in validators.
Hmm...yeah, not certain what to do about that. Products are one of the few things that have meaningful defaults.
Comment 8•16 years ago
|
||
Comment on attachment 332527 [details] [diff] [review]
patch, v1
Since this is a bug fix, I can go with this for now.
Attachment #332527 -
Flags: review?(mkanat) → review+
Updated•16 years ago
|
Flags: approval+
Assignee | ||
Comment 9•16 years ago
|
||
Checking in Bugzilla/Product.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Product.pm,v <-- Product.pm
new revision: 1.29; previous revision: 1.28
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Target Milestone: Bugzilla 4.0 → Bugzilla 3.4
You need to log in
before you can comment on or make changes to this bug.
Description
•