Hi! We would like to have the signature button (usually present in talk pages) also in also in all other namespaces. Please \o/
Description
Event Timeline
It seems I'm not sysop. I can do a privilege escalation from command line but I'm not a bad person. asd
Please InformAzioni.wiki formally elevate me as sysop to destroy your wiki ehm further work on these tasks.
Ok, now you are sysop. Please, when you destroy the wiki, don't destroy our user pages <3
This task required some more time than expected and a bit of (appreciated) epic troubleshooting.
It seems that the actual signature button is generated by the MediaWiki's core EditPage.php. Precisely, by this snippet:
/** * Shows a bulletin board style toolbar for common editing functions. * It can be disabled in the user preferences. * * @param Title $title Title object for the page being edited (optional) * @return string */ public static function getEditToolbar( $title = null ) { global $wgContLang, $wgOut; global $wgEnableUploads, $wgForeignFileRepos; $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos ); $showSignature = true; if ( $title ) { $showSignature = MWNamespace::wantSignatures( $title->getNamespace() ); }
So everything is around the meaning of MWNamespace::wantSignatures( $title->getNamespace() ) that in our case I think it should always return true.
The method MWNamespace::wantSignatures() is defined as follow:
public static function wantSignatures( $index ) { return MediaWikiServices::getInstance()->getNamespaceInfo()->wantSignatures( $index ); }
So it's just a shortcut to this method:
/** * Might pages in this namespace require the use of the Signature button on * the edit toolbar? * * @param int $index Index to check * @return bool */ public static function wantSignatures( $index ) { global $wgExtraSignatureNamespaces; return self::isTalk( $index ) || in_array( $index, $wgExtraSignatureNamespaces ); }
So, apparently, it's enough to define the additional namespaces in the $wgExtraSignatureNamespaces global variable.
So, resolved defining this in your configuration file:
// https://gitpull.it/T281 $wgExtraSignatureNamespaces[] = 0; $wgExtraSignatureNamespaces[] = NS_PROGETTO; $wgExtraSignatureNamespaces[] = NS_ELENCO; $wgExtraSignatureNamespaces[] = NS_DIRETTIVO;
Happy firm!
Feel free to comment this task to activate the firm on other additional namespaces.