Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Form Breadcrum and nuDisplayError

Post Reply
OLMGBG
Posts: 7
Joined: Sat Feb 14, 2015 3:41 pm

Form Breadcrum and nuDisplayError

Unread post by OLMGBG »

Hi,
I've experienced something new I don't understand at all :
I've a form in which I've a breadcrum, something like this :
SELECT 'Form no. : #RECORD_ID#'
I've written some code in the Before Save section,
......
// Si type = Projet, il faut un code projet
if ($nuHash[$arr[$idx].'F_TYPE'] == 'Projet'){
if ($nuHash[$arr[$idx].'F_PROJ'] == '') {
$Message .= 'Code Nature manquant ligne '.$idx.' ';
}
}
}
// Si on a une erreur ...
if ($Message != ''){
nuDisplayError($Message);
return;
}
....
While executing I get a message like Json parse failed.
Just adding a comment mark // before the nuDisplayError instruction prevents the Json message from coming (and of course my error message), deleting the BreadCrum and restoring the nuDisplayError also prevent the Json message from displaying, I get my error messag :)

I get the following lines in the php_error.log :

[24-Feb-2015 16:33:46 Europe/Paris] PHP Warning: Invalid argument supplied for foreach() in C:\wamp25\www\TMS\nuapi.php on line 1534
[24-Feb-2015 16:33:46 Europe/Paris] PHP Stack trace:
[24-Feb-2015 16:33:46 Europe/Paris] PHP 1. {main}() C:\wamp25\www\TMS\nuapi.php:0
[24-Feb-2015 16:33:46 Europe/Paris] PHP 2. nuGetEditForm() C:\wamp25\www\TMS\nuapi.php:140
[24-Feb-2015 16:33:46 Europe/Paris] PHP 3. nuGetBreadcrumb() C:\wamp25\www\TMS\nuapi.php:1491

Hope it'll help you.

Kind Regards,
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Form Breadcrum and nuDisplayError

Unread post by admin »

OLMGBG,

I don't understand what you are saying.

Steven
OLMGBG
Posts: 7
Joined: Sat Feb 14, 2015 3:41 pm

Re: Form Breadcrum and nuDisplayError

Unread post by OLMGBG »

Sorry for my English.... obviously not as good as i was expecting !
Il seems to be clear, when I have both a breadcrum and a nuDisplayError in the BeforeSave, (in the same form), I get the error message. Having just one on them prevents the error message from coming.
But if not clear enough tell me what you are misunderstanding.... if too complex never mind forget it I will work around, leaving the breadcrum.
Regards,
OM
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Form Breadcrum and nuDisplayError

Unread post by admin »

OM,

There is nothing wrong with your English, it is good but now you say..
when I have both a breadcrum and a nuDisplayError in the BeforeSave
I understand nuDisplayError is a function that can be used in Before Save, but breadcrum is not.

This is what I don't understand. Sorry.

Steven
OLMGBG
Posts: 7
Joined: Sat Feb 14, 2015 3:41 pm

Re: Form Breadcrum and nuDisplayError

Unread post by OLMGBG »

Sorry I wasn't perfectly clear too.
the Breadcrum I was talking about is in the "All" tab of my form.
whatever I'm filling in the breadcrum cell causes the error message to raise when at the same time I've a nyDisplayError statement in the BeforeSave...
I know it's obviously bizarre.
Having this problem I've stopped using breadcrums.

Kind regards,
OLM
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Form Breadcrum and nuDisplayError

Unread post by admin »

I still don't understand, maybe attach a screen shot.

Steven
lbug7575
Posts: 1
Joined: Tue Apr 07, 2015 8:13 am

Re: Form Breadcrum and nuDisplayError

Unread post by lbug7575 »

I want to perform data validation and only allow unique combinations of two values in a table to be saved. I can achieve this in mysql by both setting a primary key on these two columns (Col1,col2) and add a unique index (col 1, col2). But then Nubuilder just stalls when Save is clicked. I know that NuBuilder can't use the db constraints but has to use its own validation/joins.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Form Breadcrum and nuDisplayError

Unread post by admin »

lbug7575,

If nuBuilder "stalls" you probably have a bug in your code.

Steven
Post Reply