X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fwatcheditem%2FWatchedItemQueryService.php;h=b91e36e5f18c74d4ef5864cd674a8b267ec80106;hp=bf419a94a516d62f465840776e010a2452b66fab;hb=aec80a1fb774715e43430ab583c190b79e468fce;hpb=3d54d208bc0dd54baef18b3891ff0faf1d300214 diff --git a/includes/watcheditem/WatchedItemQueryService.php b/includes/watcheditem/WatchedItemQueryService.php index bf419a94a5..b91e36e5f1 100644 --- a/includes/watcheditem/WatchedItemQueryService.php +++ b/includes/watcheditem/WatchedItemQueryService.php @@ -320,8 +320,8 @@ class WatchedItemQueryService { } private function getRecentChangeFieldsFromRow( stdClass $row ) { - // This can be simplified to single array_filter call filtering by key value, - // once we stop supporting PHP 5.5 + // FIXME: This can be simplified to single array_filter call filtering by key value, + // now we have stopped supporting PHP 5.5 $allFields = get_object_vars( $row ); $rcKeys = array_filter( array_keys( $allFields ), @@ -498,15 +498,15 @@ class WatchedItemQueryService { // TODO: not sure if this should simply ignore patrolled filters if user does not have the patrol // right, or maybe rather fail loud at this point, same as e.g. ApiQueryWatchlist does? if ( in_array( self::FILTER_PATROLLED, $options['filters'] ) ) { - $conds[] = 'rc_patrolled != 0'; + $conds[] = 'rc_patrolled != ' . RecentChange::PRC_UNPATROLLED; } elseif ( in_array( self::FILTER_NOT_PATROLLED, $options['filters'] ) ) { - $conds[] = 'rc_patrolled = 0'; + $conds['rc_patrolled'] = RecentChange::PRC_UNPATROLLED; } if ( in_array( self::FILTER_AUTOPATROLLED, $options['filters'] ) ) { - $conds[] = 'rc_patrolled = 2'; + $conds['rc_patrolled'] = RecentChange::PRC_AUTOPATROLLED; } elseif ( in_array( self::FILTER_NOT_AUTOPATROLLED, $options['filters'] ) ) { - $conds[] = 'rc_patrolled != 2'; + $conds[] = 'rc_patrolled != ' . RecentChange::PRC_AUTOPATROLLED; } }