Last modified: 2013-12-07 06:58:01 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 T57469, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55469 - update.php: "Class 'EchoHooks' not found in extensions/Echo/Echo.php:532"
update.php: "Class 'EchoHooks' not found in extensions/Echo/Echo.php:532"
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Echo (Other open bugs)
unspecified
All All
: Unprioritized major (vote)
: ---
Assigned To: bsitu
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-08 15:56 UTC by paladox2015
Modified: 2013-12-07 06:58 UTC (History)
4 users (show)

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


Attachments

Description paladox2015 2013-10-08 15:56:40 UTC
Hi I am having a problem with echo because it won't let me use update.php at http://random-wikisaur.tk/mw-config/?page=ExistingWiki. I have to uninstall it to be able to use update.php please fix it.
Comment 1 bsitu 2013-10-08 17:07:20 UTC
Hi, could you post more detail on the problem?

Thanks,
Comment 2 paladox2015 2013-10-08 18:28:39 UTC
Well it says error 
Fatal error: Class 'EchoHooks' not found in /home/randwiki/public_html/extensions/Echo/Echo.php on line 532
Comment 3 Andre Klapper 2013-10-08 20:20:21 UTC
paladox: For future reference, post the error message already in the initial comment.
Comment 4 spage 2013-10-08 21:35:31 UTC
Prioritization and scheduling of this bug is tracked on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/302
Comment 5 paladox2015 2013-10-11 19:01:32 UTC
it says that from 531 to 538 there are problems here are the lines affected 

// By default, send emails for each notification as they come in
$wgDefaultUserOptions['echo-email-frequency'] = EchoHooks::EMAIL_IMMEDIATELY;

