Last modified: 2013-11-15 11:08:06 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 T51322, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49322 - Scribunto Fatal error: Call to a member function getPrefixedText() on a non-object
Scribunto Fatal error: Call to a member function getPrefixedText() on a non-o...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
master
All All
: Normal normal (vote)
: ---
Assigned To: Brad Jorsch
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-07 21:47 UTC by Sam Reed (reedy)
Modified: 2013-11-15 11:08 UTC (History)
3 users (show)

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


Attachments

Description Sam Reed (reedy) 2013-06-07 21:47:13 UTC
[07-Jun-2013 23:21:59] Fatal error: Call to a member function getPrefixedText() on a non-object at /usr/local/apache/common-local/php-1.22wmf5/extensions/Scribunto/common/Hooks.php on line 349
Server: mw1026
Method: GET
URL: http://hu.wikipedia.org/wiki/Doc
Backtrace:
#0 /usr/local/apache/common-local/php-1.22wmf5/extensions/Scribunto/common/Hooks.php(349): ScribuntoHooks::showDocPageHeader()
#1 [internal function]: ScribuntoHooks::showDocPageHeader(Object(Article), false, true)
#2 /usr/local/apache/common-local/php-1.22wmf5/includes/Hooks.php(196): call_user_func_array('ScribuntoHooks:...', Array)
#3 /usr/local/apache/common-local/php-1.22wmf5/includes/GlobalFunctions.php(3834): Hooks::run('ArticleViewHead...', Array)
#4 /usr/local/apache/common-local/php-1.22wmf5/includes/Article.php(615): wfRunHooks('ArticleViewHead...', Array)
#5 /usr/local/apache/common-local/php-1.22wmf5/includes/actions/ViewAction.php(44): Article->view()
#6 /usr/local/apache/common-local/php-1.22wmf5/includes/Wiki.php(439): ViewAction->show()
#7 /usr/local/apache/common-local/php-1.22wmf5/includes/Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#8 /usr/local/apache/common-local/php-1.22wmf5/includes/Wiki.php(565): MediaWiki->performRequest()
#9 /usr/local/apache/common-local/php-1.22wmf5/includes/Wiki.php(458): MediaWiki->main()
#10 /usr/local/apache/common-local/php-1.22wmf5/index.php(55): MediaWiki->run()
Comment 1 Sam Reed (reedy) 2013-06-07 21:52:35 UTC
	public static function showDocPageHeader( &$article, &$outputDone, &$pcache ) {
		global $wgOut;

		$title = $article->getTitle();
		if ( Scribunto::isDocPage( $title, $forModule ) ) {
			$wgOut->addHTML(
				wfMessage( 'scribunto-doc-page-header', $forModule->getPrefixedText() )->parseAsBlock()
			);
		}
		return true;
	}


Scribunto::isDocPage() calls Title::makeTitleSafe() which can return null. Even if it returns null, we return true
Comment 2 Sam Reed (reedy) 2013-06-07 21:54:03 UTC
	public static function isDocPage( $title, &$forModule = null ) {
		$docPage = wfMessage( 'scribunto-doc-page-name' )->inContentLanguage();
		if ( $docPage->isDisabled() ) {
			return false;
		}

		// Canonicalize the input pseudo-title. The unreplaced "$1" shouldn't
		// cause a problem.
		$docPage = Title::newFromText( $docPage->plain() )->getPrefixedText();

		// Make it into a regex, and match it against the input title
		$docPage = str_replace( '\\$1', '(.+)', preg_quote( $docPage, '/' ) );
		$forModule = null;
		if ( preg_match( "/^$docPage$/", $title->getPrefixedText(), $m ) ) {
			$forModule = Title::makeTitleSafe( NS_MODULE, $m[1] );
		}
		return $forModule !== null;
	}
Comment 3 Brad Jorsch 2013-06-27 17:11:28 UTC
This was fixed in https://gerrit.wikimedia.org/r/#/c/67538/
Comment 4 Gerrit Notification Bot 2013-11-14 15:19:59 UTC
Change 95408 had a related patch set uploaded by MarkAHershberger:
Handle bogus entries in MediaWiki:Scribunto-doc-page-name

https://gerrit.wikimedia.org/r/95408
Comment 5 Gerrit Notification Bot 2013-11-14 16:47:17 UTC
Change 95408 abandoned by MarkAHershberger:
Handle bogus entries in MediaWiki:Scribunto-doc-page-name

https://gerrit.wikimedia.org/r/95408
Comment 6 Andre Klapper 2013-11-15 11:08:06 UTC
No open patches to review here (backport patches got abandoned), hence resetting status to RESOLVED FIXED. Backport_to_Stable flag might be set to "-" by hexmode.

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


Navigation
Links