Remove $wgHTMLFormAllowTableFormat and its uses

Described as "Evil hack for mobile :(", this config variable had been
overridden in the MobileFrontend extension for some time, but this has
been removed last year in Icb1711a0cef828dda0d99b8a7c7963bc409816c9.

Since it was introduced, most HTMLForms using the 'table' format have
been reworked to use 'ooui' (or 'codex', these days), so the hack is
no longer needed.

We recently removed $wgUseMediaWikiUIEverywhere for similar reasons
in aa7eeeeef9 / be135c0fc0.

Change-Id: Id507c0dc5a1c1cfb9737073bae97b14badc30a54
This commit is contained in:
Bartosz Dziewoński 2024-03-26 22:49:42 +01:00
parent 0da21fe70c
commit dd992c1a7d
8 changed files with 1 additions and 52 deletions

View file

@ -68,6 +68,7 @@ For notes on 1.41.x and older releases, see HISTORY.
* $wgMinimalPasswordLength and $wgMaximalPasswordLength, deprecated since 1.26
have been dropped. Use $wgPasswordPolicy instead.
* $wgUseMediaWikiUIEverywhere has been removed.
* $wgHTMLFormAllowTableFormat has been removed.
* $wgOpenSearchTemplate, deprecated since 1.25, has been removed
Use $wgOpenSearchTemplates['application/x-suggestions+json'] instead.
* $wgUseSameSiteLegacyCookies has been removed.

View file

@ -3179,14 +3179,6 @@ config-schema:
Correct current values are 'HTML+RDFa 1.0' or 'XHTML+RDFa 1.0'.
See also https://www.w3.org/TR/rdfa-in-html/#document-conformance
@since 1.16
HTMLFormAllowTableFormat:
default: true
description: |-
Temporary variable that allows HTMLForms to be rendered as tables.
Table based layouts cause various issues when designing for mobile.
This global allows skins or extensions a means to force non-table based rendering.
Setting to false forces form components to always render as div elements.
@since 1.24
EditSubmitButtonLabelPublish:
default: false
description: |-

View file

@ -1934,12 +1934,6 @@ $wgMimeType = null;
*/
$wgHtml5Version = null;
/**
* Config variable stub for the HTMLFormAllowTableFormat setting, for use by phpdoc and IDEs.
* @see MediaWiki\MainConfigSchema::HTMLFormAllowTableFormat
*/
$wgHTMLFormAllowTableFormat = null;
/**
* Config variable stub for the EditSubmitButtonLabelPublish setting, for use by phpdoc and IDEs.
* @see MediaWiki\MainConfigSchema::EditSubmitButtonLabelPublish

View file

@ -1949,12 +1949,6 @@ class MainConfigNames {
*/
public const Html5Version = 'Html5Version';
/**
* Name constant for the HTMLFormAllowTableFormat setting, for use with Config::get()
* @see MainConfigSchema::HTMLFormAllowTableFormat
*/
public const HTMLFormAllowTableFormat = 'HTMLFormAllowTableFormat';
/**
* Name constant for the EditSubmitButtonLabelPublish setting, for use with Config::get()
* @see MainConfigSchema::EditSubmitButtonLabelPublish

View file

@ -5120,19 +5120,6 @@ class MainConfigSchema {
'default' => null,
];
/**
* Temporary variable that allows HTMLForms to be rendered as tables.
*
* Table based layouts cause various issues when designing for mobile.
* This global allows skins or extensions a means to force non-table based rendering.
* Setting to false forces form components to always render as div elements.
*
* @since 1.24
*/
public const HTMLFormAllowTableFormat = [
'default' => true,
];
/**
* Whether to label the store-to-database-and-show-to-others button in the editor
* as "Save page"/"Save changes" if false (the default) or, if true, instead as

View file

@ -618,7 +618,6 @@ return [
],
'MimeType' => 'text/html',
'Html5Version' => null,
'HTMLFormAllowTableFormat' => true,
'EditSubmitButtonLabelPublish' => false,
'XhtmlNamespaces' => [
],

View file

@ -452,15 +452,6 @@ class HTMLForm extends ContextSource {
) {
$this->setContext( $context );
$this->mMessagePrefix = $messagePrefix;
// Evil hack for mobile :(
if (
!$this->getConfig()->get( MainConfigNames::HTMLFormAllowTableFormat )
&& $this->displayFormat === 'table'
) {
$this->displayFormat = 'div';
}
$this->addFields( $descriptor );
}
@ -551,12 +542,6 @@ class HTMLForm extends ContextSource {
) );
}
// Evil hack for mobile :(
if ( !$this->getConfig()->get( MainConfigNames::HTMLFormAllowTableFormat ) &&
$format === 'table' ) {
$format = 'div';
}
$this->displayFormat = $format;
return $this;

View file

@ -3,11 +3,9 @@
namespace MediaWiki\Tests\Integration\HTMLForm;
use LogicException;
use MediaWiki\Config\HashConfig;
use MediaWiki\Context\RequestContext;
use MediaWiki\HTMLForm\HTMLForm;
use MediaWiki\Language\RawMessage;
use MediaWiki\MainConfigNames;
use MediaWiki\Output\OutputPage;
use MediaWiki\Request\FauxRequest;
use MediaWiki\Status\Status;
@ -160,7 +158,6 @@ class HTMLFormTest extends MediaWikiIntegrationTestCase {
return $tokens && isset( $tokens[$salt] ) && $tokens[$salt] === $token;
} );
$context = $this->createConfiguredMock( RequestContext::class, [
'getConfig' => new HashConfig( [ MainConfigNames::HTMLFormAllowTableFormat => true ] ),
'getRequest' => new FauxRequest( $requestData, true ),
'getUser' => $user,
] );