Welcome to the nuBuilder forums!

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

$nuHash in BeforeSave

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

$nuHash in BeforeSave

Unread post by OLMGBG »

Hi all,
I'm experiencing nubuilderpro and I've got some issues with $nuHash while writing some validation code in BeforeSave section.
All I can see is that the array obtained from nuSubFormArray() seems to be empty... can't see what I'm doing wrong, hope you'll help....
I have a form named 'rf_user' in which I have a sub form 'ev_temps_subform'. the first column is a field names 'F_USERID'
the code :
$arr = nuSubformArray('ev_temps_subform');
for ($idx = 0 ; $idx < count($arr)-1 ;$idx++){
$v .= $idx+1 .' ' .$arr[$idx];
}
nuDisplayError('Tableau Element : '.$v.'---');
return;

gives this :
1 : 1 ev_temps_subform0001 2 ev_temps_subform0002....
the number of items seems to fit the number of lines of my subform.
but when I try to get one of the values with a code like this :
$arr = nuSubformArray('ev_temps_subform');
for ($idx = 0 ; $idx < count($arr)-1 ;$idx++){
$v1 .= $nuHash['ev_temp_subform0001F_USERID'];
// tried all the syntaxes I found evrywhere like $nuHash[$arr.idx.'F_USERID'] or $nuHash[$arr[idx]].'F_USERID] ....
}
nuDisplayError('Tableau Element : '.$v1.'---');
return;
I get something like that :
Tableau Element : ---

(Wampserver installation)
Thanks,
OLM.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: $nuHash in BeforeSave

Unread post by admin »

OLM,

There was a bug but its fixed as of today.

So you can do a pull from github.

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

Re: $nuHash in BeforeSave

Unread post by OLMGBG »

Thanks for your quick reply...
I've never been to Github, using this link to install...: https://www.nubuilder.net/downloads.php
Have you already written a sort of tuto to get updated files from Github ?
Have a nice day too.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: $nuHash in BeforeSave

Unread post by admin »

OLMGBG,

Does this help you?

https://www.nubuilder.net/downloads.php

Steven
Post Reply