TheDJ has uploaded a new change for review.
https://gerrit.wikimedia.org/r/78500
Change subject: Preferences: Remove dummy labels for Checkboxes
......................................................................
Preferences: Remove dummy labels for Checkboxes
When used in table layouts, checkboxes would output an empty dummy
label in the first cell, which would block the actual label that
checkboxes add to their right side.
Change-Id: I3793d310742da52555fae2eced322c8bc2b08f6f
---
M RELEASE-NOTES-1.22
M includes/HTMLForm.php
2 files changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/00/78500/1
diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index af467a0..8eda7d3 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -253,6 +253,7 @@
adding a new topic on a page
* (bug 6200) line breaks in <blockquote> are handled like they are in <div>
* (bug 41756) Improve treatment of multiple comments on a blank line.
+* (bug 52697) Repair labels for checkboxes in preferences.
=== API changes in 1.22 ===
* (bug 25553) The JSON output formatter now leaves forward slashes unescaped
diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php
index e06a934..8b3c0cb 100644
--- a/includes/HTMLForm.php
+++ b/includes/HTMLForm.php
@@ -1543,8 +1543,12 @@
$html = '';
if ( $displayFormat === 'table' ) {
+ $htmlLabel = '';
+ if ( $hasLabel ) {
+ $htmlLabel = Html::rawElement( 'label', $for,
$labelValue );
+ };
$html = Html::rawElement( 'td', array( 'class' =>
'mw-label' ) + $cellAttributes,
- Html::rawElement( 'label', $for, $labelValue )
+ $htmlLabel
);
} elseif ( $hasLabel || $this->mShowEmptyLabels ) {
if ( $displayFormat === 'div' ) {
@@ -1852,6 +1856,9 @@
function getLabel() {
return ' ';
}
+ protected function needsLabel() {
+ return false;
+ }
/**
* @param $request WebRequest
--
To view, visit https://gerrit.wikimedia.org/r/78500
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3793d310742da52555fae2eced322c8bc2b08f6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits