Closed Bug 64192 Opened 24 years ago Closed 20 years ago

Tables unlocked too late when altering case of component name

Categories

(Bugzilla :: Administration, task, P2)

Tracking

()

RESOLVED DUPLICATE of bug 252450

People

(Reporter: peter, Assigned: justdave)

References

Details

Attachments

(1 file, 3 obsolete files)

If you change the Capitalisation of a compenent name in bugzilla 2.10 running
under linux 2.2.14 and MySQL 3.22.32 you get an sql error soemthing along the
lines of 

SELECT profiles.userid, profiles.groupset, profiles.login_name,
profiles.login_name =
'xxxx@yyyy.com' AND profiles.cryptpassword = logincookies.cryptpassword AND
logincookies.hostname = '127.0.0.1', profiles.disabledtext FROM profiles,
logincookies WHERE
logincookies.cookie = '2' AND profiles.userid = logincookies.userid: Table
'profiles' was not locked
with LOCK TABLES at globals.pl line 133. 

This only occures if all you change is capitalisation, and not if you actualy
change the name, the best work arround therefore being, if you want to change
AAA to aaa first change to aaaa, then to aaa.
Target Milestone: --- → Bugzilla 2.16
Is this because in the 'update' action part of editcomponents.cgi, most of the 
error cases are followed with:

   SendSQL("UNLOCK TABLES");
   PutTrailer($localtrailer);

(in that order), but in 2 cases, ("can't delete product name", and "component 
name already in use", the order of these 2 statement is reversed, so that the 
PutTrailer() was trying to access the profiles table before it was unlocked?

Anyway, the patch I'll apply in a mo has fixed this for me..

(Note that this bug has a very similar SQL error to bug#54566 -- are there 
other situations which do a similar thing?)
Status: NEW → ASSIGNED
Apologies for changing NEW -> ASSIGNED, I was trying to assign to me, and now I 
can't do any (re-)assigning at all :(
I spotted another case where the PutTrailer() came before the UNLOCK, so I added
a new patch for all 3 cases. (This one was for deleting the description of a
component.)

Note that this patch still doesn't let you change the capitalisation of a
component (or product, for that matter). I'll raise another bug for that in a mo...

I tried to add the 'patch' keyword - but I wasn't allowed :(
I have created bug#86051 for the actual problem of not being able to change
capitalisation.
Keywords: patch, review
What do these patches do then?  Is the summary of this bug now wrong?
This patch makes bugzilla not output the SQL error to the user.

Bugzilla now fails 'nicely'.

Perhaps the title of this bug could change to something like 'tables unlocked
too late when editing components', but it's sort of OK~ish as it stands.
Summary: Altering Capitalisation of a Component Name causes SQL failure → Tables unlocked too late when altering case of component name
Priority: -- → P2
-> New Bugzilla Product
Assignee: tara → justdave
Status: ASSIGNED → NEW
No, really, -> New Bugzilla Product
Component: Bugzilla → Administration
Product: Webtools → Bugzilla
Version: other → unspecified
This patch is OK but this stuff should probably use PuntTryAgain.
I'll do an updated patch in a bit - I just noticed some un html_quote()ed stuff
as well, so I'll include that.
Updated patch:

1) Some html_quotes() added when printing product and component extracted from
URL. This may be overkill, as the permissions check is done before any spurious
printing, but I don't think it can harm anything.

2) PuntTryAgain() called in all error cases

3) Apart from one DisplayError()

4) Also, comment typos when it said it couldn't delete a product name, when it
actually couldn't remove a component name, and saying product when it actually
successfully renamed a component
Attachment #38403 - Attachment is obsolete: true
Attachment #38573 - Attachment is obsolete: true
Number 4) in the changes in the last patch wasn't actually 'comment' typos, it
was  typos in the real html output
Comment on attachment 48417 [details] [diff] [review]
When in doubt, put () around params to a sub (man perlstyle).

Looks OK to me. r=gerv.

