Hmmm, maybe I should have never 'linked so deep':
Notice: Undefined property: SkinVector::$mTitle in /home/jidanni/mediawiki/LocalSettings.php on line 55 Fatal error: Call to a member function quickUserCan() on a non-object.
The code that used to work was:
$wgFilterCallback='JidanniTitleFilter'; function JidanniTitleFilter($mTitle){ if (preg_match("/^\d/", $mTitle->getText()) && $mTitle->getNamespace() <= NS_TALK) EditPage::spamPage ('***請退("←"鍵),另存所打的字,然後見「首頁」=>「使用說明」中之「頻率編入其單位」。謝謝。***'); return true;} return false;}
Maybe I should just say in my message 'if the page you were trying to edit was a talk page, then ...', instead of trying to determine it myself with the ever changing internal parameters.
All this now needs to be revised too.
function JidanniDontInviteEdit(&$article,&$outputDone){if($article->getID()===0){ switch($article->mTitle->getNamespace()){case NS_CATEGORY:case NS_CATEGORY_TALK:$outputDone=true;}}return true;} $wgHooks['ArticleViewHeader'][]='JidanniDontInviteEdit';//Bug 17630 function JidanniLessRedNavigation($sktemplate,$links){ // var_dump('BEFORE',$links); foreach($links['namespaces'] as $ns=>&$value){ if($value['context']=='talk' && $value['class']=='new' && !$sktemplate->mTitle->quickUserCan('createtalk')){ unset($links['namespaces'][$ns]);} if($ns=='category' && $value['class']=='selected new'){ $value['class']='selected'; if(isset($links['actions']['watch'])){unset($links['actions']['watch']);}}} //var_dump('AFTER',$links); return true;} $wgHooks['SkinTemplateNavigation'][]='JidanniLessRedNavigation';
And who knows what will happen if some other skin. No imagine what will happen ten years later when I am ten years older and still have to maintain this with even 'less cells to spare upstairs' (in the brain.)
jidanni@jidanni.org wrote:
Hmmm, maybe I should have never 'linked so deep':
Notice: Undefined property: SkinVector::$mTitle in /home/jidanni/mediawiki/LocalSettings.php on line 55 Fatal error: Call to a member function quickUserCan() on a non-object.
The code that used to work was:
$wgFilterCallback='JidanniTitleFilter'; function JidanniTitleFilter($mTitle){ if (preg_match("/^\d/", $mTitle->getText()) && $mTitle->getNamespace() <= NS_TALK) EditPage::spamPage ('***請退("←"鍵),另存所打的字,然後見「首頁」=>「使用說明」中之「頻率編入其單位」。謝謝。***'); return true;} return false;}
Maybe I should just say in my message 'if the page you were trying to edit was a talk page, then ...', instead of trying to determine it myself with the ever changing internal parameters.
Those are the recent RequestContext changes. Change $whatever->mTitle to $whatever->getTitle()
I don't see where it calls SkinVector::$mTitle, you probably copied the wrong section.
wikitech-l@lists.wikimedia.org