Welcome to the nuBuilder Forums!

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

nuSetNuDataValue in Before Save Topic is solved

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
vario
Posts: 144
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

nuSetNuDataValue in Before Save

Unread post by vario »

Hi,

I have been using this method but a recent update has stopped this from working. The code I have in Before Save is

Code: Select all

$nuMainForm = nuHash()['nuFORMdata'][0]->id;
nuSetNuDataValue($nudata, $nuMainForm, 'pri_confirmation_sent', date('Y-m-d H:i:s'));
And I get this in my logs on the server:

Code: Select all

[Tue Jul 09 10:35:46.385245 2024] [php:warn] [pid 3566:tid 3566] [client fe80::16e3:41ab:511b:16e2%eno2:50406] PHP Warning:  foreach() argument must be of type array|object, null given in /var/www/forte/core/nudata.php on line 689, referer: https://nubuilder/index.php
The date field remains NULL in the database whereas until recently it was updated successfully.

Neil.
kev1n
nuBuilder Team
Posts: 4242
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 68 times
Been thanked: 422 times
Contact:

Re: nuSetNuDataValue in Before Save

Unread post by kev1n »

Try this updated fix (nucommon.php) which was commited a few weeks ago.
vario
Posts: 144
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: nuSetNuDataValue in Before Save

Unread post by vario »

Working again! Thanks for your quick reply.

Neil.
Sasquatch
Posts: 11
Joined: Sat Mar 13, 2021 11:00 pm
Has thanked: 1 time

Re: nuSetNuDataValue in Before Save

Unread post by Sasquatch »

kev1n wrote: Tue Jul 09, 2024 12:55 pm Try this updated fix (nucommon.php) which was commited a few weeks ago.
Thank you very much, i wasted hours trying to get nuSetNuDataValue to work before coming here.

now just figure out how to check if data was changed and i'm done with logging who changed data
Post Reply