Page MenuHomePhabricator

Call to undefined method CreditsAction::getCredits()
Closed, ResolvedPublic

Description

Since probably gerrit change I68308aac96b89c2aec296e2a4fa385fd1d42ab5a got merged, I can't access my wiki any longer. error_log says:

[Sat Oct 06 15:24:45 2012] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined method CreditsAction::getCredits() in /home/tim/public_html/w/includes/SkinTemplate.php on line 339
[Sat Oct 06 15:24:45 2012] [error] [client 127.0.0.1] PHP Stack trace:
[Sat Oct 06 15:24:45 2012] [error] [client 127.0.0.1] PHP 1. {main}() /home/tim/public_html/w/index.php:0
[Sat Oct 06 15:24:45 2012] [error] [client 127.0.0.1] PHP 2. MediaWiki->run() /home/tim/public_html/w/index.php:59
[Sat Oct 06 15:24:45 2012] [error] [client 127.0.0.1] PHP 3. MediaWiki->main() /home/tim/public_html/w/includes/Wiki.php:446
[Sat Oct 06 15:24:45 2012] [error] [client 127.0.0.1] PHP 4. OutputPage->output() /home/tim/public_html/w/includes/Wiki.php:560
[Sat Oct 06 15:24:45 2012] [error] [client 127.0.0.1] PHP 5. SkinTemplate->outputPage() /home/tim/public_html/w/includes/OutputPage.php:1988

Obviously, includes/actions/CreditsAction.php has CreditsAction::getCredits(), but I haven't tracked this down further yet.


Version: 1.21.x
Severity: blocker

Details

Reference
bz40820

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:04 AM
bzimport set Reference to bz40820.

The somewhat obfuscated usage doesn't help:

$tpl->set( 'credits', Action::factory( 'credits', $this->getWikiPage(),

						$this->getContext() )->getCredits( $wgMaxCredits, $wgShowCreditsIfMax ) );

My dev wiki is working fine though

(In reply to comment #0)

Obviously, includes/actions/CreditsAction.php has CreditsAction::getCredits(),
but I haven't tracked this down further yet.

No it doesn't, as of the revision you suggested

class CreditsAction extends FormlessAction {

public function getName() {

		return 'credits';

}

/**

  • This is largely cadged from PageHistory::history *
  • @return String HTML
	 */

public function onView() {

		$this->getOutput()->redirect( $this->getTitle()->getLocalURL( "action=info" ) );

}
}

/**

  • Set this to the number of authors that you want to be credited below an
  • article text. Set it to zero to hide the attribution block, and a negative
  • number (like -1) to show all authors. Note that this will require 2-3 extra
  • database hits, which can have a not insignificant impact on performance for
  • large wikis. */

$wgMaxCredits = 0;

/** If there are more than $wgMaxCredits authors, show $wgMaxCredits of them.

  • Otherwise, link to a separate credits page. */

$wgShowCreditsIfMax = true;

I guess you've got a max credits value of > 0

(In reply to comment #2)

[...]
I guess you've got a max credits value of > 0

Yes, it was set to 1. Setting it to 0 works.

(In reply to comment #1)

Obviously, includes/actions/CreditsAction.php has CreditsAction::getCredits(),
but I haven't tracked this down further yet.

No it doesn't, as of the revision you suggested
[...]

Confused two directories with different checkouts; you're right, of course.

This change also breaks the DumpHTML extension for me. It errors out with the same message:
PHP Fatal error: Call to undefined method CreditsAction::getCredits() in /srv/www/mediawiki/core/includes/SkinTemplate.php on line 339

I did a git bisect to narrow the error down to this commit. Reverting it makes DumpHTML work again. Please fix this error!