r85341 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:< r85340‎ | r85341 | r85342 >
Date:16:34, 4 April 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added compatibility with MW 1.18 - skin->mTitle no longer works; now skin->getTitle() is required
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormEditTab.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormEditTab.php
——@@ -12,17 +12,22 @@
1313 * a form
1414 */
1515 static function displayTab( $obj, &$content_actions ) {
 16+ if ( method_exists ( $obj, 'getTitle' ) ) {
 17+ $title = $obj->getTitle();
 18+ } else {
 19+ $title = $obj->mTitle;
 20+ }
1621 // Make sure that this is not a special page, and
1722 // that the user is allowed to edit it
1823 // - this function is almost never called on special pages,
1924 // but before SMW is fully initialized, it's called on
2025 // Special:SMWAdmin for some reason, which is why the
2126 // special-page check is there.
22 - if ( !isset( $obj->mTitle ) ||
23 - ( $obj->mTitle->getNamespace() == NS_SPECIAL ) ) {
 27+ if ( !isset( $title ) ||
 28+ ( $title->getNamespace() == NS_SPECIAL ) ) {
2429 return true;
2530 }
26 - $title = $obj->mTitle;
 31+
2732 $form_names = SFFormLinker::getDefaultFormsForPage( $title );
2833 if ( count( $form_names ) == 0 ) {
2934 return true;