Page 1 of 1

subform not saving

Posted: Wed Oct 28, 2020 12:20 pm
by johan
Hi

i'm having a problem saving multiple rows in a subform when the ver_reden field is empty. This field is a select (integer, null). If I enter 1 row with field ver_reden empty, then it will save correctly.
If I enter a value for multiple rows ver_reden, everything will run correctly.
I'll add the result of nuDebug.

Code: Select all

[0] : 
===USER==========

globeadmin

===PDO MESSAGE=== 

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `reg_straathoekwerk`.`verwijzen`.`ver_reden` at row 1

===SQL=========== 

INSERT INTO verwijzen         (ver_id, `ver_reg_id`, `ver_datum`, `ver_type`, `ver_naar`, `ver_resultaat`, `ver_reden`, `verwijzen_nulog`)  VALUES ('5f9951581a8aaf6', '5afec6e2c0dca7a', '2020-10-28', '1034', '1109', '892', '', '{\"added\":{\"user\":\"5afc707a8d5eca0\",\"time\":1603883352}}');

===BACK TRACE====

/var/www/html/straathoekwerk/nudata.php - line 320 (nuRunQuery)

/var/www/html/straathoekwerk/nuapi.php - line 50 (nuUpdateDatabase)
Any idea?

Johan

Re: subform not saving

Posted: Wed Oct 28, 2020 2:34 pm
by kev1n
Hi Johan,

Is this due to the strict mode? (-> this is a bug and should be fixed )

https://forums.nubuilder.cloud/viewtopic. ... ict#p22115

Re: subform not saving

Posted: Wed Nov 04, 2020 4:48 pm
by johan
Kev1n

I've tested this. If I understand it correct I have to run this code to solve this problem.

Code: Select all

ALTER TABLE `zzzzsys_object` CHANGE `sob_input_count` `sob_input_count` BIGINT(20) NULL DEFAULT '0';
ALTER TABLE `zzzzsys_object` CHANGE `sob_all_order` `sob_all_order` INT(11) NULL DEFAULT '0';
After this I still have the same problem.

Johan

Re: subform not saving

Posted: Wed Nov 04, 2020 6:59 pm
by Janusz
Hi,
The code

Code: Select all

ALTER TABLE `zzzzsys_object` CHANGE `sob_input_count` `sob_input_count` BIGINT(20) NULL DEFAULT '0';
ALTER TABLE `zzzzsys_object` CHANGE `sob_all_order` `sob_all_order` INT(11) NULL DEFAULT '0';
is related to the clone of objects and its not relevant to your case.

from error message - what I can see - you try to assign:

Code: Select all

ver_reden=''
whereas this field can be integer or null.

And if it's for select object you can assign varchar() in the DB and should solve the issue

Re: subform not saving

Posted: Fri Nov 06, 2020 2:33 am
by admin
Guys,

It should be fixed now, thanks.


Steven

Re: subform not saving

Posted: Fri Nov 06, 2020 5:46 am
by johan
Hi
I've changed column to varchar and that solved my problem.

Thanks for your help.
Johan

Re: subform not saving

Posted: Sat Nov 07, 2020 12:55 am
by admin
No worries.