Last modified: 2012-08-19 16:14:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32972, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30972 - GenderCache does not cached gender for non-existing users
GenderCache does not cached gender for non-existing users
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
1.20.x
All All
: Normal normal (vote)
: ---
Assigned To: Niklas Laxström
:
Depends on:
Blocks: gender
  Show dependency treegraph
 
Reported: 2011-09-18 18:41 UTC by db [inactive,noenotif]
Modified: 2012-08-19 16:14 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description db [inactive,noenotif] 2011-09-18 18:41:00 UTC
The GenderCache (added in r82029) does not store the default value for non-existing users.

Set contentlanguage = de and put the link "[[User:Non-existing]]" in a edit box and show the preview.

That results in the following sql queries (and many more)

SELECT user_name,up_value FROM `user` LEFT JOIN `user_properties` ON ((user_id = up_user) AND up_property = 'gender') WHERE user_name = 'Non-existing' (MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/MediaWiki::performAction/EditPage::submit/EditPage::edit/EditPage::showEditForm/EditPage::getPreviewText/StubObject::parse/StubObject::__call/StubObject::_call/call_user_func_array/Parser::parse/Parser::internalParse/Parser::replaceInternalLinks/Parser::replaceInternalLinks2/Title::getPrefixedText/Title::prefix/Title::getNsText/GenderCache::getGenderOf/GenderCache::doQuery)

SELECT user_name,up_value FROM `user` LEFT JOIN `user_properties` ON ((user_id = up_user) AND up_property = 'gender') WHERE user_name = 'Non-existing' (MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/MediaWiki::performAction/EditPage::submit/EditPage::edit/EditPage::showEditForm/EditPage::getPreviewText/StubObject::parse/StubObject::__call/StubObject::_call/call_user_func_array/Parser::parse/Parser::internalParse/Parser::replaceInternalLinks/Parser::replaceInternalLinks2/LinkHolderArray::makeHolder/Title::getPrefixedDBkey/Title::prefix/Title::getNsText/GenderCache::getGenderOf/GenderCache::doQuery)

SELECT page_id,page_namespace,page_title,page_is_redirect,page_len,page_latest FROM `page` WHERE (page_namespace = '2' AND page_title = 'Non-existing') (MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/MediaWiki::performAction/EditPage::submit/EditPage::edit/EditPage::showEditForm/EditPage::getPreviewText/StubObject::parse/StubObject::__call/StubObject::_call/call_user_func_array/Parser::parse/Parser::replaceLinkHolders/LinkHolderArray::replace/LinkHolderArray::replaceInternal)

SELECT user_name,up_value FROM `user` LEFT JOIN `user_properties` ON ((user_id = up_user) AND up_property = 'gender') WHERE user_name = 'Non-existing' (MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/MediaWiki::performAction/EditPage::submit/EditPage::edit/EditPage::showEditForm/EditPage::getPreviewText/StubObject::parse/StubObject::__call/StubObject::_call/call_user_func_array/Parser::parse/Parser::replaceLinkHolders/LinkHolderArray::replace/LinkHolderArray::replaceInternal/LinkCache::addBadLinkObj/Title::getPrefixedDBkey/Title::prefix/Title::getNsText/GenderCache::getGenderOf/GenderCache::doQuery)

SELECT user_name,up_value FROM `user` LEFT JOIN `user_properties` ON ((user_id = up_user) AND up_property = 'gender') WHERE user_name = 'Non-existing' (MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/MediaWiki::performAction/EditPage::submit/EditPage::edit/EditPage::showEditForm/EditPage::getPreviewText/StubObject::parse/StubObject::__call/StubObject::_call/call_user_func_array/Parser::parse/Parser::replaceLinkHolders/LinkHolderArray::replace/LinkHolderArray::replaceInternal/Linker::link/Linker::linkUrl/Title::getLinkUrl/Title::getLocalURL/Title::getPrefixedDBkey/Title::prefix/Title::getNsText/GenderCache::getGenderOf/GenderCache::doQuery)

One call for the LinkBatch (ok), but 4 calls inside the GenderCache, that is not needed in my opinion.

Having the link [[User:Admin]] (a existing user) in the preview gives:

SELECT user_name,up_value FROM `user` LEFT JOIN `user_properties` ON ((user_id = up_user) AND up_property = 'gender') WHERE user_name = 'Admin' (MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/MediaWiki::performAction/EditPage::submit/EditPage::edit/EditPage::showEditForm/EditPage::getPreviewText/StubObject::parse/StubObject::__call/StubObject::_call/call_user_func_array/Parser::parse/Parser::internalParse/Parser::replaceInternalLinks/Parser::replaceInternalLinks2/Title::getPrefixedText/Title::prefix/Title::getNsText/GenderCache::getGenderOf/GenderCache::doQuery)

SELECT page_id,page_namespace,page_title,page_is_redirect,page_len,page_latest FROM `page` WHERE (page_namespace = '2' AND page_title = 'Admin') (MediaWiki::run/MediaWiki::main/MediaWiki::performRequest/MediaWiki::performAction/EditPage::submit/EditPage::edit/EditPage::showEditForm/EditPage::getPreviewText/StubObject::parse/StubObject::__call/StubObject::_call/call_user_func_array/Parser::parse/Parser::replaceLinkHolders/LinkHolderArray::replace/LinkHolderArray::replaceInternal)

Which looks ok.
Comment 1 Niklas Laxström 2011-09-19 09:06:20 UTC
r97460 fixes it partially.
Comment 2 Niklas Laxström 2011-09-19 10:52:01 UTC
I've fixed the low hanging fruit, but fixing the parser itself is something I cannot do at this moment.
Comment 3 db [inactive,noenotif] 2012-08-19 16:14:02 UTC
Having the GenderCache looks enough. When the other queries makes problem, some one will open a bug for that.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links