Page MenuHomePhabricator

Special:UserMerge throws "Title::newFromText: $text must be a string" error
Closed, ResolvedPublic

Description

Going to Special:UserMerge gives

[error] [70ec5ec2] /testwiki/index.php/Special:UserMerge ErrorException from line 300 of /var/www/html/testwiki/includes/debug/MWDebug.php: PHP Notice: Title::newFromText: $text must be a string. This will throw an InvalidArgumentException in future. [Called from User::getCanonicalName in /var/www/html/testwiki/includes/User.php at line 989]
#0 [internal function]: MWExceptionHandler::handleError(1024, 'Title::newFromT...', '/var/www/html/t...', 300, Array)
#1 /var/www/html/testwiki/includes/debug/MWDebug.php(300): trigger_error('Title::newFromT...', 1024)
#2 /var/www/html/testwiki/includes/debug/MWDebug.php(155): MWDebug::sendMessage('Title::newFromT...', Array, 'warning', 1024)
#3 /var/www/html/testwiki/includes/GlobalFunctions.php(1201): MWDebug::warning('Title::newFromT...', 3, 1024, 'auto')
#4 /var/www/html/testwiki/includes/Title.php(269): wfWarn('Title::newFromT...', 2)
#5 /var/www/html/testwiki/includes/User.php(989): Title::newFromText(NULL)
#6 /var/www/html/testwiki/includes/User.php(493): User::getCanonicalName(NULL, 'valid')
#7 /var/www/html/testwiki/extensions/UserMerge/SpecialUserMerge.php(66): User::newFromName(NULL)
#8 /var/www/html/testwiki/extensions/UserMerge/SpecialUserMerge.php(34): SpecialUserMerge->validateOldUser(NULL)
#9 [internal function]: SpecialUserMerge->{closure}(NULL, Array, Object(HTMLForm))
#10 /var/www/html/testwiki/includes/htmlform/HTMLFormField.php(297): call_user_func(Object(Closure), NULL, Array, Object(HTMLForm))
#11 /var/www/html/testwiki/includes/htmlform/HTMLFormField.php(762): HTMLFormField->validate(NULL, Array)
#12 /var/www/html/testwiki/includes/htmlform/HTMLFormField.php(457): HTMLFormField->getErrorsAndErrorClass(NULL)
#13 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(1331): HTMLFormField->getTableRow(NULL)
#14 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(1019): HTMLForm->displaySection(Array, '')
#15 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(866): HTMLForm->getBody()
#16 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(848): HTMLForm->getHTML(false)
#17 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(514): HTMLForm->displayForm(false)
#18 /var/www/html/testwiki/includes/specialpage/FormSpecialPage.php(150): HTMLForm->show()
#19 /var/www/html/testwiki/includes/specialpage/SpecialPage.php(384): FormSpecialPage->execute(NULL)
#20 /var/www/html/testwiki/includes/specialpage/SpecialPageFactory.php(582): SpecialPage->run(NULL)
#21 /var/www/html/testwiki/includes/MediaWiki.php(285): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#22 /var/www/html/testwiki/includes/MediaWiki.php(634): MediaWiki->performRequest()
#23 /var/www/html/testwiki/includes/MediaWiki.php(431): MediaWiki->main()
#24 /var/www/html/testwiki/index.php(41): MediaWiki->run()
#25 {main}
[error] [ad6754f9] /testwiki/index.php/Special:UserMerge ErrorException from line 300 of /var/www/html/testwiki/includes/debug/MWDebug.php: PHP Notice: Title::newFromText: $text must be a string. This will throw an InvalidArgumentException in future. [Called from User::getCanonicalName in /var/www/html/testwiki/includes/User.php at line 989]
#0 [internal function]: MWExceptionHandler::handleError(1024, 'Title::newFromT...', '/var/www/html/t...', 300, Array)
#1 /var/www/html/testwiki/includes/debug/MWDebug.php(300): trigger_error('Title::newFromT...', 1024)
#2 /var/www/html/testwiki/includes/debug/MWDebug.php(155): MWDebug::sendMessage('Title::newFromT...', Array, 'warning', 1024)
#3 /var/www/html/testwiki/includes/GlobalFunctions.php(1201): MWDebug::warning('Title::newFromT...', 3, 1024, 'auto')
#4 /var/www/html/testwiki/includes/Title.php(269): wfWarn('Title::newFromT...', 2)
#5 /var/www/html/testwiki/includes/User.php(989): Title::newFromText(NULL)
#6 /var/www/html/testwiki/includes/User.php(493): User::getCanonicalName(NULL, 'valid')
#7 /var/www/html/testwiki/extensions/UserMerge/SpecialUserMerge.php(89): User::newFromName(NULL)
#8 /var/www/html/testwiki/extensions/UserMerge/SpecialUserMerge.php(46): SpecialUserMerge->validateNewUser(NULL)
#9 [internal function]: SpecialUserMerge->{closure}(NULL, Array, Object(HTMLForm))
#10 /var/www/html/testwiki/includes/htmlform/HTMLFormField.php(297): call_user_func(Object(Closure), NULL, Array, Object(HTMLForm))
#11 /var/www/html/testwiki/includes/htmlform/HTMLFormField.php(762): HTMLFormField->validate(NULL, Array)
#12 /var/www/html/testwiki/includes/htmlform/HTMLFormField.php(457): HTMLFormField->getErrorsAndErrorClass(NULL)
#13 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(1331): HTMLFormField->getTableRow(NULL)
#14 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(1019): HTMLForm->displaySection(Array, '')
#15 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(866): HTMLForm->getBody()
#16 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(848): HTMLForm->getHTML(false)
#17 /var/www/html/testwiki/includes/htmlform/HTMLForm.php(514): HTMLForm->displayForm(false)
#18 /var/www/html/testwiki/includes/specialpage/FormSpecialPage.php(150): HTMLForm->show()
#19 /var/www/html/testwiki/includes/specialpage/SpecialPage.php(384): FormSpecialPage->execute(NULL)
#20 /var/www/html/testwiki/includes/specialpage/SpecialPageFactory.php(582): SpecialPage->run(NULL)
#21 /var/www/html/testwiki/includes/MediaWiki.php(285): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#22 /var/www/html/testwiki/includes/MediaWiki.php(634): MediaWiki->performRequest()
#23 /var/www/html/testwiki/includes/MediaWiki.php(431): MediaWiki->main()
#24 /var/www/html/testwiki/index.php(41): MediaWiki->run()
#25 {main}

