Merge "Warn if stateful ParserOutput transforms are used"
[lhc/web/wiklou.git] / includes / specials / SpecialUserrights.php
index cf8c3f5..e62731f 100644 (file)
@@ -140,7 +140,7 @@ class UserrightsPage extends SpecialPage {
                $this->setHeaders();
                $this->outputHeader();
 
-               $out->addModuleStyles( 'mediawiki.special.userrights.styles' );
+               $out->addModuleStyles( 'mediawiki.special' );
                $this->addHelpLink( 'Help:Assigning permissions' );
 
                $this->switchForm();
@@ -761,7 +761,7 @@ class UserrightsPage extends SpecialPage {
        /**
         * Adds a table with checkboxes where you can select what groups to add/remove
         *
-        * @param array $usergroups Associative array of (group name as string =>
+        * @param UserGroupMembership[] $usergroups Associative array of (group name as string =>
         *   UserGroupMembership object) for groups the user belongs to
         * @param User $user
         * @return Array with 2 elements: the XHTML table element with checkxboes, and
@@ -873,6 +873,10 @@ class UserrightsPage extends SpecialPage {
                                                } else {
                                                        $expiryHtml = $this->msg( 'userrights-expiry-none' )->text();
                                                }
+                                               // T171345: Add a hidden form element so that other groups can still be manipulated,
+                                               // otherwise saving errors out with an invalid expiry time for this group.
+                                               $expiryHtml .= Html::Hidden( "wpExpiry-$group",
+                                                       $currentExpiry ? 'existing' : 'infinite' );
                                                $expiryHtml .= "<br />\n";
                                        } else {
                                                $expiryHtml = Xml::element( 'span', null,