r68809 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68808‎ | r68809 | r68810 >
Date:23:58, 30 June 2010
Author:laner
Status:deferred
Tags:
Comment:
Fix bug that causes notifications to fail in non-main namespaces
Modified paths:
  • /trunk/extensions/SemanticTasks/ST_CheckForReminders.php (modified) (history)
  • /trunk/extensions/SemanticTasks/SemanticTasks.classes.php (modified) (history)
  • /trunk/extensions/SemanticTasks/SemanticTasks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticTasks/SemanticTasks.php
@@ -1,10 +1,15 @@
22 <?php
33
44 if ( !defined( 'MEDIAWIKI' ) ) {
5 - echo "Not a valid entry point";
6 - exit( 1 );
 5+ echo "Not a valid entry point";
 6+ exit( 1 );
77 }
88
 9+if ( !defined( 'SMW_VERSION' ) ) {
 10+ echo "This extension requires Semantic MediaWiki to be installed.";
 11+ exit( 1 );
 12+}
 13+
914 #
1015 # This is the path to your installation of SemanticTasks as
1116 # seen from the web. Change it if required ($wgScriptPath is the
@@ -18,7 +23,7 @@
1924 'path' => __FILE__,
2025 'name' => 'SemanticTasks',
2126 'author' => 'Steren Giannini, Ryan Lane',
22 - 'version' => '1.3',
 27+ 'version' => '1.4',
2328 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Tasks',
2429 'descriptionmsg' => 'semantictasks-desc',
2530 );
@@ -34,8 +39,8 @@
3540 $wgAutoloadClasses['SemanticTasksMailer'] = $dir . 'SemanticTasks.classes.php';
3641
3742 function SemanticTasksSetupExtension() {
38 - global $wgHooks;
39 - $wgHooks['ArticleSaveComplete'][] = 'SemanticTasksMailer::mailAssigneesUpdatedTask';
 43+ global $wgHooks;
 44+ $wgHooks['ArticleSaveComplete'][] = 'SemanticTasksMailer::mailAssigneesUpdatedTask';
4045 $wgHooks['ArticleSave'][] = 'SemanticTasksMailer::findOldValues';
41 - return true;
 46+ return true;
4247 }
Index: trunk/extensions/SemanticTasks/ST_CheckForReminders.php
@@ -6,7 +6,7 @@
77 require_once( "$IP/maintenance/commandLine.inc" );
88
99 global $smwgIP;
10 -require_once( $smwgIP . 'includes/SMW_Factbox.php' );
 10+require_once( $smwgIP . '/includes/SMW_Factbox.php' );
1111
1212 require_once( dirname( __FILE__ ) . '/SemanticTasks.classes.php' );
1313
Index: trunk/extensions/SemanticTasks/SemanticTasks.classes.php
@@ -1,5 +1,15 @@
22 <?php
33
 4+if ( !defined( 'MEDIAWIKI' ) ) {
 5+ echo "Not a valid entry point";
 6+ exit( 1 );
 7+}
 8+
 9+if ( !defined( 'SMW_VERSION' ) ) {
 10+ echo "This extension requires Semantic MediaWiki to be installed.";
 11+ exit( 1 );
 12+}
 13+
414 // constants for message type
515 define( "NEWTASK", 0 );
616 define( "UPDATE", 1 );
@@ -15,7 +25,7 @@
1626
1727 function findOldValues( &$article, &$user, &$text, &$summary, $minor, $watch, $sectionanchor, &$flags ) {
1828 $title = $article->getTitle();
19 - $title_text = $title->getText();
 29+ $title_text = $title->getFullText();
2030
2131 $assignees = self::getAssignees( 'Assigned to', $title_text, $user );
2232 $status = self::getStatus( 'Status', $title_text, $user );
@@ -60,7 +70,8 @@
6171 self::printDebug( "Saved task status: " . self::$task_status );
6272
6373 $title = $article->getTitle();
64 - $title_text = $title->getText();
 74+ $title_text = $title->getPrefixedText();
 75+ self::printDebug( "Title text: $title_text" );
6576
6677 $assignees_to_task = array();
6778 $current_assignees = self::getAssignees( 'Assigned to', $title_text, $user );
@@ -251,7 +262,7 @@
252263 // i18n
253264 wfLoadExtensionMessages( 'SemanticTasks' );
254265
255 - $title_text = $title->getText();
 266+ $title_text = $title->getFullText();
256267 $from = new MailAddress( $user->getEmail(), $user->getName() );
257268 $link = $title->escapeFullURL();
258269
@@ -320,8 +331,10 @@
321332 wfLoadExtensionMessages( 'SemanticTasks' );
322333
323334 // We use the Semantic MediaWiki Processor
 335+ // $smwgIP is defined by Semantic MediaWiki, and we don't allow
 336+ // this file to be sourced unless Semantic MediaWiki is included.
324337 global $smwgIP;
325 - include_once( $smwgIP . "includes/SMW_QueryProcessor.php" );
 338+ include_once( $smwgIP . "/includes/SMW_QueryProcessor.php" );
326339
327340 $params = array();
328341 $inline = true;

Status & tagging log