Page 1 of 1

User warning message, when Integrity constraint violated

Unread postPosted: Mon Jun 28, 2021 7:54 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

Unread postPosted: Mon Jun 28, 2021 8:45 pm
by kev1n
Remove the constraints, they do not work with nuBuilder.

Re: User warning message, when Integrity constraint violated

Unread postPosted: Mon Jun 28, 2021 9:09 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

Unread postPosted: Tue Jun 29, 2021 4:25 pm
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

Unread postPosted: Thu Jul 01, 2021 12:40 am
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

Unread postPosted: Thu Jul 01, 2021 6:18 pm
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

Unread postPosted: Fri Jul 02, 2021 4:41 am
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.