Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Insert Error

Questions related to using nuBuilder Forte.
Post Reply
vario
Posts: 154
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 2 times
Been thanked: 1 time

Insert Error

Unread post by vario »

I have a subform which only adds one row at a time. If I add two rows then "Save" I get this entry in zzzzsys_debug and only the first row is saved:

Code: Select all

2021-05-13 12:07:26 - SQL Error in <b>nuRunQuery</b>

<br>

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

globeadmin

===PDO MESSAGE=== 

SQLSTATE[42000]: Syntax error or access violation: 1110 Column 'calendar_nulog' specified twice

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

INSERT INTO calendar  (calendar_id, `cal_employee_id`, `calendar_nulog`, `cal_type`, `cal_start`, `cal_end`, `cal_taken`, `cal_paid`, `cal_note`, `calendar_nulog`)  VALUES ('609d086ed1acf5f', 'c4ed0b75996ce3', '', 'XX', '2021-05-12', '2021-05-12', '', '', '', '{\"added\":{\"user\":\"globeadmin\",\"time\":1620904046}}');

===BACK TRACE====

/var/www/forte/core/nudata.php - line 420 (nuRunQuery)

/var/www/forte/core/nuapi.php - line 68 (nuUpdateDatabase)
The table does not have a calendar_nulog column in third position, so not sure where that's coming from. I have added the calendar_nulog column to the subform in order to show details as per https://github.com/nuBuilder/nuBuilder- ... g_activity so perhaps that has some bearing on this?

Neil.
Last edited by vario on Thu May 13, 2021 1:30 pm, edited 2 times in total.
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Insert Error

Unread post by kev1n »

vario
Posts: 154
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 2 times
Been thanked: 1 time

Re: Insert Error

Unread post by vario »

No, tried that but same result. It also has the effect of preventing the tooltip showing nulog details (I used nuSetTooltip rather than NuMessage for showing details)
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Insert Error

Unread post by kev1n »

Try replacing this line in nudata.php

Code: Select all

if($idx !== false){
with this

Code: Select all

if($idx !== false && ! ($log && substr($fields[$R],-strlen("_nulog"))=== "_nulog")){		//-- valid field names and not nulog column
vario
Posts: 154
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 2 times
Been thanked: 1 time

Re: Insert Error

Unread post by vario »

Working now thanks - the nulog column is still defined as "Input".
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Insert Error

Unread post by kev1n »

This fix is on GIthub now.
Post Reply