Prefill date in form on Special:Log when calling with old parameters
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 26 Jul 2018 19:55:24 +0000 (21:55 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 26 Jul 2018 20:11:52 +0000 (22:11 +0200)
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

includes/logging/LogEventsList.php

index 559ac87..f032efc 100644 (file)
@@ -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