Closed Bug 295933 Opened 20 years ago Closed 10 years ago

Can't create products without version, but can remove all versions after creating a product.

Categories

(Bugzilla :: Administration, task)

2.18.1
task
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: karl, Assigned: LpSolit)

References

Details

(Whiteboard: [fixed by blocker])

Attachments

(1 file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)
Build Identifier: 

Some of the products I'm creating in Bugzilla don't have versions associated 
with them.  When I tried to create a product without specifying a version, I 
was told that I could not, so I used "n/a" as the version and was then able to 
add the product with no problems whatsoever.  Later, while editing the product, 
I noticed that I could delete entries from the list of versions.  I tried 
deleting the one version I had for the aforementioned product, and it let me.  
Is that supposed to happen?

Reproducible: Always

Steps to Reproduce:
1. Create a new product, leaving the Version field blank.  When told that the 
product can not be created due to the missing version, go back and add a 
version.  Submit and note the confirmation.
2. Go to the list of products.  Select the recently-created product.
3. Edit the list of versions for the product, deleting the only version 
currently defined for the product.
Actual Results:  
The version was deleted.  When editing the product, the list of versions simply 
has the text "missing" in red.

Expected Results:  
Since I was told that I had to have a version specified for the product, I 
expected to see an error to the effect of "This version is the last version 
listed for the product and can not be deleted."

I am running Bugzilla 2.18.1.

I noticed bug 223570, which makes me think this is a problem.  I can't be sure, 
but it's probably worth noting anyway.
Valid. I don't say we should prevent a user from removing the last remaining
version (if there are no bugs in it), but at least we should be consistent
between the creation and the edition of a product. Meaning that we should maybe
allow a user to create a new product with no version defined.

What I have in mind is that someone could be interested in creating a new
product, with components, owners and QA contacts, but without knowing what the
future versions of this new product will be.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: MacOS X → All
Hardware: Macintosh → All
Version: unspecified → 2.18.1
How about this?

The simplest solution seems to be to internally use a version like ' ' (a single space) whenever 
somebody decides to not provide a default version.  If this is used, then I think the only scripts that 
would need to know what is going on are editproducts.cgi and editversions.cgi.

editproducts.cgi would need to be modified to do two things:

* When creating new products, change the default field value from 'unspecified' to '' (empty).
* When creating new products, if the user chose '' (empty) as the version, change it to ' ' (a single 
space).
* When creating new products, if the user chose ' ' (a single space) as the version, tell the user that the 
version chosen is invalid, and that if they do not want a version to simply leave the field blank.

editversions.cgi would have to be modified so that when showing the list of versions for a product, if ' ' 
is one of the versions, don't display it in the list.  An alternative would be to display it in the list, but 
instead of showing ' ', show something like '(no version selected)'.  Of course, with this alternative, the 
user could have just set that as the version in the first place.

enter_bug.cgi would have to be modified to not include ' ' in the list of versions.

post_bug.cgi would have to be modified to set the default version to ' ' if the version field is empty, 
instead of spitting out an error.

I don't think anything else would need to be changed.  The rest of Bugzilla could act as if there is a 
version (which, technically, there is).

I can only think of two problems.  First of all, it's basically a hack, and in doing so takes one away from 
the set of all possible versions that could be placed into the system (although how many people would 
use ' ' as a real version?).  Secondly, it would become interesting if an administrator later decided to 
start using versions on the product.  In that case, the thing to do would be to prevent people from 
entering bugs to the ' ' version.  That would require a modification of process_bug.cgi (to prevent users 
from changing the version on bugs that already exist) and post_bug.cgi (to error out if a version is set).

Comments?  Thanks!
Your solution is by far too invasive and looks like a big hack. Either
editversions.cgi should not allow you to delete the last version of a product or
editproducts.cgi should allow to provide no version when creating a new product.
Both solutions only involve either editversions.cgi or editproducts.cgi.
Target Milestone: --- → Bugzilla 2.20
Attached patch patch, v1 (deleted) — Splinter Review
Now even if the user hack the URL, he cannot remove the last version anymore.
Assignee: administration → LpSolit
Status: NEW → ASSIGNED
Attachment #195964 - Flags: review?(bugzilla)
Some features used in this patch are not available in 2.20 yet. Retargetting to
2.22.
Target Milestone: Bugzilla 2.20 → Bugzilla 2.22
Attachment #195964 - Flags: review?(bugzilla) → review?(wicked)
Comment on attachment 195964 [details] [diff] [review]
patch, v1

1) bitrot

2) 'undeletable' is not really a word. What about:

(The last version cannot be deleted)
(The only version cannot be deleted)
(Need at least one version)
(Last Version)
(Only Version)

NITS:

3) Could provide a link to delete the product - if they really want to

4) 'This version is the last version available for this product and so
   it cannot be deleted.' would be better as one of these maybe:

This version is the only remaining version for this product and so...
This is the only remaining version for this product and so...
The only version cannot be deleted...
The last version cannot be deleted...

5) I don't like the inconsistency when some templates use a parameter
   called product which is an object, and some templates use a
   parameter called product which is a string. Using the object is
   obviously better, which is why this is a NIT, in the hope that we
   will be resolving this later.
Attachment #195964 - Flags: review-
Attachment #195964 - Flags: review?(wicked)
Too invasive for 2.22. And let bug 311258 go in first.
Severity: normal → minor
Depends on: 311258
Target Milestone: Bugzilla 2.22 → Bugzilla 2.24
Target Milestone: Bugzilla 3.0 → Bugzilla 3.2
Assignee: LpSolit → administration
Status: ASSIGNED → NEW
Target Milestone: Bugzilla 3.2 → ---
I fixed this problem in bug 661476.
Assignee: administration → LpSolit
Status: NEW → RESOLVED
Closed: 10 years ago
Depends on: 661476
Resolution: --- → FIXED
Whiteboard: [fixed by blocker]
Target Milestone: --- → Bugzilla 4.4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: