Pass if log entry is legacy to ApiQueryLogEvents::addLogParams()
[lhc/web/wiklou.git] / includes / api / ApiQueryWatchlist.php
index 4059ff8..3857a08 100644 (file)
@@ -199,7 +199,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                if ( !is_null( $params['type'] ) ) {
                        try {
                                $this->addWhereFld( 'rc_type', RecentChange::parseToRCType( $params['type'] ) );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                ApiBase::dieDebug( __METHOD__, $e->getMessage() );
                        }
                }
@@ -412,14 +412,15 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                                $vals['logid'] = intval( $row->rc_logid );
                                $vals['logtype'] = $row->rc_log_type;
                                $vals['logaction'] = $row->rc_log_action;
-                               $logEntry = DatabaseLogEntry::newFromRow( (array)$row );
+                               $logEntry = DatabaseLogEntry::newFromRow( $row );
                                ApiQueryLogEvents::addLogParams(
                                        $this->getResult(),
                                        $vals,
                                        $logEntry->getParameters(),
                                        $logEntry->getType(),
                                        $logEntry->getSubtype(),
-                                       $logEntry->getTimestamp()
+                                       $logEntry->getTimestamp(),
+                                       $logEntry->isLegacy()
                                );
                        }
                }
@@ -499,6 +500,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                                )
                        ),
                        'type' => array(
+                               ApiBase::PARAM_DFLT => 'edit|new|log',
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => array(
                                        'edit',