Cannot reproduce Error during translation

cimad

Member
Affected version
Relase candidate 3
Hi, this error has appeared during the translation of phrases. It has only appeared once.

Code:
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry 'super_admin_user_ids_vbulletin_explain-2' for key 'title' src/XF/Db/AbstractStatement.php:212
Generated by: admin Nov 22, 2017 at 10:10 PM

Stack trace
INSERT  INTO xf_phrase (`addon_id`, `language_id`, `title`, `phrase_text`, `global_cache`, `version_id`, `version_string`, `phrase_id`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(174): XF\Db\AbstractStatement->getException('MySQL query err...', 1062, '23000')
#1 src/XF/Db/Mysqli/Statement.php(69): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1062, '23000')
#2 src/XF/Db/AbstractAdapter.php(69): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(145): XF\Db\AbstractAdapter->query('INSERT  INTO xf...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1381): XF\Db\AbstractAdapter->insert('xf_phrase', Array)
#5 src/XF/Mvc/Entity/Entity.php(1113): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Mvc/FormAction.php(69): XF\Mvc\Entity\Entity->save(true, false)
#7 src/XF/Mvc/FormAction.php(159): XF\Mvc\FormAction->XF\Mvc\{closure}(Object(XF\Mvc\FormAction))
#8 src/XF/Admin/Controller/Phrase.php(205): XF\Mvc\FormAction->run()
#9 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\Phrase->actionTranslate(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Phrase', 'Translate', 'json', Object(XF\Mvc\ParameterBag), 'phrases', Object(XF\Admin\Controller\Phrase), NULL)
#11 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#12 src/XF/App.php(1863): XF\Mvc\Dispatcher->run()
#13 src/XF.php(328): XF\App->run()
#14 admin.php(13): XF::runApp('XF\\Admin\\App')
#15 {main}

Request state
array(4) {
  ["url"] => string(77) "/test/admin.php?phrases/super_admin_user_ids_vbulletin_explain.27704/translate"
  ["referrer"] => string(55) "https://www.*****.com/test/admin.php?phrases/search"
  ["_GET"] => array(1) {
    ["phrases/super_admin_user_ids_vbulletin_explain_27704/translate"] => string(0) ""
  }
  ["_POST"] => array(9) {
    ["title"] => string(38) "super_admin_user_ids_vbulletin_explain"
    ["phrase_text"] => string(211) "If you have <b>super administrators</b> defined in your vBulletin <code>config.php</code> file, enter the value from the file here. It will take the form of a single user ID, or a list of IDs separated by commas."
    ["language_id"] => string(1) "2"
    ["addon_id"] => string(2) "XF"
    ["global_cache"] => string(0) ""
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(29) "/test/admin.php?phrases/search"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

Regards
 
I've had a few goes at trying to reproduce this and I haven't been able to thus far. I've tried doing things to trick it like deliberately submitting more than once, even going as far as disabling our system which disables the submit button. I've opened the list of untranslated phrases to translate, modified the phrase in a new tab, and then tried to translate again in the first tab and nothing.

Basically all sorts of weird and wonderful things and I haven't seen this happen. All in all the code should handle this (and it seems to).

If it happens again, let us know.
 
Back
Top Bottom