From: jenkins-bot Date: Tue, 31 Jul 2018 17:23:42 +0000 (+0000) Subject: Merge "Return array without holes from User::getAllGroups" X-Git-Tag: 1.34.0-rc.0~4611 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=5623500b41dde648a047a0637c119decd47b1166;hp=115d4e282689bafe27f033c92aa4405d5dda42eb Merge "Return array without holes from User::getAllGroups" --- diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 559ac87eca..f032efc5c5 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -144,7 +144,8 @@ class LogEventsList extends ContextSource { // Date menu $formDescriptor['date'] = [ 'type' => 'date', - 'label-message' => 'date' + 'label-message' => 'date', + 'default' => sprintf( "%04d-%02d-%02d", $year, $month, $day ), ]; // Tag filter diff --git a/includes/pager/ReverseChronologicalPager.php b/includes/pager/ReverseChronologicalPager.php index 9eef728a93..51824d2f35 100644 --- a/includes/pager/ReverseChronologicalPager.php +++ b/includes/pager/ReverseChronologicalPager.php @@ -81,14 +81,16 @@ abstract class ReverseChronologicalPager extends IndexPager { return null; } - // Treat the given time in the wiki timezone and get a UTC timestamp for the database lookup $timestamp = self::getOffsetDate( $year, $month, $day ); - $timestamp->setTimezone( $this->getConfig()->get( 'Localtimezone' ) ); try { - $this->mYear = (int)$timestamp->format( 'Y' ); - $this->mMonth = (int)$timestamp->format( 'm' ); - $this->mDay = (int)$timestamp->format( 'd' ); + // The timestamp used for DB queries is at midnight of the *next* day after the selected date. + $selectedDate = new DateTime( $timestamp->getTimestamp( TS_ISO_8601 ) ); + $selectedDate = $selectedDate->modify( '-1 day' ); + + $this->mYear = (int)$selectedDate->format( 'Y' ); + $this->mMonth = (int)$selectedDate->format( 'm' ); + $this->mDay = (int)$selectedDate->format( 'd' ); $this->mOffset = $this->mDb->timestamp( $timestamp->getTimestamp() ); } catch ( TimestampException $e ) { // Invalid user provided timestamp (T149257) diff --git a/tests/phpunit/includes/specials/SpecialPageExecutor.php b/tests/phpunit/includes/specials/SpecialPageExecutor.php index e7cfca7f01..9572e30119 100644 --- a/tests/phpunit/includes/specials/SpecialPageExecutor.php +++ b/tests/phpunit/includes/specials/SpecialPageExecutor.php @@ -73,6 +73,9 @@ class SpecialPageExecutor { $this->setEditTokenFromUser( $context ); + // Make sure the skin context is correctly set https://phabricator.wikimedia.org/T200771 + $context->getSkin()->setContext( $context ); + return $context; }