From: Bartosz DziewoƄski Date: Thu, 26 Jul 2018 19:55:24 +0000 (+0200) Subject: Prefill date in form on Special:Log when calling with old parameters X-Git-Tag: 1.34.0-rc.0~4614^2 X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=commitdiff_plain;h=23cd9d6d2ee1efafe639825496137bc66d7f15e9;p=lhc%2Fweb%2Fwiklou.git Prefill date in form on Special:Log when calling with old parameters When the date is specified using &year=...&month=... URL parameters rather than &wpdate=..., HTMLForm can't automatically fill it in, but we can explicitly specify the default. Bug: T199856 Change-Id: I71f4953d57a3893190778e5bd763db108dc433d3 --- 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