Topic on Project:Support desk

Problem with Edit-Mode/Hooks.php

12
Dirk Bechtel (talkcontribs)

When calling any edit-page of my wiki, I get this error message

Warning: Parameter 1 to ConfirmEditHooks::showEditFormFields() expected to be a reference, value given in .../Hooks.php on line 195

Any idea what's going wrong, what to do?

TIA!

Ciencia Al Poder (talkcontribs)

The ConfirmEdit extension on your wiki isn't compatible with your MediaWiki version. Please download and install a version that matches your MediaWiki version

Dirk Bechtel (talkcontribs)

Thank you, but this doesn't help. The ConfirmEdit was delivered with the MW-Version, so it should be compatible. Nevertheless I installed again a fresh downloaded version of this extension, but still get the same error message.

Ciencia Al Poder (talkcontribs)

What MediaWiki version are we talking about?

176.74.236.217 (talkcontribs)

I had the same problem with the extension Visual Editor.

in the extension map there is probably a hooks.php file. Open it en delete the "&" at the public static function.

Dirk Bechtel (talkcontribs)

Thank you, same problem here with the Visual Editor, too! I've found VisualEditor.hooks.php, but there are many lines with public static function and "&" … I've no idea, where to delete one, could you perhaps specify this?

Dwergman25 (talkcontribs)

Don't know if you still need the answer but here it comes. In line 42 you have the following statement:

- - - - - -

public static function onBeforePageDisplay( OutputPage &$output, Skin &$skin ) {

- - - - - -

Removing the & before $output should be enough. So it will be:

- - - - - -

public static function onBeforePageDisplay( OutputPage $output, Skin &$skin ) {

- - - - - -

Dirk Bechtel (talkcontribs)
Ciencia Al Poder (talkcontribs)
Dirk Bechtel (talkcontribs)

Ah, okay - thank you! So I've I little work for tomorrow …

110.149.123.63 (talkcontribs)

It is just a warning, it shouldn't affect functionality and can be ignored.

Ciencia Al Poder (talkcontribs)

But you'll have to edit php.ini to disable error reporting for WARNINGs, otherwise they'll be puked all over the page :)