User warning message, when Integrity constraint violated

Questions related to using nuBuilder Forte.

User warning message, when Integrity constraint violated

Unread postby slobodan » Mon Jun 28, 2021 7:54 pm

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.
slobodan
 
Posts: 21
Joined: Sat May 08, 2021 8:50 pm
nuBuilder Version: 4.5

Re: User warning message, when Integrity constraint violated

Unread postby kev1n » Mon Jun 28, 2021 8:45 pm

Remove the constraints, they do not work with nuBuilder.
kev1n
nuBuilder Team
 
Posts: 2050
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: User warning message, when Integrity constraint violated

Unread postby slobodan » Mon Jun 28, 2021 9:09 pm

I guess, mysql database error is not the source of any nubuilder form event? Except it appears in zzzzsys_debug table.
slobodan
 
Posts: 21
Joined: Sat May 08, 2021 8:50 pm
nuBuilder Version: 4.5

Re: User warning message, when Integrity constraint violated

Unread postby kev1n » Tue Jun 29, 2021 4:25 pm

If there are any constraints on the table, please remove them or you will keep getting these Integrity constraint violations.
kev1n
nuBuilder Team
 
Posts: 2050
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: User warning message, when Integrity constraint violated

Unread postby slobodan » Thu Jul 01, 2021 12:40 am

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.
slobodan
 
Posts: 21
Joined: Sat May 08, 2021 8:50 pm
nuBuilder Version: 4.5

Re: User warning message, when Integrity constraint violated

Unread postby kev1n » Thu Jul 01, 2021 6:18 pm

My question is if these constraints are required or if you could simply get rid of them.
kev1n
nuBuilder Team
 
Posts: 2050
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: User warning message, when Integrity constraint violated

Unread postby slobodan » Fri Jul 02, 2021 4:41 am

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.
slobodan
 
Posts: 21
Joined: Sat May 08, 2021 8:50 pm
nuBuilder Version: 4.5


Return to General

Who is online

Users browsing this forum: No registered users and 10 guests

cron