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

Change subject: Parse intro messages
......................................................................


Parse intro messages

https://www.wikidata.org/wiki/Special:SetAliases shows a plain
<code>|<code>

<s>UNTESTED patch</s>

Switched to rawElement, which should be safe as the message is
fully parsed.

Not sure if this message really belong inside the form box, it
seems a little odd. Perhaps we should use a better layout so we
don't have to add this message.

Change-Id: I972e86d576d4525f6c76cdf8de4c7c5f55fdece5
---
M repo/Wikibase.i18n.php
M repo/includes/specials/SpecialSetEntity.php
2 files changed, 22 insertions(+), 15 deletions(-)

Approvals:
  John Erling Blad: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/Wikibase.i18n.php b/repo/Wikibase.i18n.php
index 102c09b..d68f9b8 100644
--- a/repo/Wikibase.i18n.php
+++ b/repo/Wikibase.i18n.php
@@ -160,8 +160,8 @@
        'wikibase-setdescription-submit' => 'Set the description',
        'wikibase-setdescription-warning-remove' => 'Do you really want to 
remove the description of [[$1]]?',
        'special-setaliases' => 'Set aliases',
-       'wikibase-setaliases-introfull' => 'You are setting the aliases in $2 
for [[$1]]. Several aliases are separated by <code>|</code>.',
-       'wikibase-setaliases-intro' => 'This form allows you to set the aliases 
of an entity. You need to provide the ID of the entity (e.g. Q23), a language 
code (e.g. "en") and the aliases to set to. Several aliases are separated by 
<code>|</code>.',
+       'wikibase-setaliases-introfull' => 'You are setting the aliases in $2 
for [[$1]]. Several aliases are separated by a pipe (<code>|</code>) 
character.',
+       'wikibase-setaliases-intro' => 'This form allows you to set the aliases 
of an entity. You need to provide the ID of the entity (e.g. Q23), a language  
code (e.g. "en") and the aliases to set to. Several aliases are separated by a 
pipe (<code>|</code>) character.',
        'wikibase-setaliases-label' => 'Aliases:',
        'wikibase-setaliases-submit' => 'Set the aliases',
        'wikibase-setaliases-warning-remove' => 'Do you really want to remove 
all aliases of [[$1]]?',
diff --git a/repo/includes/specials/SpecialSetEntity.php 
b/repo/includes/specials/SpecialSetEntity.php
index f72acd9..d58e1b8 100644
--- a/repo/includes/specials/SpecialSetEntity.php
+++ b/repo/includes/specials/SpecialSetEntity.php
@@ -172,6 +172,25 @@
                        $value = $this->getValue( $entityContent, $language );
                }
 
+               if ( ( $entityContent !== null ) && ( $language !== null ) ) {
+                       $this->getOutput()->addHTML(
+                               Html::rawElement(
+                                       'p',
+                                       array(),
+                                       $this->getIntrofull( $entityContent, 
$language )
+                               )
+                       );
+               }
+               else {
+                       $this->getOutput()->addHTML(
+                               Html::rawElement(
+                                       'p',
+                                       array(),
+                                       $this->msg( 'wikibase-' . strtolower( 
$this->getName() ) . '-intro' )->parse()
+                               )
+                       );
+               }
+
                $this->getOutput()->addHTML(
                        Html::openElement(
                                'form',
@@ -195,13 +214,6 @@
                );
 
                if ( ( $entityContent !== null ) && ( $language !== null ) ) {
-                       $this->getOutput()->addHtml(
-                               Html::rawElement(
-                                       'p',
-                                       array(),
-                                       $this->getIntrofull( $entityContent, 
$language )
-                               )
-                       );
                        $this->getOutput()->addHTML(
                                Html::input( 'language', $language, 'hidden' )
                                . Html::input( 'id', 
$entityContent->getTitle()->getText(), 'hidden' )
@@ -211,12 +223,7 @@
                        $id = $entityContent ? 
$entityContent->getTitle()->getText() : '';
                        $value = $this->getValue( $entityContent, $language ? 
$language : $this->getLanguage()->getCode() );
                        $this->getOutput()->addHTML(
-                               Html::rawElement(
-                                       'p',
-                                       array(),
-                                       $this->msg( 'wikibase-' . strtolower( 
$this->getName() ) . '-intro' )->parse()
-                               )
-                               . Html::element(
+                               Html::element(
                                        'label',
                                        array(
                                                'for' => 'wb-setentity-id',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I972e86d576d4525f6c76cdf8de4c7c5f55fdece5
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking <[email protected]>
Gerrit-Reviewer: Anja Jentzsch <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Denny Vrandecic <[email protected]>
Gerrit-Reviewer: John Erling Blad <[email protected]>
Gerrit-Reviewer: Raimond Spekking <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to