Merge "Do not let DataUpdate exceptions block other deferred updates"
[lhc/web/wiklou.git] / includes / changes / RecentChange.php
index f3bbb9e..159cfd9 100644 (file)
@@ -461,6 +461,7 @@ class RecentChange {
         */
        public function doMarkPatrolled( User $user, $auto = false, $tags = null ) {
                global $wgUseRCPatrol, $wgUseNPPatrol, $wgUseFilePatrol;
+
                $errors = [];
                // If recentchanges patrol is disabled, only new pages or new file versions
                // can be patrolled, provided the appropriate config variable is set
@@ -497,8 +498,8 @@ class RecentChange {
                PatrolLog::record( $this, $auto, $user, $tags );
 
                Hooks::run(
-                                       'MarkPatrolledComplete',
-                                       [ $this->getAttribute( 'rc_id' ), &$user, false, $auto ]
+                       'MarkPatrolledComplete',
+                       [ $this->getAttribute( 'rc_id' ), &$user, false, $auto ]
                );
 
                return [];
@@ -850,7 +851,9 @@ class RecentChange {
                        'rc_logid' => 0,
                        'rc_log_type' => null,
                        'rc_log_action' => '',
-                       'rc_params' => ''
+                       'rc_params' =>  serialize( [
+                               'hidden-cat' => WikiCategoryPage::factory( $categoryTitle )->isHidden()
+                       ] )
                ];
 
                $rc->mExtra = [
@@ -864,6 +867,19 @@ class RecentChange {
                return $rc;
        }
 
+       /**
+        * Get a parameter value
+        *
+        * @since 1.27
+        *
+        * @param string $name parameter name
+        * @return mixed
+        */
+       public function getParam( $name ) {
+               $params = $this->parseParams();
+               return isset( $params[$name] ) ? $params[$name] : null;
+       }
+
        /**
         * Initialises the members of this object from a mysql row object
         *
@@ -972,7 +988,7 @@ class RecentChange {
         *
         * @since 1.26
         *
-        * @return array|null
+        * @return mixed|bool false on failed unserialization
         */
        public function parseParams() {
                $rcParams = $this->getAttribute( 'rc_params' );