I am facing a problem submitting multiple items via a subform. I did search the forum but nothing came up regarding this particular issue (could also be lack of caffeine)...
If I add one item (child) and save the main form, the item is properly saved. If I add 2 (or more) items like shown below and save, only the 1st one goes through and I get a MySQL error for the rest (error is shown below for better readability). The picture below shows the form and subform I am using. Please disregard the fact I am always using the same value for column 1, this is allowed. I was able to trace the problem to the automatic generation of the INSERTS by nuBuilder, because for the 1st item the query is
Code: Select all
INSERT INTO provas_historico (`prvh_prova_id`, `prvh_arbitro_id`) VALUES ('1', '3')
Code: Select all
INSERT INTO provas_historico (`prvh_prova_id`, `prvh_arbitro_id`, `prvh_funcao_id`, `prvh_funcaosecundaria_id`, `prvh_disponibilidade`, `prvh_confirmado`, `prvh_nomeado`) VALUES ('1', '3', '', '', '0', '0', '0')
Anyway, would anyone know if this behaviour is expected from nuBuilder (different INSERT statements for the 1st and subsequent children) or have I completely misconfigured my subform?
The logged error was
Code: Select all
[0] :
===USER==========
globeadmin
===PDO MESSAGE===
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'prvh_funcao_id' at row 1
===SQL===========
INSERT INTO provas_historico (`prvh_prova_id`, `prvh_arbitro_id`, `prvh_funcao_id`, `prvh_funcaosecundaria_id`, `prvh_disponibilidade`, `prvh_confirmado`, `prvh_nomeado`) VALUES ('1', '3', '', '', '0', '0', '0');
===BACK TRACE====
/var/www/html/cacftp-nu/core/nudata.php - line 422 (nuRunQuery)
/var/www/html/cacftp-nu/core/nuapi.php - line 85 (nuUpdateDatabase)