Index: trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php |
— | — | @@ -328,7 +328,15 @@ |
329 | 329 | ApiArticleFeedbackv5Utils::logActivity( $activity , $pageId, $feedbackId, $notes ); |
330 | 330 | } |
331 | 331 | |
332 | | - // TODO: handle implicit hide/show logging |
| 332 | + // handle implicit hide/show logging |
| 333 | + if ( isset( $implicit_hide ) || isset ( $implicit_unhide )) { |
| 334 | + if ( $implicit_hide ) { |
| 335 | + $activity = 'hidden'; |
| 336 | + } else { |
| 337 | + $activity = 'show'; |
| 338 | + } |
| 339 | + ApiArticleFeedbackv5Utils::logActivity( $activity , $pageId, $feedbackId, '', true); |
| 340 | + } |
333 | 341 | |
334 | 342 | // Update helpful/unhelpful display count after submission. |
335 | 343 | if ( $flag == 'helpful' || $flag == 'unhelpful' ) { |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php |
— | — | @@ -207,8 +207,9 @@ |
208 | 208 | * @param $pageId int the id of the page so we can look it up |
209 | 209 | * @param $itemId int the id of the feedback item, used to build permalinks |
210 | 210 | * @param $notes string any notes that were stored with the activity |
| 211 | + * @param $auto boolean true if this was an "automatic" action, if so the log doer is changed |
211 | 212 | */ |
212 | | - public static function logActivity( $type, $pageId, $itemId, $notes) { |
| 213 | + public static function logActivity( $type, $pageId, $itemId, $notes, $auto = false) { |
213 | 214 | |
214 | 215 | // These are our valid activity log actions |
215 | 216 | $valid = array( 'oversight', 'unoversight', 'hidden', 'unhidden', |
— | — | @@ -237,9 +238,20 @@ |
238 | 239 | global $wgArticleFeedbackv5MaxActivityNoteLength; |
239 | 240 | $notes = substr($notes, 0, $wgArticleFeedbackv5MaxActivityNoteLength); |
240 | 241 | |
| 242 | + // if this is an automatic action, we create our special extension doer and send |
| 243 | + if ($auto) { |
| 244 | + $doer = User::newFromName( 'Article Feedback V5' ); |
| 245 | + // I cannot see how this could fail, but if it does do not log |
| 246 | + if (!$doer) { |
| 247 | + return; |
| 248 | + } |
| 249 | + } else { |
| 250 | + $doer = null; |
| 251 | + } |
| 252 | + |
241 | 253 | $log = new LogPage( 'articlefeedbackv5' ); |
242 | 254 | // comments become the notes section from the feedback |
243 | | - $log->addEntry( $type, $title, $notes ); |
| 255 | + $log->addEntry( $type, $permalink, $notes, array(), $doer); |
244 | 256 | |
245 | 257 | // update our log count by 1 |
246 | 258 | $dbw = wfGetDB( DB_MASTER ); |