Through the combination of backups and restores of quizzes and courses it is possible to get into a state where get_records_sql_menu throws a warning:
Did you remember to make the first column something unique in your call to get_records? Duplicate value 'demo.moodle.net+190423142302+7IOe3D demo.moodle.net+190423142302+I9Nqep' found in column 'concat(stamp, ' ', version)'.
Reproduced on Moodle Sandbox site:
I am wondering if restore_create_categories_and_questions::process_question() here should be generating a new stamp and version via make_unique_id_code() since at that point we know that the question is a new one?