This thread is resolved. Here is a description of the problem and solution.
Problem: The client is encountering a database error indicating a duplicate entry '0' for the primary key when trying to save a translation. This error suggests that AUTO INCREMENT may be deactivated on the database table.
Solution: 1. Check the
icl_translation_status
table in the database to ensure that AUTO INCREMENT is enabled. 2. If AUTO INCREMENT is not enabled, it needs to be activated. This may also require checking other WordPress tables like
wp_options
,
wp_posts
, and
wp_users
to ensure they have AUTO INCREMENT enabled where necessary. 3. If there is an entry with '0' in a table where you are trying to enable AUTO INCREMENT, you must remove that entry before you can enable AUTO INCREMENT. 4. Always ensure you have a recent and working backup before making any changes to the database.
Please note that this solution might not be relevant if it's outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO `wp_icl_translation_status` (`translation_id`, `status`, `translator_id`, `needs_update`, `md5`, `translation_service`, `translation_package`) VALUES ('4073', '10', '23', '',
Is pointing to a duplicate entry of '0' in the database.
This means most likely that AUTO INCREMENT is deactivated.
1. Go to icl_translation_status table in your database and review the structure.
2. Do you see AUTO INCREMENT enabled?
Additionally, I recommend reviewing standard WP tables such as wp_options , wp_posts, wp_users, etc. as well to verify that AUTO INCREMENT is enabled. (not all tables need it enabled)
Important Note: If an entry with 0 exists in a database table that you are trying to enable AUTO INCREMENT, you wont be able to enable it until the 0 entry is removed.
NOTE: Always have a recent and working backup before making any changes recommended by our team or a 3rd party
The reason this would happen would be database corruption. Migrations are sometimes a known cause of this.