Event Timeline

Glaisher created this task.Jun 8 2015, 5:54 AM
Glaisher raised the priority of this task from to High.
Glaisher updated the task description. (Show Details)
Glaisher added a subscriber: Glaisher.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 8 2015, 5:54 AM

Since there is no form data when visiting the special page, null gets passed to User::newFromName in validateOldUser() and validateNewUser().

Glaisher closed this task as Resolved.Aug 10 2015, 4:41 PM
Glaisher claimed this task.

Doesn't seem to happen now. I guess this has something to do with HTMLForm which has since then been resolved..

Glaisher reopened this task as Open.Sep 2 2015, 12:00 PM

..And this still happens. I probably had errors disabled when I closed this. :-/

Change 235446 had a related patch set uploaded (by Glaisher):
Don't try to validate before form submission on Special:UserMerge

https://gerrit.wikimedia.org/r/235446

[T76305] SpecialUserMerge::{closure}/SpecialUserMerge::validateOldUser/User::newFromName/User::getCanonicalName/Title::newFromText is the actual issue.

Glaisher renamed this task from Special:UserMerge throws php notices to Special:UserMerge throws "Title::newFromText: $text must be a string" error.Sep 2 2015, 12:16 PM
Glaisher set Security to None.

Change 235446 merged by jenkins-bot:
Only pass strings to User::newFromName on Special:UserMerge

https://gerrit.wikimedia.org/r/235446

Where was this seen in Wikimedia-production-error? This page shouldn't be accessible in production.

Can we close this now?

Legoktm closed this task as Resolved.Sep 19 2015, 7:08 AM