Last modified: 2009-05-02 14:48:36 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 T19852, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17852 - API thows internal error: Empty $wgTitle in OutputPage::parse
API thows internal error: Empty $wgTitle in OutputPage::parse
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Roan Kattouw
:
: 18120 (view as bug list)
Depends on: 18257
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-08 01:39 UTC by CBM
Modified: 2009-05-02 14:48 UTC (History)
4 users (show)

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


Attachments

Description CBM 2009-03-08 01:39:14 UTC
The following API edit request throws an internal exception. This was very repeatable;
I was able to turn on debugging and run the script again to capture the stack trace. 
The page in question is "Category:Unassessed Grey's Anatomy articles" on enwiki.

This is probably related to some other bug, since the page has a lingering parser strip tag (UNIQ67316ef51deb354-nowiki-00000000-QINU) that does not disappear even when I edit the page manually. But index.php is able to edit the page, while the API is not. 

API request parameters:
  Base URL: http://en.wikipedia.org/w/api.php 
  Logged in as WP 1.0 bot
       action => 'edit' 
       token => redacted
       summary => 'Add to [[Category:Unassessed-Class articles]]'
       text => '{{categoryTOC}}
{{Cat class|topic=Grey's Anatomy|sort=Grey's Anatomy|class=Unassessed}}

Grey's Anatomy articles rated as B-Class on the [[Wikipedia:Version 1.0 Editorial Team/Assessment|Wikipedia 1.0 Assessment Scale]].  

Add items to this category by typing <nowiki>{{Project Grey's Anatomy|class=Unassessed}}</nowiki> on the article's <u>talk</u> page.

<categorytree>Unassessed-Class Grey's Anatomy articles</categorytree>

[[Category:Grey's Anatomy articles by quality]]
[[Category:Unassessed-Class articles|Grey's Anatomy articles]]' 
       title => 'Category:Unassessed Grey's Anatomy articles' 
       format => 'xml' 
       bot => '1' 

Response info: 
 'code' => 'internal_api_error_MWException'
 'error' => {
     'info' => 'Exception Caught: Empty $wgTitle in OutputPage::parse',
     'content' => '
#0 [internal function]: OutputPage->parse(\'Category <i>Una...\', true, true)
#1 /usr/local/apache/common-local/php-1.5/includes/StubObject.php(58): call_user_func_array(Array, Array)
#2 /usr/local/apache/common-local/php-1.5/includes/StubObject.php(76): StubObject->_call(\'parse\', Array)
#3 [internal function]: StubObject->__call(\'parse\', Array)
#4 /usr/local/apache/common-local/php-1.5/includes/GlobalFunctions.php(740): StubObject->parse(\'Category <i>Una...\', true, true)
#5 /usr/local/apache/common-local/php-1.5/extensions/CategoryTree/CategoryTreeFunctions.php(377): wfMsgExt(\'categorytree-no...\', \'parseinline\', \'Unassessed-Clas...\')
#6 /usr/local/apache/common-local/php-1.5/extensions/CategoryTree/CategoryTree.php(347): CategoryTree->getTag(Object(Parser), \'Unassessed-Clas...\', NULL, Array, 1, false)
#7 [internal function]: efCategoryTreeParserHook(\'Unassessed-Clas...\', Array, Object(Parser))
#8 /usr/local/apache/common-local/php-1.5/includes/parser/Parser.php(3232): call_user_func_array(\'efCategoryTreeP...\', Array)
#9 /usr/local/apache/common-local/php-1.5/includes/parser/Preprocessor_DOM.php(1026): Parser->extensionSubstitution(Array, Object(PPFrame_DOM))
#10 /usr/local/apache/common-local/php-1.5/includes/parser/Parser.php(2623): PPFrame_DOM->expand(Object(PPNode_DOM), 0)
#11 /usr/local/apache/common-local/php-1.5/includes/parser/Parser.php(875): Parser->replaceVariables(\'{{categoryTOC}}...\')
#12 /usr/local/apache/common-local/php-1.5/includes/parser/Parser.php(327): Parser->internalParse(\'{{categoryTOC}}...\')
#13 /usr/local/apache/common-local/php-1.5/includes/Article.php(2854): Parser->parse(\'{{categoryTOC}}...\', Object(Title), Object(ParserOptions), true, true, NULL)
#14 /usr/local/apache/common-local/php-1.5/extensions/SpamBlacklist/SpamBlacklist_body.php(218): Article->prepareTextForEdit(\'{{categoryTOC}}...\')
#15 /usr/local/apache/common-local/php-1.5/extensions/SpamBlacklist/SpamBlacklist.php(106): SpamBlacklist->filter(Object(Title), \'{{categoryTOC}}...\', \'\', \'\', Object(EditPage))
#16 [internal function]: wfSpamBlacklistFilterAPIEditBeforeSave(Object(EditPage), \'{{categoryTOC}}...\', Array)
#17 /usr/local/apache/common-local/php-1.5/includes/Hooks.php(117): call_user_func_array(\'wfSpamBlacklist...\', Array)
#18 /usr/local/apache/common-local/php-1.5/includes/api/ApiEditPage.php(180): wfRunHooks(\'APIEditBeforeSa...\', Array)
#19 /usr/local/apache/common-local/php-1.5/includes/api/ApiMain.php(431): ApiEditPage->execute()
#20 /usr/local/apache/common-local/php-1.5/includes/api/ApiMain.php(261): ApiMain->executeAction()
#21 /usr/local/apache/common-local/php-1.5/includes/api/ApiMain.php(245): ApiMain->executeActionWithErrorHandling()
#22 /usr/local/apache/common-local/php-1.5/api.php(77): ApiMain->execute()
#23 /usr/local/apache/common-local/live-1.5/api.php(3): require(\'/usr/local/apac...\')
#24 {main}'
Comment 1 Splarka 2009-03-08 01:51:02 UTC
Possibly related to bug 16129 but with another extension causing it? CategoryTree in this case?
Comment 2 CBM 2009-03-08 02:05:04 UTC
The categorytree issue may be bug 16744. 
Comment 3 Roan Kattouw 2009-03-09 15:21:17 UTC
It looks like SpamBlacklist is parsing the submitted text using Article::prepareTextForEdit() which in turn calls Parser::parse(), then CategoryTree is called from the parser and uses wfMsgExt() with 'parseinline', which it shouldn't be doing because parseinline uses $wgParser and $wgTitle, which may very well be different from the parser and title CategoryTree was called for (which is the case here: $wgTitle is null).

Either CategoryTree should be fixed, or parseinline should handle $wgTitle == null more gracefully. I don't know which I prefer just yet, I'm gonna talk this through with Tim first.
Comment 4 Roan Kattouw 2009-03-24 15:51:03 UTC
*** Bug 18120 has been marked as a duplicate of this bug. ***
Comment 5 Roan Kattouw 2009-03-24 15:51:45 UTC
(In reply to comment #4)
> *** Bug 18120 has been marked as a duplicate of this bug. ***
> 

In this report, it was {{Special:Unreviewpages}} returning an empty list (and probably calling wfMsgExt() with 'parse' or 'parseinline' in the process) that caused the error.
Comment 6 Roan Kattouw 2009-05-02 14:48:36 UTC
This should be fixed by r50132

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


Navigation
Links