Duplicate entry '0' for key 'PRIMARY'

boyjah

Member
I have a form that, until recently, worked fine. Now, when filling out the form for the first time, the following error is generated:

Duplicate entry '0' for key 'PRIMARY'

Fabrik and all plugins are version 3.9.2
Joomla is version 3.9.22

All lists associated with the form are set to Primary Key = id and Auto increment = Yes
Data tables in phpMyAdmin show id as primary key and AUTO_INCREMENT is active

I have read through all forum posts about this issue but nothing has helped me to solve the problem.

Please tell me how I can solve this problem as it is the last issue before I can launch my new site.
 
Enable Joomla system debug and set error reporting to max.
Does this give more informations?

Did you update recently (Joomla, php version, MySQL version...)?

Google shows a lot of entries for this error related to Joomla (not Fabrik).
Is your "Database Setting" (Joomla config) set to MySQLi?
Does e.g. #_update_sites has PK = autoincrement?
 
I think I have identified the problem but I don't know how to fix it. It is being generated by a database join between a fabrik table and Community Builder comprofiler table. When I add data to the table y2vfp_fab_hosts it is creating an empty row in y2vfp_comprofiler where id = 0

I don't want this join to create a new item in y2vfp_comprofiler. The join is simply so I can pull data from the y2vfp_comprofiler table.
Screen Shot 2020-10-26 at 12.43.10.png
 
Not exactly sure why it works, but I think I may have fixed this issue. For the join, I changed the To column from "user_id" to "id" (which in the case of y2vfp_comprofiler, "user_id" and "id" are the same number). It no longer generates the Duplicate entry '0' for key 'PRIMARY' error and it no longer creates a new blank field in y2vfp_comprofiler. It would be interesting to know why this change would make a difference (maybe because "id" is the PK for y2vfp_comprofiler?). But for now, 2 weeks of endless experimentation and brain scratching appear to have come to an end! Now, just wait for the "Oh, I spoke too soon" follow up message...

;-)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top