if ( $wgAllowHTMLEmail ) {
	$wgDefaultUserOptions['echo-email-format'] = EchoHooks::EMAIL_FORMAT_HTML;
} else {
	$wgDefaultUserOptions['echo-email-format'] = EchoHooks::EMAIL_FORMAT_PLAIN_TEXT;
}
Comment 6 paladox2015 2013-10-11 19:01:52 UTC
in echo.php
Comment 7 paladox2015 2013-10-19 22:23:35 UTC
Please fix the issue
Comment 8 paladox2015 2013-10-19 22:24:03 UTC
Running Mediawiki 1.22 Wmf 22
Comment 9 Andre Klapper 2013-10-20 00:36:08 UTC
(In reply to comment #7)
> it says that from 531 to 538 there are problems here are the lines affected

Please don't paraphrase but post the **complete** output that makes you think so. Also see http://www.mediawiki.org/wiki/Manual:How_to_debug

https://www.mediawiki.org/wiki/Thread:Project:Support_desk/extension_echo https://www.mediawiki.org/wiki/Thread:Extension_talk:Echo/Fatal_Error_when_Upgrading:_Class_%27EchoHooks%27_not_found/reply seem to cover the same issue, and that's probably also where this should be handled instead.
Comment 10 Sam Reed (reedy) 2013-10-23 17:15:45 UTC
I've just had it.

So, if you had Echo installed, and try to use the mediawki installer to update MediaWiki (rather than cli update.php which is fine), you get this failure

http://192.168.0.190/w/mw-config/?page=ExistingWiki

( ! ) Fatal error: Class 'EchoHooks' not found in /var/www/wiki/mediawiki/extensions/Echo/Echo.php on line 532
Call Stack
#	Time	Memory	Function	Location
1	0.0001	233888	{main}( )	../index.php:0
2	0.0071	1608872	wfInstallerMain( )	../index.php:29
3	0.0495	3791568	WebInstaller->execute( )	../index.php:61
4	0.0549	4029776	WebInstaller_ExistingWiki->execute( )	../WebInstaller.php:275
5	0.0549	4029832	Installer::getExistingLocalSettings( )	../WebInstallerPage.php:284
6	0.0593	4243256	require( '/var/www/wiki/mediawiki/core/LocalSettings.php' )	../Installer.php:511
7	0.1952	5507120	require_once( '/var/www/wiki/mediawiki/extensions/Echo/Echo.php' )	../LocalSettings.php:399



Presumably related to the fact that the Autoloader code in MediaWiki isn't active, so it doesn't follow the defined AutoLoader code, the class isn't loaded automagically and it fatals.

$wgAutoloadClasses['EchoHooks'] = $dir . 'Hooks.php';


Moving where the constants are defined (maybe into Echo.php too), or deferring the setting of this code till later on via using $wgExtensionFunctions

Something like:

$wgExtensionFunctions[] = 'efLoadEcho';

function efLoadEcho() {
	global $wgDefaultUserOptions;
	// By default, send emails for each notification as they come in
	$wgDefaultUserOptions['echo-email-frequency'] = EchoHooks::EMAIL_IMMEDIATELY;

	if ( $wgAllowHTMLEmail ) {
		$wgDefaultUserOptions['echo-email-format'] = EchoHooks::EMAIL_FORMAT_HTML;
	} else {
		$wgDefaultUserOptions['echo-email-format'] = EchoHooks::EMAIL_FORMAT_PLAIN_TEXT;
	}
}



Of course, the simple fix is commenting out the line in LocalSettings.php, but this won't be obvious to most people. That and they might need to run the updater for Echo to create or update the tables
Comment 11 Sam Reed (reedy) 2013-10-23 17:21:19 UTC
Still need to be defined in LocalSettings.php (Do we care about register_globals now?)

Or even just do

// By default, send emails for each notification as they come in
$wgDefaultUserOptions['echo-email-frequency'] = /*EchoHooks::EMAIL_IMMEDIATELY*/0;

if ( $wgAllowHTMLEmail ) {
	$wgDefaultUserOptions['echo-email-format'] = /*EchoHooks::EMAIL_FORMAT_HTML*/'html';
} else {
	$wgDefaultUserOptions['echo-email-format'] = /*EchoHooks::EMAIL_FORMAT_PLAIN_TEXT*/'plain-text';
}
Comment 12 paladox2015 2013-10-23 18:22:56 UTC
hi thanks could you patch this in echo if this works please
Comment 13 Gerrit Notification Bot 2013-10-23 19:32:45 UTC
Change 91485 had a related patch set uploaded by Bsitu:
Remove class constant variable reference from Echo.php

https://gerrit.wikimedia.org/r/91485
Comment 14 Gerrit Notification Bot 2013-10-29 05:10:09 UTC
Change 91485 merged by jenkins-bot:
Remove class constant variable reference from Echo.php

https://gerrit.wikimedia.org/r/91485
Comment 15 paladox2015 2013-10-29 10:47:47 UTC
The error is now saying 


Warning: Cannot modify header information - headers already sent in /home/u841643917/public_html/includes/Exception.php on line 245

Warning: Cannot modify header information - headers already sent in /home/u841643917/public_html/includes/Exception.php on line 246

Warning: Cannot modify header information - headers already sent in /home/u841643917/public_html/includes/Exception.php on line 247

Warning: Cannot modify header information - headers already sent in /home/u841643917/public_html/includes/Exception.php on line 212
Invalid callback in hooks for ParserFirstCallInit
Backtrace:

#0 /home/u841643917/public_html/includes/GlobalFunctions.php(3877): Hooks::run('ParserFirstCallInit', Array)
#1 /home/u841643917/public_html/includes/parser/Parser.php(271): wfRunHooks('ParserFirstCallInit', Array)
#2 /home/u841643917/public_html/includes/parser/Parser.php(283): Parser->firstCallInit()
#3 /home/u841643917/public_html/includes/parser/Parser.php(4818): Parser->clearState()
#4 /home/u841643917/public_html/includes/parser/Parser.php(363): Parser->startParse(Object(Title), Object(ParserOptions), 1, true)
#5 /home/u841643917/public_html/includes/installer/Installer.php(591): Parser->parse('A <code>LocalSettings.php</code> file has been detected.
To upgrade this installation, please enter the value of <code>$wgUpgradeKey</code> in the box below.
You will find it in <code>LocalSettings.php</code>.', Object(Title), Object(ParserOptions), true)
#6 /home/u841643917/public_html/includes/installer/WebInstaller.php(662): Installer->parse('A <code>LocalSettings.php</code> file has been detected.
To upgrade this installation, please enter the value of <code>$wgUpgradeKey</code> in the box below.
You will find it in <code>LocalSettings.php</code>.', true)
#7 /home/u841643917/public_html/includes/installer/WebInstallerPage.php(359): WebInstaller->getInfoBox('A <code>LocalSettings.php</code> file has been detected.
To upgrade this installation, please enter the value of <code>$wgUpgradeKey</code> in the box below.
You will find it in <code>LocalSettings.php</code>.')
#8 /home/u841643917/public_html/includes/installer/WebInstallerPage.php(347): WebInstaller_ExistingWiki->showKeyForm()
#9 /home/u841643917/public_html/includes/installer/WebInstaller.php(275): WebInstaller_ExistingWiki->execute()
#10 /home/u841643917/public_html/mw-config/index.php(61): WebInstaller->execute(Array)
#11 /home/u841643917/public_html/mw-config/index.php(29): wfInstallerMain()
#12 {main}
Comment 16 Sam Reed (reedy) 2013-10-29 12:05:28 UTC
(In reply to comment #15)
> The error is now saying 
> 
> 
> Warning: Cannot modify header information - headers already sent in
> /home/u841643917/public_html/includes/Exception.php on line 245
> 
> Warning: Cannot modify header information - headers already sent in
> /home/u841643917/public_html/includes/Exception.php on line 246
> 
> Warning: Cannot modify header information - headers already sent in
> /home/u841643917/public_html/includes/Exception.php on line 247
> 
> Warning: Cannot modify header information - headers already sent in
> /home/u841643917/public_html/includes/Exception.php on line 212
> Invalid callback in hooks for ParserFirstCallInit
> Backtrace:
> 
> #0 /home/u841643917/public_html/includes/GlobalFunctions.php(3877):
> Hooks::run('ParserFirstCallInit', Array)
> #1 /home/u841643917/public_html/includes/parser/Parser.php(271):
> wfRunHooks('ParserFirstCallInit', Array)
> #2 /home/u841643917/public_html/includes/parser/Parser.php(283):
> Parser->firstCallInit()
> #3 /home/u841643917/public_html/includes/parser/Parser.php(4818):
> Parser->clearState()
> #4 /home/u841643917/public_html/includes/parser/Parser.php(363):
> Parser->startParse(Object(Title), Object(ParserOptions), 1, true)
> #5 /home/u841643917/public_html/includes/installer/Installer.php(591):
> Parser->parse('A <code>LocalSettings.php</code> file has been detected.
> To upgrade this installation, please enter the value of
> <code>$wgUpgradeKey</code> in the box below.
> You will find it in <code>LocalSettings.php</code>.', Object(Title),
> Object(ParserOptions), true)
> #6 /home/u841643917/public_html/includes/installer/WebInstaller.php(662):
> Installer->parse('A <code>LocalSettings.php</code> file has been detected.
> To upgrade this installation, please enter the value of
> <code>$wgUpgradeKey</code> in the box below.
> You will find it in <code>LocalSettings.php</code>.', true)
> #7 /home/u841643917/public_html/includes/installer/WebInstallerPage.php(359):
> WebInstaller->getInfoBox('A <code>LocalSettings.php</code> file has been
> detected.
> To upgrade this installation, please enter the value of
> <code>$wgUpgradeKey</code> in the box below.
> You will find it in <code>LocalSettings.php</code>.')
> #8 /home/u841643917/public_html/includes/installer/WebInstallerPage.php(347):
> WebInstaller_ExistingWiki->showKeyForm()
> #9 /home/u841643917/public_html/includes/installer/WebInstaller.php(275):
> WebInstaller_ExistingWiki->execute()
> #10 /home/u841643917/public_html/mw-config/index.php(61):
> WebInstaller->execute(Array)
> #11 /home/u841643917/public_html/mw-config/index.php(29): wfInstallerMain()
> #12 {main}

This is a completely different bug, no mention of Echo at all, and Echo also doesn't have a ParserFirstCallInit subscriber.

Please open a new bug for this under MediaWiki => Installer

Please also tell us what version of MediaWiki you are running
Comment 17 paladox2015 2013-10-29 21:11:30 UTC
Ok I will open up another bug but the version of Mediawiki is Mediawiki 1.23 wmf1
Comment 18 Gerrit Notification Bot 2013-12-07 06:56:42 UTC
Change 100120 had a related patch set uploaded by Legoktm:
Remove class constant variable reference from Echo.php

https://gerrit.wikimedia.org/r/100120
Comment 19 Gerrit Notification Bot 2013-12-07 06:57:03 UTC
Change 100120 merged by jenkins-bot:
Remove class constant variable reference from Echo.php

https://gerrit.wikimedia.org/r/100120
Comment 20 Kunal Mehta (Legoktm) 2013-12-07 06:58:01 UTC
Sigh. I've backported this to REL1_22.

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


Navigation
Links