Merge "Support all values for exif PhotometricInterpretation"
[lhc/web/wiklou.git] / includes / api / ApiFeedWatchlist.php
index 853b138..c841d83 100644 (file)
@@ -169,6 +169,11 @@ class ApiFeedWatchlist extends ApiBase {
         * @return FeedItem
         */
        private function createFeedItem( $info ) {
+               if ( !isset( $info['title'] ) ) {
+                       // Probably a revdeled log entry, skip it.
+                       return null;
+               }
+
                $titleStr = $info['title'];
                $title = Title::newFromText( $titleStr );
                $curidParam = array();
@@ -176,7 +181,7 @@ class ApiFeedWatchlist extends ApiBase {
                        // Probably a formerly-valid title that's now conflicting with an
                        // interwiki prefix or the like.
                        if ( isset( $info['pageid'] ) ) {
-                               $title = Title::newFromId( $info['pageid'] );
+                               $title = Title::newFromID( $info['pageid'] );
                                $curidParam = array( 'curid' => $info['pageid'] );
                        }
                        if ( !$title || $title->isExternal() ) {
@@ -205,9 +210,14 @@ class ApiFeedWatchlist extends ApiBase {
                }
 
                $timestamp = $info['timestamp'];
-               $user = $info['user'];
 
-               $completeText = "$comment ($user)";
+               if ( isset( $info['user'] ) ) {
+                       $user = $info['user'];
+                       $completeText = "$comment ($user)";
+               } else {
+                       $user = '';
+                       $completeText = (string)$comment;
+               }
 
                return new FeedItem( $titleStr, $completeText, $titleUrl, $timestamp, $user );
        }
@@ -255,6 +265,15 @@ class ApiFeedWatchlist extends ApiBase {
                                if ( !isset( $p[ApiBase::PARAM_HELP_MSG] ) ) {
                                        $p[ApiBase::PARAM_HELP_MSG] = "apihelp-query+watchlist-param-$from";
                                }
+                               if ( isset( $p[ApiBase::PARAM_TYPE] ) && is_array( $p[ApiBase::PARAM_TYPE] ) &&
+                                       isset( $p[ApiBase::PARAM_HELP_MSG_PER_VALUE] )
+                               ) {
+                                       foreach ( $p[ApiBase::PARAM_TYPE] as $v ) {
+                                               if ( !isset( $p[ApiBase::PARAM_HELP_MSG_PER_VALUE][$v] ) ) {
+                                                       $p[ApiBase::PARAM_HELP_MSG_PER_VALUE][$v] = "apihelp-query+watchlist-paramvalue-$from-$v";
+                                               }
+                                       }
+                               }
                                $ret[$to] = $p;
                        }
                } else {