Partial fix Duplicate entry '1-Search' for key 'language_id_title' - unistalling / installing plug-ins

tenants

Well-known member
Errors after installing and uninstalling a plug-in

This was a vanilla production database (3 weeks old, no custom installs, and I had only ever installed one plug in and then uninstalled it)

The error I get from the server logs is:
Mysqli statement execute error : Duplicate entry '1-Search' for key 'language_id_title'

I've searched the information schema, and found
SELECT * FROM 'KEY_COLUMN_USAGE'
WHERE 'CONSTRAINT_NAME' = 'language_id_title'

Returned 2 columns on the same table:

table : Column
xf_phrase_map : language_id
xf_phrase_map : title

But this table is empty

I'm not sure whats going on here yet.. any ideas? It sounds like its trying to insert "1-Search" twice, I cant see why yet..

Some info from looking in the DB, possible reasons????

1. in the table xf_admin_template_phrase
I have 2 rows with the value "search"
id 834 and id 1076, could either of these be causing this?
 
I think I'm getting close to finding my issue.

When I look at my phrases, it looks blank. When I try to create a new language, I get the error above.

What I am guessing has happend is that I've renamed a template to "search" which was already existing => bang

edit, yup I found these two lines in the xf_phrase table:

21512 0 search Search 0 XenForo 1000015 1.0.0 Alpha 5
22998 1 Search Search 0 XenForo 1000470 1.0.4

(somehow a duplicate has been allowed in since its a lower case)
 
Solution,

I edited the 2nd line (Search Search , and changed it to 2Search Search), this allowed me into the ACP phrase area. I could then revert any changes I had made to my phrases...

Well, I hope this helps someone?

(don't change the phrases into lower/upper case versions of their selves, this results in a duplicate value for the language_id_title index later down the line)
 
While it's still possible for this to happen, I have a simple workaround that should make it much easier to prevent. If someone wants to trigger this via a hand rolled XML file they probably can, but I don't think it should come up.
 
Top Bottom