User tests: Successful: Unsuccessful:
Under some circumstances the "User selector" implicitly assumes that "no selection" means "user id = 0", which is a valid value to be saved in the database.
This brings to paradoxes, for example you can inserts records with user id = 0 even when the "user id" is a required filed.
For example: Go to User > User Notes and create a new note. There is no user selected, but it is a required field, as shown by the asterisk. Fill out "Subject" and "Note", but leave empty the user. Press the "Save & Close" button. You have just created a user note which is not associated to any user.
This is caused by an useless type cast to int, which turns invalid values like an empty string to 0 which is a valid id.
Under different circumstances the id is handled correctly simply by avoiding the type cast to int. For example, repeat the steps above, but before saving the record, press the user selection button. Once in the users list clear the selection by pressing the button "- No User -". This time the record won't be saved and a the message "Field required: User ID" will be displayed.
Title |
|
Title |
|
||||||
Status | New | ⇒ | Closed | ||||
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-04-15 21:44:41 | ||||
Labels |
Added:
?
?
|
Pull requests to the master branch of this repo are not accepted. Please close this pull request and submit a new one against the staging branch.
This is an automated message from the J!Tracker Application.