DB Save doesn't work fine

ChronoForms DB Save action incorrectly performs an UPDATE instead of an INSERT.

Overview

The issue occurs when a form data parameter shares the same name as the database table's primary key, causing CF to treat submissions as updates.
To resolve, rename the primary key in the database table to avoid conflict with any form field names.

Answered
Hi,
I'm using Chronoforms V5 with joomla 2.5.18. I have a form that writes into database, but action "DB Save" works fine only during "Test Form" and not in site navigation.
Using this code:
<?php
pr(\GCore\Models\MODEL_NAME::getInstance()->dbo->log);
?>

I noticed that queries are not equal in two versions. In the first case there is an INSERT query, in the latter, it's UPDATE query...
Can you help me?
Max_admin Max_admin 16 Feb, 2014
Answer
Hello,

Was the table created using Chronoforms or some way else ?

What's the table's primary key ?

Please add a "debugger" action before "db save", please post the debug info here.

And UPDATE will be used if there is a data param with the same name of the primary key.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hello Max,
thanks for your quick answer.

As you said, a data param had the same name of the primary key.
I have solved changing primary key name.

Thanks a lot!
This topic is locked and no more replies can be posted.