Page 1 of 1
User warning message, when Integrity constraint violated
Posted: Mon Jun 28, 2021 12:24 pm
by slobodan
After click on save button on the form, on nuDebug Results appears message: SQLSTATE[23000]: Integrity constraint violation . . .
It is correct and expected, but I would like to show some popup message to user, to warn him about his mistake. Is there some elegant way to do that, because I cann't find any event which I can use.
Re: User warning message, when Integrity constraint violated
Posted: Mon Jun 28, 2021 1:15 pm
by kev1n
Remove the constraints, they do not work with nuBuilder.
Re: User warning message, when Integrity constraint violated
Posted: Mon Jun 28, 2021 1:39 pm
by slobodan
I guess, mysql database error is not the source of any nuBuilder form event? Except it appears in zzzzsys_debug table.
Re: User warning message, when Integrity constraint violated
Posted: Tue Jun 29, 2021 8:55 am
by kev1n
If there are any constraints on the table, please remove them or you will keep getting these Integrity constraint violations.
Re: User warning message, when Integrity constraint violated
Posted: Wed Jun 30, 2021 5:10 pm
by slobodan
I could do my best to delete the resulting messages in zzzzsys_debug table, but it would be in vain, if there are other, perhaps more important reasons why there should be no constraints in the database.
Re: User warning message, when Integrity constraint violated
Posted: Thu Jul 01, 2021 10:48 am
by kev1n
My question is if these constraints are required or if you could simply get rid of them.
Re: User warning message, when Integrity constraint violated
Posted: Thu Jul 01, 2021 9:11 pm
by slobodan
In this particular case, disabling the database constraints requires writing additional php code for validation in BS. In general, the use of database constraints is often the most elegant and secure way to control data entry. For that reason, it seems a great sacrifice not to use it.