Do not require titles on Special:ComparePages
authorMatěj Suchánek <matejsuchanek97@gmail.com>
Sat, 9 Jun 2018 14:05:28 +0000 (14:05 +0000)
committerMatěj Suchánek <matejsuchanek97@gmail.com>
Sat, 9 Jun 2018 14:09:00 +0000 (14:09 +0000)
By default, title fields are required, so the form cannot be submitted
without them. However, here we need either the title or the revision id.

Change-Id: Iedafec485851d7e91affb69a2c9c3fd40d31ded4

includes/specials/SpecialComparePages.php

index 28f04fa..d6fb10f 100644 (file)
@@ -59,6 +59,7 @@ class SpecialComparePages extends SpecialPage {
                                'size' => '40',
                                'section' => 'page1',
                                'validation-callback' => [ $this, 'checkExistingTitle' ],
+                               'required' => false,
                        ],
                        'Revision1' => [
                                'type' => 'int',
@@ -75,6 +76,7 @@ class SpecialComparePages extends SpecialPage {
                                'size' => '40',
                                'section' => 'page2',
                                'validation-callback' => [ $this, 'checkExistingTitle' ],
+                               'required' => false,
                        ],
                        'Revision2' => [
                                'type' => 'int',