From: Daniel Cannon Date: Thu, 11 Oct 2007 23:59:00 +0000 (+0000) Subject: (bug 11632) API: Breaking change: Specify the type of a change in the recentchanges... X-Git-Tag: 1.31.0-rc.0~51165 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=79c968da7bcbbeae60ef24f99d1d71f7523b2657;p=lhc%2Fweb%2Fwiklou.git (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. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 25b3252ca1..2ba18eb98e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -121,6 +121,8 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API * (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 === diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index e7fd9a0dab..2268a8f72e 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -134,7 +134,17 @@ class ApiQueryRecentChanges extends ApiQueryBase { $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);