Topic on Extension talk:ConfirmEdit

Solution for typical problems with reCaptcha and MediaWiki 1.25

2
Summary by Florianschmidtwelzow
83.27.70.135 (talkcontribs)

If you're updating, start with deleting whole extensions/ConfirmEdit dir and copy it from mediawiki 1.25 archive. Replacing files won't do any good.

    • Error: PHP Warning: call_user_func() expects parameter 1 to be a valid callback, class 'ConfirmEditHooks' not found in /var/www/te_pl_wiki/includes/registration/ExtensionRegistry.php on line 169
    • Solution: include ConfirmEdit.php in your LocalConfig before loading a ReCaptcha.
    • Example:
require_once "$IP/extensions/ConfirmEdit/ConfirmEdit.php";
require_once "$IP/extensions/ConfirmEdit/ReCaptcha.php";
$wgCaptchaClass = 'ReCaptcha';
$wgReCaptchaPublicKey = 'your-public-key';
$wgReCaptchaPrivateKey = 'your-private-key';
    • Error: PHP Warning: call_user_func() expects parameter 1 to be a valid callback, function 'efReCaptcha' not found or invalid function name in /var/www/bw_fr_wiki/includes/Setup.php on line 678
    • Solution: edit extensions/ConfirmEdit/ReCaptcha/extension.json and remove "efReCaptcha" from "ExtensioFunctions"
    • Example:
"ExtensionFunctions": [
],
    • Error: PHP Warning: require_once(ReCaptcha/recaptchalib.php): failed to open stream: No such file or directory in /var/www/br_pl_wiki/extensions/ConfirmEdit/includes/ConfirmEditHooks.php on line 147
    • Solution: edit extensions/ConfirmEdit/includes/ConfirmEditHooks.php and edit function onReCaptchaSetup(), so it can find the file.
    • Example:
       public static function onReCaptchaSetup() {
               //error_log("cwd: ".getcwd()); // to debug currect dir location in log
               require_once( "extensions/ConfirmEdit/ReCaptcha/recaptchalib.php" );
       }
Florianschmidtwelzow (talkcontribs)

> Error: PHP Warning: call_user_func() expects parameter 1 to be a valid callback, class 'ConfirmEditHooks' not found in /var/www/te_pl_wiki/includes/registration/ExtensionRegistry.php on line 169

You shouldn't use "only" ReCaptcha, it's a bad practice including the framework in a module, that's why it's not working with ExtensionRegistration. A much smaller solution, btw, would be to use: wfLoadExtensions( array( 'ConfirmEdit', 'ConfirmEdit/ReCaptcha' ) );

> Error: PHP Warning: call_user_func() expects parameter 1 to be a valid callback, function 'efReCaptcha' not found or invalid function name in /var/www/bw_fr_wiki/includes/Setup.php on line 678

Tracked in: phabricator:T100504

> Error: PHP Warning: require_once(ReCaptcha/recaptchalib.php): failed to open stream: No such file or directory in /var/www/br_pl_wiki/extensions/ConfirmEdit/includes/ConfirmEditHooks.php on line 147

Tracked in: phabricator:T100505

Reply to "Solution for typical problems with reCaptcha and MediaWiki 1.25"