jenkins-bot has submitted this change and it was merged.

Change subject: OOUIHTMLForm: Make setting 'readonly' on a text field actually 
work
......................................................................


OOUIHTMLForm: Make setting 'readonly' on a text field actually work

Previously 'readOnly' was set to an empty string, which casts to boolean
false.

Change-Id: I7d1e7f02731c7235da2ae1e0a5e3d0be2b44d978
---
M includes/htmlform/HTMLTextField.php
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/htmlform/HTMLTextField.php 
b/includes/htmlform/HTMLTextField.php
index 9c5b868..5c04ee2 100644
--- a/includes/htmlform/HTMLTextField.php
+++ b/includes/htmlform/HTMLTextField.php
@@ -113,6 +113,11 @@
                        'tabindex' => 'tabIndex',
                ) );
 
+               if ( isset( $attribs['readOnly'] ) ) {
+                       // This needs to be set to a boolean value
+                       $attribs['readOnly'] = true;
+               }
+
                $type = $this->getType( $attribs );
 
                return new OOUI\TextInputWidget( array(

-- 
To view, visit https://gerrit.wikimedia.org/r/221973
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d1e7f02731c7235da2ae1e0a5e3d0be2b44d978
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to