Page 1 of 1

nuSetNuDataValue in Before Save

Posted: Tue Jul 09, 2024 12:38 pm
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.

Re: nuSetNuDataValue in Before Save

Posted: Tue Jul 09, 2024 12:55 pm
by kev1n
Try this updated fix (nucommon.php) which was commited a few weeks ago.

Re: nuSetNuDataValue in Before Save

Posted: Tue Jul 09, 2024 1:10 pm
by vario
Working again! Thanks for your quick reply.

Neil.

Re: nuSetNuDataValue in Before Save

Posted: Mon Dec 02, 2024 12:37 pm
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