Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php |
— | — | @@ -58,10 +58,11 @@ |
59 | 59 | if ( is_null( $categoryTitle ) ) |
60 | 60 | $this->dieUsage("Category name $category is not valid", 'param_category'); |
61 | 61 | |
62 | | - $prop = array_flip($params['prop']); |
| 62 | + $prop = array_flip($params['prop']); |
63 | 63 | $fld_ids = isset($prop['ids']); |
64 | 64 | $fld_title = isset($prop['title']); |
65 | 65 | $fld_sortkey = isset($prop['sortkey']); |
| 66 | + $fld_timestamp = isset($prop['timestamp']); |
66 | 67 | |
67 | 68 | if (is_null($resultPageSet)) { |
68 | 69 | $this->addFields(array('cl_from', 'cl_sortkey', 'page_namespace', 'page_title')); |
— | — | @@ -70,7 +71,8 @@ |
71 | 72 | $this->addFields($resultPageSet->getPageTableFields()); // will include page_ id, ns, title |
72 | 73 | $this->addFields(array('cl_from', 'cl_sortkey')); |
73 | 74 | } |
74 | | - |
| 75 | + |
| 76 | + $this->addFieldsIf('cl_timestamp', $fld_timestamp); |
75 | 77 | $this->addTables(array('page','categorylinks')); // must be in this order for 'USE INDEX' |
76 | 78 | $this->addOption('USE INDEX', 'cl_sortkey'); // Not needed after bug 10280 is applied to servers |
77 | 79 | |
— | — | @@ -79,7 +81,7 @@ |
80 | 82 | $this->addWhereFld('cl_to', $categoryTitle->getDBkey()); |
81 | 83 | $this->addWhereFld('page_namespace', $params['namespace']); |
82 | 84 | $this->addOption('ORDER BY', "cl_to, cl_sortkey, cl_from"); |
83 | | - |
| 85 | + |
84 | 86 | $limit = $params['limit']; |
85 | 87 | $this->addOption('LIMIT', $limit +1); |
86 | 88 | |
— | — | @@ -110,6 +112,8 @@ |
111 | 113 | } |
112 | 114 | if ($fld_sortkey) |
113 | 115 | $vals['sortkey'] = $row->cl_sortkey; |
| 116 | + if ($fld_timestamp) |
| 117 | + $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->cl_timestamp); |
114 | 118 | $data[] = $vals; |
115 | 119 | } else { |
116 | 120 | $resultPageSet->processDbRow($row); |
— | — | @@ -152,9 +156,9 @@ |
153 | 157 | |
154 | 158 | if ($from != 0) { |
155 | 159 | // Duplicate sort key continue |
156 | | - $this->addWhere( "cl_sortkey>$sortKey OR (cl_sortkey=$sortKey AND cl_from>=$from)" ); |
| 160 | + $this->addWhere( "cl_sortkey>$sortKey OR (cl_sortkey=$sortKey AND cl_from>=$from)" ); |
157 | 161 | } else { |
158 | | - $this->addWhere( "cl_sortkey>=$sortKey" ); |
| 162 | + $this->addWhere( "cl_sortkey>=$sortKey" ); |
159 | 163 | } |
160 | 164 | } |
161 | 165 | |
— | — | @@ -163,15 +167,16 @@ |
164 | 168 | 'category' => null, |
165 | 169 | 'prop' => array ( |
166 | 170 | ApiBase :: PARAM_DFLT => 'ids|title', |
167 | | - ApiBase :: PARAM_ISMULTI => true, |
| 171 | + ApiBase :: PARAM_ISMULTI => true, |
168 | 172 | ApiBase :: PARAM_TYPE => array ( |
169 | 173 | 'ids', |
170 | 174 | 'title', |
171 | 175 | 'sortkey', |
| 176 | + 'timestamp', |
172 | 177 | ) |
173 | 178 | ), |
174 | 179 | 'namespace' => array ( |
175 | | - ApiBase :: PARAM_ISMULTI => true, |
| 180 | + ApiBase :: PARAM_ISMULTI => true, |
176 | 181 | ApiBase :: PARAM_TYPE => 'namespace', |
177 | 182 | ), |
178 | 183 | 'continue' => null, |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -497,6 +497,7 @@ |
498 | 498 | * (bug 11072) Fix regression in API image history query |
499 | 499 | * (bug 11115) Adding SHA1 hash to imageinfo query |
500 | 500 | * (bug 10898) API does not return an edit token for non-existent pages |
| 501 | +* (bug 10890) Timestamp support for categorymembers query |
501 | 502 | |
502 | 503 | == Maintenance script changes since 1.10 == |
503 | 504 | |