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

Change subject: Use specific summary lines in SpecialSetLabelDescriptionAliases
......................................................................


Use specific summary lines in SpecialSetLabelDescriptionAliases

This simply uses the old messages if only 1 field was changed. The
actual "change" detection is the most simple possible. I think this
is enough.

Bug: T93853
Change-Id: I6cdbd3e3dd7b1a5b9c4710d544a993b3341d1849
---
M repo/includes/specials/SpecialSetLabelDescriptionAliases.php
1 file changed, 24 insertions(+), 13 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  Hoo man: Looks good to me, approved
  jenkins-bot: Verified

Objections:
  Daniel Kinzler: There's a problem with this change, please improve



diff --git a/repo/includes/specials/SpecialSetLabelDescriptionAliases.php 
b/repo/includes/specials/SpecialSetLabelDescriptionAliases.php
index 73bff9b..db2bd58 100644
--- a/repo/includes/specials/SpecialSetLabelDescriptionAliases.php
+++ b/repo/includes/specials/SpecialSetLabelDescriptionAliases.php
@@ -334,10 +334,14 @@
                $changeOps = array();
 
                if ( $this->label !== '' ) {
-                       $changeOps['wbsetlabel'] = 
$changeOpFactory->newSetLabelOp(
-                               $this->languageCode,
-                               $this->label
-                       );
+                       if ( !$fingerprint->hasLabel( $this->languageCode )
+                               || $fingerprint->getLabel( $this->languageCode 
)->getText() !== $this->label
+                       ) {
+                               $changeOps['wbsetlabel'] = 
$changeOpFactory->newSetLabelOp(
+                                       $this->languageCode,
+                                       $this->label
+                               );
+                       }
                } elseif ( $fingerprint->hasLabel( $this->languageCode ) ) {
                        $changeOps['wbsetlabel'] = 
$changeOpFactory->newRemoveLabelOp(
                                $this->languageCode
@@ -345,10 +349,14 @@
                }
 
                if ( $this->description !== '' ) {
-                       $changeOps['wbsetdescription'] = 
$changeOpFactory->newSetDescriptionOp(
-                               $this->languageCode,
-                               $this->description
-                       );
+                       if ( !$fingerprint->hasDescription( $this->languageCode 
)
+                               || $fingerprint->getDescription( 
$this->languageCode )->getText() !== $this->description
+                       ) {
+                               $changeOps['wbsetdescription'] = 
$changeOpFactory->newSetDescriptionOp(
+                                       $this->languageCode,
+                                       $this->description
+                               );
+                       }
                } elseif ( $fingerprint->hasDescription( $this->languageCode ) 
) {
                        $changeOps['wbsetdescription'] = 
$changeOpFactory->newRemoveDescriptionOp(
                                $this->languageCode
@@ -356,10 +364,14 @@
                }
 
                if ( !empty( $this->aliases ) ) {
-                       $changeOps['wbsetaliases'] = 
$changeOpFactory->newSetAliasesOp(
-                               $this->languageCode,
-                               $this->aliases
-                       );
+                       if ( !$fingerprint->hasAliasGroup( $this->languageCode )
+                               || $fingerprint->getAliasGroup( 
$this->languageCode )->getAliases() !== $this->aliases
+                       ) {
+                               $changeOps['wbsetaliases'] = 
$changeOpFactory->newSetAliasesOp(
+                                       $this->languageCode,
+                                       $this->aliases
+                               );
+                       }
                } elseif ( $fingerprint->hasAliasGroup( $this->languageCode ) ) 
{
                        $changeOps['wbsetaliases'] = 
$changeOpFactory->newRemoveAliasesOp(
                                $this->languageCode,
@@ -374,7 +386,6 @@
         * @return Summary
         */
        private function getSummaryForLabelDescriptionAliases() {
-               // FIXME: Use the existing messages if only 1 of the 3 fields 
changed.
                // FIXME: Introduce more specific messages if only 2 of the 3 
fields changed.
                $summary = new Summary( 'wbsetlabeldescriptionaliases' );
                $summary->addAutoSummaryArgs( $this->label, $this->description, 
$this->aliases );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6cdbd3e3dd7b1a5b9c4710d544a993b3341d1849
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to