[Helma-user] app.registerUser() - Column 'USER_EMAIL' cannot benull
Andreas Schuh
andreas.schuh at itac.at
Thu Nov 30 12:26:28 CET 2006
the following code works with helma 1.4.2, but doesn't with 1.5.3
if(regexCheckFields(req.data))
{
//CHECKS OK, NO ERRORS
//NOW CHECK IF USER EXISTS
var newUser = app.registerUser(req.data.nick.toLowerCase(),
generatePassword());
if(newUser)
{
newUser.USER_COLOR = correctRegexColor(req.data.usercolor);
newUser.USER_SHORTDESCRIPTION =
correctRegexSHD(req.data.shortdescription);
newUser.USER_EMAIL = correctRegexEMail(req.data.email);
newUser.USER_REALNICK = req.data.nick;
newUser.USER_RIGHT = "1";
newUser.USER_FIRSTNAME =
correctRegexFN(req.data.firstname);
newUser.USER_LASTNAME =
correctRegexLN(req.data.lastname);
newUser.USER_ADDRESS =
correctRegexADR(req.data.address);
newUser.USER_ZIP = correctRegexZIP(req.data.zip);
[usw..]
}
}
else
{
[Errorhandling]
}
andi
2006/11/30, Andreas Schuh <andreas.schuh at itac.at>:
>
> app.registerUser(String user, String pass)
>
> creates this error
>
> Error in application helmaapp
> Column 'USER_ANYNOTNULLPROPERTY' cannot be null
>
> are "not null" columns not longer supported by app.registerUser() ?
>
app.registerUser() returns a user object (or null). If a property in
the user prototype is mapped to a "not null" column in the db, and you
didn't assign it a value before the data is committed, that Helma is
correct and the problem is in your application. If you did assign a
value to the property in question than this is a Helma bug.
Hannes
More information about the Helma-user
mailing list