Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

User warning message, when Integrity constraint violated

Questions related to using nuBuilder Forte.
Post Reply
slobodan
Posts: 25
Joined: Sat May 08, 2021 1:20 pm

User warning message, when Integrity constraint violated

Unread post 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.
kev1n
nuBuilder Team
Posts: 4302
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: User warning message, when Integrity constraint violated

Unread post by kev1n »

Remove the constraints, they do not work with nuBuilder.
slobodan
Posts: 25
Joined: Sat May 08, 2021 1:20 pm

Re: User warning message, when Integrity constraint violated

Unread post by slobodan »

I guess, mysql database error is not the source of any nuBuilder form event? Except it appears in zzzzsys_debug table.
kev1n
nuBuilder Team
Posts: 4302
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: User warning message, when Integrity constraint violated

Unread post by kev1n »

If there are any constraints on the table, please remove them or you will keep getting these Integrity constraint violations.
slobodan
Posts: 25
Joined: Sat May 08, 2021 1:20 pm

Re: User warning message, when Integrity constraint violated

Unread post 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.
kev1n
nuBuilder Team
Posts: 4302
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: User warning message, when Integrity constraint violated

Unread post by kev1n »

My question is if these constraints are required or if you could simply get rid of them.
slobodan
Posts: 25
Joined: Sat May 08, 2021 1:20 pm

Re: User warning message, when Integrity constraint violated

Unread post 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.
Post Reply