[SOLVED] Fabrik is creating rowid with '0' value

I have a list with several groups, many of which are repeatable. All was working well, but recently I've been unable to update any existing records with new data and I'm getting the error message: Duplicate entry '0' for key 'PRIMARY'.

On investigating the database, I can see that in one of the repeat groups, a new row has been created with the row id of '0'. If I delete this row and try to add another record in the same group, another row is created with the rowid '0' and I cannot add any further information as I get the above error message. Clearly Fabrik is trying to create a new row without incrementing the id. However, the list data is set to auto increment and I can't find any settings for auto incrementing a particular group.

I've checked and this happens with only one of the groups. This is very strange as I have another group which is almost identical, but new records are created with an incremental rowid, as they should. The problem group has only four fields: id, parent id, a field element and a databasejoin element. The working group is the same, even the databasejoin is to the same list.

I've compared all the settings in these two groups and they are exactly the same. As this is a test site, and was working until recently, I can only guess that it's due to some new element I've added then deleted which may have - somehow - corrupted the code? I can't trace exactly when this started happening or what might have caused it.

Checking through the forum I can find one other reference to the error message, where the suspect was the list joins. But I've checked my list joins and they are all exactly the same.

Has anyone seen this behaviour before?
 
Check directly in your database:
repeat groups are in a DB table
your-main-table_groupID_repeat
The id element of this table must be the PRIMARY_KEY set to AUTO_INCREMENT (but no idea how this can vanish)
 
Thanks so much @troester. You've saved me again!

It was set to PRIMARY_KEY but not AUTO_INCREMENT. Changed it in the database and now it works perfectly.
How utterly weird that it vanished!
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top