ox-it / ords

Automatically exported from code.google.com/p/ords
0 stars 0 forks source link

Leaving 'Name' field blank when adding a new primary key to a table causes problems #777

Open MerielP opened 8 years ago

MerielP commented 8 years ago

To reproduce this bug:

At this stage, you will get a pop-up error message saying 'There was an error when dealing with your request. See the error console for more details'. However, there's no further indication of what the error is, and no clues about where the error console is or how one might view it.

After dismissing the error message, it looks as though everything has worked as it should: the field just selected as the new primary key is in bold.

However, if you save changes, exit the schema designer, and re-open it, it becomes plain that there is a problem. The field name is no longer in bold - so the table no longer has a primary key.

This problem can be avoided by putting something in the 'Name' field when adding the new primary key: if that's done, the error message doesn't appear, and the primary key stays in place after exiting and re-entering the schema designer. However, it's far from obvious that this is what you need to do, and the current error message is not at all helpful.

There are two possible solutions to this that I can see:

  1. The ORDS supplies a name for the key automatically, so the user doesn't have to type anything in. This would be my preferred option if it's possible: it's not at all clear why keys need a name anyway, or what purpose is served by giving them one. If this could all be handled without the user having to worry about it, that would smooth this process. (ORDS seems to manage to generate names for primary keys under other circumstances - it's only when an existing key is changed that it becomes an issue.)
  2. Alternatively, if the user clicks 'OK' without supplying a key name, they get a warning message explaining what the problem is, and can't close the dialogue box without adding a name (or, I suppose, cancelling the whole operation). I am happy to write this warning message if I'm given access to it.
MerielP commented 8 years ago

One additional thing I've just noticed: ORDS seems to be editing the primary key name after one has saved it (I called a primary key 'Places', but when I went back into the Keys dialogue box, it had become 'Places_2'). This doesn't matter particularly from the user's perspective, but if ORDS is just going to change what I put in that field anyway, I don't see why it can't complete it without needing me to type something there!