Bene has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/203540

Change subject: Show the value on Special:SetLabel etc if none is entered
......................................................................

Show the value on Special:SetLabel etc if none is entered

When only an item id and a language are entered, just show
the label/description or aliases instead of showing a warning.
This way the user sees the value, can check it and remove it
if necessary. It prevents users from accidentally removing terms
and is more intuitive as the user actually empties a text field
to remove a value instead of just submitting an already empty one.

Change-Id: I22d44c897700cb796f45d83a52d9e94cef96b1e7
---
M repo/i18n/en.json
M repo/includes/specials/SpecialModifyTerm.php
2 files changed, 4 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/40/203540/1

diff --git a/repo/i18n/en.json b/repo/i18n/en.json
index 71e8bd6..8ca930e 100644
--- a/repo/i18n/en.json
+++ b/repo/i18n/en.json
@@ -169,19 +169,16 @@
        "wikibase-setlabel-intro": "This form allows you to set the label of an 
entity. You need to provide the id of the entity (e.g. Q23), a language code 
(e.g. \"en\") and the label to set to.",
        "wikibase-setlabel-label": "Label:",
        "wikibase-setlabel-submit": "Set label",
-       "wikibase-setlabel-warning-remove": "Do you really want to remove the 
label of [[$1]]?",
        "special-setdescription": "Set a description",
        "wikibase-setdescription-introfull": "You are setting the description 
in $2 for [[$1]].",
        "wikibase-setdescription-intro": "This form allows you to set the 
description of an entity. You need to provide the id of the entity (e.g. Q23), 
a language code (e.g. \"en\") and the description to set to.",
        "wikibase-setdescription-label": "Description:",
        "wikibase-setdescription-submit": "Set 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 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 aliases",
-       "wikibase-setaliases-warning-remove": "Do you really want to remove all 
aliases of [[$1]]?",
        "special-setlabeldescriptionaliases": "Set label, description and 
aliases",
        "wikibase-setlabeldescriptionaliases-introfull": "You are setting 
label, description and aliases in $2 for [[$1]]. Several aliases are separated 
by a pipe (<code>|</code>) character.",
        "wikibase-setlabeldescriptionaliases-intro": "This form allows you to 
set label, description and aliases of an entity. You need to first provide the 
id of the entity (e.g. Q23) and a language code (e.g. \"en\").",
diff --git a/repo/includes/specials/SpecialModifyTerm.php 
b/repo/includes/specials/SpecialModifyTerm.php
index bf304c5..4914573 100644
--- a/repo/includes/specials/SpecialModifyTerm.php
+++ b/repo/includes/specials/SpecialModifyTerm.php
@@ -125,19 +125,11 @@
                        return false;
                }
 
-               // to provide removing after posting the full form
+               // If the user just enters an item id and a language, dont 
remove the term.
+               // The user can remove the term in the second form where it has 
to be
+               // actually removed. This prevents users from removing terms 
accidentally.
                if ( $request->getVal( 'remove' ) === null && $this->value === 
'' ) {
-                       $id = $this->entityRevision->getEntity()->getId();
-
-                       $this->showErrorHTML(
-                       // Messages: wikibase-setlabel-warning-remove, 
wikibase-setdescription-warning-remove,
-                       // wikibase-setaliases-warning-remove
-                               $this->msg(
-                                       'wikibase-' . strtolower( 
$this->getName() ) . '-warning-remove',
-                                       $this->getEntityTitle( $id )->getText()
-                               )->parse(),
-                               'warning'
-                       );
+                       $this->value = null;
                        return false;
                }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I22d44c897700cb796f45d83a52d9e94cef96b1e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene <benestar.wikime...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to