MediaWiki r26615 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r26614‎ | r26615 (on ViewVC)‎ | r26616 >
Date:23:59, 11 October 2007
Author:amidaniel
Status:old
Tags:
Comment:
(bug 11632) API: Breaking change: Specify the type of a change in the recentchanges list as 'edit', 'new', 'log' instead of 0, 1, 2, respectively.
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
===================================================================
--- trunk/phase3/includes/api/ApiQueryRecentChanges.php	(revision 26614)
+++ trunk/phase3/includes/api/ApiQueryRecentChanges.php	(revision 26615)
@@ -134,8 +134,18 @@
 		$title = Title :: makeTitle($row->rc_namespace, $row->rc_title);
 		$vals = array ();
 
-		$vals['type'] = intval($row->rc_type);
+		$type = intval ( $row->rc_type );
 
+		/* Determine what kind of change this was. */
+		switch ( $type ) {
+		case RC_EDIT:  $vals['type'] = 'edit'; break;
+		case RC_NEW:   $vals['type'] = 'new'; break;
+		case RC_MOVE:  $vals['type'] = 'move'; break;
+		case RC_LOG:   $vals['type'] = 'log'; break;
+		case RC_MOVE_OVER_REDIRECT: $vals['type'] = 'move over redirect'; break;
+		default: $vals['type'] = $type;
+		}
+
 		if ($this->fld_title) {
 			ApiQueryBase :: addTitleInfo($vals, $title);
 			if ($movedToTitle)
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 26614)
+++ trunk/phase3/RELEASE-NOTES	(revision 26615)
@@ -121,6 +121,8 @@
 * (bug 11173) Allow limited wikicode rendering via api.php
 * (bug 11572) API should provide interface for expanding templates
 * (bug 11569) Login should return the cookie prefix 
+* (bug 11632) Breaking change: Specify the type of a change in the recentchanges list
+  as 'edit', 'new', 'log' instead of 0, 1, 2, respectively.
 
 === Languages updated in 1.12 ===
 

Status & tagging log

  • 15:21, 12 September 2011 Meno25 (Talk | contribs) changed the status of r26615 [removed: ok added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox