Steps to Reproduce:
Install the https://www.mediawiki.org/wiki/Manual:Grabbers#PHP_scripts and a blank local MW1.31 installation. Run the scripts to grab text, files, logs or other content. Run php maintenance/populateUserTable.php to generate the "stub" user entries reserving any names that belonged to users on the original wiki.
Take a look at the user table ( SELECT * FROM `user` ) in SQL; the `user`.`user_touched` field will contain 0 (which is not a valid date, unless you were born in a manger in Bethlehem).
Any of the related extensions which attempt to update these records will throw errors because of the bogus zero (0) date.
Actual Results:
MWException from line 4158 of ...//includes/user/User.php: CAS update failed on user_touched for user ID '0000' (read from master); the version of the user to be saved is older than the current version.
Backtrace:
#0 [internal function]: User->{closure}(Wikimedia\Rdbms\DatabaseMysqli, string)
#1 ...//includes/libs/rdbms/database/Database.php(3664): call_user_func_array(Closure, array)
#2 ...//includes/user/User.php(4172): Wikimedia\Rdbms\Database->doAtomicSection(string, Closure)
#3 ...//extensions/StubUserWikiAuth/includes/StubUserWikiPasswordAuthenticationProvider.php(179): User->saveSettings()
#4 ...//includes/auth/AuthManager.php(453): StubUserWikiAuth\StubUserWikiPasswordAuthenticationProvider->beginPrimaryAuthentication(array)
#5 ...//includes/auth/AuthManager.php(383): MediaWiki\Auth\AuthManager->continueAuthentication(array)
#6 ...//includes/specialpage/AuthManagerSpecialPage.php(353): MediaWiki\Auth\AuthManager->beginAuthentication(array, string)
#7 ...//includes/specialpage/AuthManagerSpecialPage.php(482): AuthManagerSpecialPage->performAuthenticationStep(string, array)
#8 ...//includes/htmlform/HTMLForm.php(660): AuthManagerSpecialPage->handleFormSubmit(array, VFormHTMLForm)
#9 ...//includes/specialpage/AuthManagerSpecialPage.php(416): HTMLForm->trySubmit()
#10 ...//includes/specialpage/LoginSignupSpecialPage.php(316): AuthManagerSpecialPage->trySubmit()
#11 ...//includes/specialpage/SpecialPage.php(522): LoginSignupSpecialPage->execute(NULL)
#12 ...//includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#13 ...//includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#14 ...//includes/MediaWiki.php(861): MediaWiki->performRequest()
#15 ...//includes/MediaWiki.php(524): MediaWiki->main()
#16 ...//index.php(42): MediaWiki->run()
#17 {main}
Expected Results:
To obtain the expected result (the system attempts to log the user in instead of throwing errors once a password is supplied), just update `user`.`user_touched`='20000101010101' (or some other valid date suitably far in the past) and try to log in.