Gerv
Attachment #48417 - Flags: review+
Comment on attachment 48417 [details] [diff] [review]
When in doubt, put () around params to a sub (man perlstyle).

>Index: editcomponents.cgi
>===================================================================
>RCS file: /opt/repositories/sysadmin/src/bugzilla/editcomponents.cgi,v
>retrieving revision 1.1.1.4
>diff -w -u -r1.1.1.4 editcomponents.cgi
>--- editcomponents.cgi	2001/08/30 09:01:12	1.1.1.4
>+++ editcomponents.cgi	2001/09/06 14:58:30
>@@ -66,15 +66,13 @@
> 
>     # do we have a product?
>     unless ($prod) {
>-        print "Sorry, you haven't specified a product.";
>-        PutTrailer();
>-        exit;
>+        PuntTryAgain("Sorry, you haven't specified a product.");
>     }
> 
>     unless (TestProduct($prod)) {
>-        print "Sorry, product '$prod' does not exist.";
>-        PutTrailer();
>-        exit;
>+        PuntTryAgain("Sorry, product '" .
>+                     html_quote($prod) . 
>+                     "' does not exist.");
>     }
> }
> 
>@@ -95,17 +93,15 @@
> 
>     # do we have the component?
>     unless ($comp) {
>-        print "Sorry, you haven't specified a component.";
>-        PutTrailer();
>-        exit;
>+        PuntTryAgain("Sorry, you haven't specified a component.");
>     }
> 
>     CheckProduct($prod);
> 
>     unless (TestComponent($prod,$comp)) {
>-        print "Sorry, component '$comp' for product '$prod' does not exist.";
>-        PutTrailer();
>-        exit;
>+        PuntTryAgain("Sorry, component '" . 
>+                     html_quote($comp) . "' for product '" .
>+                     html_quote($prod) . "' does not exist.");
>     }
> }
> 
>@@ -189,17 +185,18 @@
> 
> confirm_login();
> 
>-print "Content-type: text/html\n\n";
>-
> unless (UserInGroup("editcomponents")) {
>-    PutHeader("Not allowed");
>-    print "Sorry, you aren't a member of the 'editcomponents' group.\n";
>-    print "And so, you aren't allowed to add, modify or delete components.\n";
>-    PutTrailer();
>+    DisplayError("Sorry, you aren't a member of the 'editcomponents' " . 
>+                 "group.\nAnd so, you aren't allowed to add, modify or " . 
>+                 "delete components.\n",
>+                 "Not allowed");
>     exit;
> }
> 
>+print "Content-type: text/html\n\n";
>+
> 
>+
> #
> # often used variables
> #
>@@ -266,7 +263,8 @@
> #
> 
> unless ($action) {
>-    PutHeader("Select component of $product");
>+    PutHeader("Select component of " . 
>+              html_quote($product));
>     CheckProduct($product);
> 
>     if ($dobugcounts) {
>@@ -338,7 +336,8 @@
> #
> 
> if ($action eq 'add') {
>-    PutHeader("Add component of $product");
>+    PutHeader("Add component of " . 
>+              html_quote($product));
>     CheckProduct($product);
> 
>     #print "This page lets you add a new product to bugzilla.\n";
>@@ -366,31 +365,25 @@
> #
> 
> if ($action eq 'new') {
>-    PutHeader("Adding new component of $product");
>+    PutHeader("Adding new component of " . 
>+              html_quote($product));
>     CheckProduct($product);
> 
>     # Cleanups and valididy checks
> 
>     unless ($component) {
>-        print "You must enter a name for the new component. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("You must enter a name for the new component.");
>     }
>     if (TestComponent($product,$component)) {
>-        print "The component '$component' already exists. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("The component '" . 
>+                     html_quote($component) . "' already exists.");
>     }
> 
>     my $description = trim($::FORM{description} || '');
> 
>     if ($description eq '') {
>-        print "You must enter a description for the component '$component'. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("You must enter a description for the component '" . 
>+                     html_quote($component) . "'.");
>     }
> 
>     my $initialowner = trim($::FORM{initialowner} || '');
>@@ -400,36 +393,30 @@
> 	DBNameToIdAndCheck($initialowner);
> 
>     if ($initialowner eq '') {
>-        print "You must enter an initial owner for the component '$component'. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("You must enter an initial owner for the component '" . 
>+                     html_quote($component) . "'.");
>     }
> 
>     my $initialownerid = DBname_to_id ($initialowner);
>     if (!$initialownerid) {
>-        print "You must use an existing Bugzilla account as initial owner for the component
>-'$component'. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("You must use an existing Bugzilla account as " . 
>+                     "initial owner for the component '" .
>+                     html_quote($component) . "'.");
>       }
> 
>     my $initialqacontact = trim($::FORM{initialqacontact} || '');
>     my $initialqacontactid = DBname_to_id ($initialqacontact);
>     if (Param('useqacontact')) {
>         if ($initialqacontact eq '') {
>-            print "You must enter an initial QA contact for the component '$component'. Please press\n";
>-            print "<b>Back</b> and try again.\n";
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("You must enter an initial QA contact for " .
>+                         "the component '" . 
>+                         html_quote($component) . "'.");
>         }
> 
>         if (!$initialqacontactid) {
>-            print "You must use an existing Bugzilla account as initial QA contact for the component '$component'. Please press\n";
>-            print "<b>Back</b> and try again.\n";
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("You must use an existing Bugzilla " .
>+                         "account as initial QA contact for the component '" .
>+                         html_quote($component) . "'.");
>         }
> 	#
> 	# Now validating to make sure it's too an existing account
>@@ -468,7 +455,8 @@
> #
> 
> if ($action eq 'del') {
>-    PutHeader("Delete component of $product");
>+    PutHeader("Delete component of " . 
>+              html_quote($product));
>     CheckComponent($product, $component);
> 
>     # display some data about the component
>@@ -499,7 +487,7 @@
> 
>     print "</TR><TR>\n";
>     print "  <TD VALIGN=\"top\">Component:</TD>\n";
>-    print "  <TD VALIGN=\"top\">$component</TD>";
>+    print "  <TD VALIGN=\"top\">" . html_quote($component) . "</TD>";
> 
>     print "</TR><TR>\n";
>     print "  <TD VALIGN=\"top\">Component description:</TD>\n";
>@@ -521,7 +509,7 @@
> 
>     print "</TR><TR>\n";
>     print "  <TD VALIGN=\"top\">Component of product:</TD>\n";
>-    print "  <TD VALIGN=\"top\">$product</TD>\n";
>+    print "  <TD VALIGN=\"top\">" . html_quote($product) . "</TD>\n";
> 
>     print "</TR><TR>\n";
>     print "  <TD VALIGN=\"top\">Description:</TD>\n";
>@@ -550,11 +538,10 @@
> 
>     if ($bugs) {
>         if (!Param("allowbugdeletion")) {
>-            print "Sorry, there are $bugs bugs outstanding for this component. 
>-You must reassign those bugs to another component before you can delete this
>-one.";
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, there are $bugs bugs outstanding for " .
>+                         "this component. You must reassign those bugs " .
>+                         "to another component before you can delete this " .
>+                         "one.");
>         }
>         print "<TABLE BORDER=0 CELLPADDING=20 WIDTH=\"70%\" BGCOLOR=\"red\"><TR><TD>\n",
>               "There are bugs entered for this component!  When you delete this ",
>@@ -585,7 +572,8 @@
> #
> 
> if ($action eq 'delete') {
>-    PutHeader("Deleting component of $product");
>+    PutHeader("Deleting component of " .
>+              html_quote($product));
>     CheckComponent($product,$component);
> 
>     # lock the tables before we start to change everything:
>@@ -645,7 +633,8 @@
> #
> 
> if ($action eq 'edit') {
>-    PutHeader("Edit component of $product");
>+    PutHeader("Edit component of " . 
>+              html_quote($product));
>     CheckComponent($product,$component);
> 
>     # get data of component
>@@ -710,7 +699,8 @@
> #
> 
> if ($action eq 'update') {
>-    PutHeader("Update component of $product");
>+    PutHeader("Update component of " . 
>+              html_quote($product));
> 
>     my $componentold        = trim($::FORM{componentold}        || '');
>     my $description         = trim($::FORM{description}         || '');
>@@ -730,10 +720,7 @@
> 
>     if ($description ne $descriptionold) {
>         unless ($description) {
>-            print "Sorry, I can't delete the description.";
>-            PutTrailer($localtrailer);
>-	    SendSQL("UNLOCK TABLES");
>-            exit;
>+            PuntTryAgain("Sorry, I can't delete the description.");
>         }
>         SendSQL("UPDATE components
>                  SET description=" . SqlQuote($description) . "
>@@ -745,18 +732,13 @@
> 
>     if ($initialowner ne $initialownerold) {
>         unless ($initialowner) {
>-            print "Sorry, I can't delete the initial owner.";
>-	    SendSQL("UNLOCK TABLES");
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, I can't delete the initial owner.");
>         }
> 
>         my $initialownerid = DBname_to_id($initialowner);
>         unless ($initialownerid) {
>-            print "Sorry, you must use an existing Bugzilla account as initial owner.";
>-            SendSQL("UNLOCK TABLES");
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, you must use an existing Bugzilla " .
>+                         "account as initial owner.");
>         }
> 
>         SendSQL("UPDATE components
>@@ -768,18 +750,13 @@
> 
>     if (Param('useqacontact') && $initialqacontact ne $initialqacontactold) {
>         unless ($initialqacontact) {
>-            print "Sorry, I can't delete the initial QA contact.";
>-	    SendSQL("UNLOCK TABLES");
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, I can't delete the initial QA contact.");
>         }
> 
>         my $initialqacontactid = DBname_to_id($initialqacontact);
>         unless ($initialqacontactid) {
>-            print "Sorry, you must use an existing Bugzilla account as initial QA contact.";
>-            SendSQL("UNLOCK TABLES");
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, you must use an existing Bugzilla " . 
>+                         "account as initial QA contact.");
>         }
> 
>         SendSQL("UPDATE components
>@@ -792,16 +769,11 @@
> 
>     if ($component ne $componentold) {
>         unless ($component) {
>-            print "Sorry, I can't delete the product name.";
>-            PutTrailer($localtrailer);
>-	    SendSQL("UNLOCK TABLES");
>-            exit;
>+            PuntTryAgain("Sorry, I can't delete the component name.");
>         }
>         if (TestComponent($product,$component)) {
>-            print "Sorry, component name '$component' is already in use.";
>-            PutTrailer($localtrailer);
>-	    SendSQL("UNLOCK TABLES");
>-            exit;
>+            PuntTryAgain("Sorry, component name '" .
>+                         html_quote($component) . "' is already in use.");
>         }
> 
>         SendSQL("UPDATE bugs
>@@ -814,7 +786,7 @@
>                    AND program=" . SqlQuote($product));
> 
>         unlink "data/versioncache";
>-        print "Updated product name.<BR>\n";
>+        print "Updated component name.<BR>\n";
>     }
>     SendSQL("UNLOCK TABLES");
>
Attachment #48417 - Attachment description: Patch using PuntTryAgain() for errors → When in doubt, put () around params to a sub (man perlstyle).
Comment on attachment 48417 [details] [diff] [review]
When in doubt, put () around params to a sub (man perlstyle).

r1=zach@zachlipton.com on that
Hmm, shouldn't PuntTryAgain do the HTML quoting?  Likely this patch is OK as is,
but I think we shouldn't have to worry about all the quoting.
I looked at doing the quoting in PuntTryAgain() for bug#95235, but found that
there are some routines which want to pass it valid html, so it can't do the
quoting itself :(

This is unfortunate, but the same is true of DisplayError(), and some local
Error() routines in some other cgis.

I think it would be great if there was a 'safe' output routine which could be
used, or at least a flag to PuntTryAgain()/DisplayError() to say: 'do the
quoting yourself'.

(Zach: Your quoting of the patch in a comment, and change of it's title -- does
that mean it needs more work?)
Comment on attachment 48417 [details] [diff] [review]
When in doubt, put () around params to a sub (man perlstyle).

I reviewed the patch, and it still needs a few changes.  See my comments below.
-myk

>Index: editcomponents.cgi
>===================================================================
>RCS file: /opt/repositories/sysadmin/src/bugzilla/editcomponents.cgi,v
>retrieving revision 1.1.1.4
>diff -w -u -r1.1.1.4 editcomponents.cgi
>--- editcomponents.cgi	2001/08/30 09:01:12	1.1.1.4
>+++ editcomponents.cgi	2001/09/06 14:58:30
>@@ -66,15 +66,13 @@
> 
>     # do we have a product?
>     unless ($prod) {
>-        print "Sorry, you haven't specified a product.";
>-        PutTrailer();
>-        exit;
>+        PuntTryAgain("Sorry, you haven't specified a product.");
>     }

This code is redundant since CheckProduct is never called without a product,
but it is probably good to keep it in case this function gets used in 
different ways in the future.


>     unless (TestProduct $prod) {
>-        print "Sorry, product '$prod' does not exist.";
>-        PutTrailer();
>-        exit;
>+        PuntTryAgain("Sorry, product '" .
>+                     html_quote($prod) . 
>+                     "' does not exist.");

Works.


>     # do we have the component?
>     unless ($comp) {
>-        print "Sorry, you haven't specified a component.";
>-        PutTrailer();
>-        exit;
>+        PuntTryAgain("Sorry, you haven't specified a component.");

Works.


>     unless (TestComponent $prod,$comp) {
>-        print "Sorry, component '$comp' for product '$prod' does not exist.";
>-        PutTrailer();
>-        exit;
>+        PuntTryAgain("Sorry, component '" . 
>+                     html_quote($comp) . "' for product '" .
>+                     html_quote($prod) . "' does not exist.");

Works


>-print "Content-type: text/html\n\n";
>-
> unless (UserInGroup("editcomponents")) {
>-    PutHeader("Not allowed");
>-    print "Sorry, you aren't a member of the 'editcomponents' group.\n";
>-    print "And so, you aren't allowed to add, modify or delete components.\n";
>-    PutTrailer();
>+    DisplayError("Sorry, you aren't a member of the 'editcomponents' " . 
>+                 "group.\nAnd so, you aren't allowed to add, modify or " . 
>+                 "delete components.\n",
>+                 "Not allowed");

Works, but DisplayError displays the message in HTML, so line breaks are
irrelevant.  Use <br> tags if you really want to force line breaks, or
leave the line break characters out.


> unless ($action) {
>-    PutHeader("Select component of $product");
>+    PutHeader("Select component of " . 
>+              html_quote($product));

Works.


> if ($action eq 'add') {
>-    PutHeader("Add component of $product");
>+    PutHeader("Add component of " . 
>+              html_quote($product));

Works.


> if ($action eq 'new') {
>-    PutHeader("Adding new component of $product");
>+    PutHeader("Adding new component of " . 
>+              html_quote($product));

Works.


>     unless ($component) {
>-        print "You must enter a name for the new component. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("You must enter a name for the new component.");

Works.


>     if (TestComponent($product,$component)) {
>-        print "The component '$component' already exists. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("The component '" . 
>+                     html_quote($component) . "' already exists.");

Works.


>     if ($description eq '') {
>-        print "You must enter a description for the component '$component'. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("You must enter a description for the component '" . 
>+                     html_quote($component) . "'.");

Works.


>     if ($initialowner eq '') {
>-        print "You must enter an initial owner for the component '$component'. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("You must enter an initial owner for the component '" . 
>+                     html_quote($component) . "'.");

Works.


>     my $initialownerid = DBname_to_id ($initialowner);
>     if (!$initialownerid) {
>-        print "You must use an existing Bugzilla account as initial owner for the component
>-'$component'. Please press\n";
>-        print "<b>Back</b> and try again.\n";
>-        PutTrailer($localtrailer);
>-        exit;
>+        PuntTryAgain("You must use an existing Bugzilla account as " . 
>+                     "initial owner for the component '" .
>+                     html_quote($component) . "'.");

A call to "DBNameToIdAndCheck($initialowner);" appears right before this line,
which means that this code will never get called since DBNameToIdAndCheck
errors out if it doesn't get a valid username.  Either move the call to
DBNameToIdAndCheck under this code (the same way the code to check initialqacontact
is written) or remove this code, since DBNameToIdAndCheck returns a relatively
appropriate error message.


>         if ($initialqacontact eq '') {
>-            print "You must enter an initial QA contact for the component '$component'. Please press\n";
>-            print "<b>Back</b> and try again.\n";
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("You must enter an initial QA contact for " .
>+                         "the component '" . 
>+                         html_quote($component) . "'.");

Works.


>         if (!$initialqacontactid) {
>-            print "You must use an existing Bugzilla account as initial QA contact for the component '$component'. Please press\n";
>-            print "<b>Back</b> and try again.\n";
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("You must use an existing Bugzilla " .
>+                         "account as initial QA contact for the component '" .
>+                         html_quote($component) . "'.");

Works.


> if ($action eq 'del') {
>-    PutHeader("Delete component of $product");
>+    PutHeader("Delete component of " . 
>+              html_quote($product));

Works.


>-    print "  <TD VALIGN=\"top\">$component</TD>";
>+    print "  <TD VALIGN=\"top\">" . html_quote($component) . "</TD>";

Works.


>-    print "  <TD VALIGN=\"top\">$product</TD>\n";
>+    print "  <TD VALIGN=\"top\">" . html_quote($product) . "</TD>\n";

Works.


>     if ($bugs) {
>         if (!Param("allowbugdeletion")) {
>-            print "Sorry, there are $bugs bugs outstanding for this component. 
>-You must reassign those bugs to another component before you can delete this
>-one.";
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, there are $bugs bugs outstanding for " .
>+                         "this component. You must reassign those bugs " .
>+                         "to another component before you can delete this " .
>+                         "one.");

Works.


>-    PutHeader("Deleting component of $product");
>+    PutHeader("Deleting component of " .
>+              html_quote($product));

Works.


> if ($action eq 'edit') {
>-    PutHeader("Edit component of $product");
>+    PutHeader("Edit component of " . 
>+              html_quote($product));

Works.


> if ($action eq 'update') {
>-    PutHeader("Update component of $product");
>+    PutHeader("Update component of " . 
>+              html_quote($product));

Works.


>     if ($description ne $descriptionold) {
>         unless ($description) {
>-            print "Sorry, I can't delete the description.";
>-            PutTrailer($localtrailer);
>-	    SendSQL("UNLOCK TABLES");
>-            exit;
>+            PuntTryAgain("Sorry, I can't delete the description.");

Works.


>     if ($initialowner ne $initialownerold) {
>         unless ($initialowner) {
>-            print "Sorry, I can't delete the initial owner.";
>-	    SendSQL("UNLOCK TABLES");
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, I can't delete the initial owner.");

Works.


>         unless ($initialownerid) {
>-            print "Sorry, you must use an existing Bugzilla account as initial owner.";
>-            SendSQL("UNLOCK TABLES");
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, you must use an existing Bugzilla " .
>+                         "account as initial owner.");

Works.


>     if (Param('useqacontact') && $initialqacontact ne $initialqacontactold) {
>         unless ($initialqacontact) {
>-            print "Sorry, I can't delete the initial QA contact.";
>-	    SendSQL("UNLOCK TABLES");
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, I can't delete the initial QA contact.");

Works.


>         unless ($initialqacontactid) {
>-            print "Sorry, you must use an existing Bugzilla account as initial QA contact.";
>-            SendSQL("UNLOCK TABLES");
>-            PutTrailer($localtrailer);
>-            exit;
>+            PuntTryAgain("Sorry, you must use an existing Bugzilla " . 
>+                         "account as initial QA contact.");

Works.


>     if ($component ne $componentold) {
>         unless ($component) {
>-            print "Sorry, I can't delete the product name.";
>-            PutTrailer($localtrailer);
>-	    SendSQL("UNLOCK TABLES");
>-            exit;
>+            PuntTryAgain("Sorry, I can't delete the component name.");

Works.


>         if (TestComponent($product,$component)) {
>-            print "Sorry, component name '$component' is already in use.";
>-            PutTrailer($localtrailer);
>-	    SendSQL("UNLOCK TABLES");
>-            exit;
>+            PuntTryAgain("Sorry, component name '" .
>+                         html_quote($component) . "' is already in use.");

Works.


>-        print "Updated product name.<BR>\n";
>+        print "Updated component name.<BR>\n";

Works.
Attachment #48417 - Flags: review+ → review-
I made the changes as per the review.

It should be noted that this patch does a bit more than the title of this bug:

1) fixes the cases where table were unlocked too late
2) tidies the code by using PutFooter and DisplayError() where appropriate
3) rearranges the check for initial owner to be consistent with the
initialqacontact case, and
4) fixes a couple of places where product and component got confused in messages.

(Thanks for doing the review.)
Attachment #48417 - Attachment is obsolete: true
We are currently trying to wrap up Bugzilla 2.16.  We are now close enough to
release time that anything that wasn't already ranked at P1 isn't going to make
the cut.  Thus this is being retargetted at 2.18.  If you strongly disagree with
this retargetting, please comment, however, be aware that we only have about 2
weeks left to review and test anything at this point, and we intend to devote
this time to the remaining bugs that were designated as release blockers.
Target Milestone: Bugzilla 2.16 → Bugzilla 2.18
Note to self (or someone else, if they get there first): When re-doing this
patch for 2.16, try and squeeze in a fix for bug#76864
Another note to self: this should all be fixed in the whole new edit*.cgi
rationalisation, so this bug will hopefully be fixed then.
*** Bug 128620 has been marked as a duplicate of this bug. ***
GavinS: re comment 25 (and why not 26 as well), do you have plans for this? 
Jouni, 

I think that there is a bug somewhere to rationalise all the edit*.cgi scripts 
which should fix this bug itself. If that bug doesn't fix this, then
templatisation of all the admin/edit*.cgi scripts (if not already done) would
probably do so. Both those are a bit out of my league :(

However, when I finally get around to installing the latest 2.16RC sometime in
the next few weeks, I do plan on going through all my bitrotted 2.14 patches,
and updating them if possible and relevent -- and if this bug is still an issue,
I will try and do a quick new patch.

Feel free to jump in and fix it before then though... :)




OS: Linux → All
Hardware: PC → All
Unloved bugs targetted for 2.18 but untouched since 9-15-2003 are being
retargeted to 2.20
If you plan to act on one immediately, go ahead and pull it back to 2.18.
Target Milestone: Bugzilla 2.18 → Bugzilla 2.20
*** Bug 252450 has been marked as a duplicate of this bug. ***
(In reply to comment #8)
> Perhaps the title of this bug could change to something like 'tables unlocked
> too late when editing components', but it's sort of OK~ish as it stands.

This is basically the title of Bug 252450, which turned out to be a duplicate 
of this one here. I for one opt for renaming.

Is blocking2.18 ok, just like bug 252450?
Flags: blocking2.18?
I can't make this happen in 2.18rc1

Can you still make this fail?
I realize that this one was reported first, but the other is being tracked for
2.18 already


*** This bug has been marked as a duplicate of 252450 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Flags: blocking2.18?
Resolution: --- → DUPLICATE
Target Milestone: Bugzilla 2.20 → ---
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

Creator:
Created:
Updated:
Size: