Extension talk:WarnNoCategories

From mediawiki.org
Latest comment: 10 years ago by in topic Error 500 with MW 1.19.2 and PHP 5.3

addmessages has no object?[edit]

2 problems: addmessages has no object and there are syntactical problems with WarnNoCategories.php.

-- User: Dawn

Extension broke with ConfirmEdit extension[edit]

When saving a page with no category and an external link, you get the prompt to categorize it, but after that, you get the prompt to perform the math captcha, and it loops forever between the categorization prompt and the ConfirmEdit captcha. Any fix for this?? Thanks! --Fladei 17:53, 21 June 2011 (UTC)Reply[reply]

Never mind, I solved it. Just add the following at lines 59-61 of WarnNoCategories.php
    if ( $wgRequest->getCheck('wpCaptchaId') )
        return true;
--Fladei 19:29, 4 July 2011 (UTC)Reply[reply]

Also currently works with Redirects[edit]

Hi - this is a great extension, thanks! But I see that it also works with Redirect pages, which I think is too much. I suggest you exclude those, or at least make that an option. --Robinson Weijman 07:13, 10 June 2009 (UTC)Reply[reply]

Other languges[edit]


  • Hi... Could you add "German" to your languages?
    • Here is translation of the code for the WarnNoCategories.i18n.php file:
$wgWarnNoCategoriesMessages['de'] = array(
   'warn-no-categories' => '<h3 style="color: red">VORSICHT: Diese Seite wurde noch nicht gespeichert. Bitte fügen Sie zuerst eine Kategorie hinzu!</h3><br/><b>Hinweis: </b>Kategorien helfen bei der Strukturierung eines Wikis, deshalb sollten Sie mindestens eine Kategorie anführen.<br/><b>Vorgehensweise: </b>Geben Sie am Seitenende <nowiki>[[Kategorie: xbz]]</nowiki> ein. Danach müssen Sie die Seite erneut speichern.<br/><br/>',


$wgWarnNoCategoriesMessages['it'] = array(
    'warn-no-categories' => '<h3 style="color: red">Pagina non salvata. Per favore correggi gli errori.</h3><br/><b>Attenzione:</b> Non hai specificato alcuna categoria per la pagina. Le Categorie aiutano la struttura del wiki, quindi per favore aggiungine almeno una. Se non sai quale mettere, metti il tuo articolo sotto quella generica in Da catalogare.<br/>Aggiungi alla fine della voce: <tt><nowiki>[[Categoria:NOMECATEGORIA]]</nowiki></tt>. Schiaccia invece su Categoria se vuoi vedere la lista per poter scegliere.',
Thanks! -- 18:25, 20 March 2011 (UTC)Reply[reply]

Does not work with PHP 5.3 --> this is the fix![edit]

  • It appears that this extension does not work with PHP 5.3. The logging shows:
    Warning: Parameter 1 to wncCheckCategories() expected to be a reference, value given in /htdocs/includes/Hooks.php on line 117
    --Robinson Weijman 10:53, 4 August 2010 (UTC)Reply[reply]
    • Fix: I've found the fix. It is to change this line:
      function wncCheckCategories( &$editPage, $newText, $section, &$error ) {
      function wncCheckCategories( $editPage, $newText, $section, &$error ) {
      (change in first parameter) --Robinson Weijman 11:38, 4 August 2010 (UTC)Reply[reply]

Failures in Code[edit]

Correct failures in the code; to see:

Error 500 with MW 1.19.2 and PHP 5.3[edit]

Also with fix for PHP 5.3 I see Error 500 and the Apache log reports:

.../mod_fcgid: stderr: PHP Fatal error: Call to a member function addMessages() on a non-object in /home/.../public_html/w-it/extensions/WarnNoCategories/WarnNoCategories.php on line 33

-- 11:34, 3 October 2012 (UTC)Reply[reply]