Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -84,15 +84,20 @@ |
85 | 85 | $logger = new LogPage( 'pagetranslation' ); |
86 | 86 | $params = array( 'user' => $wgUser->getName() ); |
87 | 87 | |
88 | | - if ( $action === 'encourage' ) { |
| 88 | + $priority = MessageGroups::getPriority( $id ); |
| 89 | + |
| 90 | + // encouraged is default priority (''). Only do this if the priority is discouraged. |
| 91 | + if ( $action === 'encourage' && $priority === 'discouraged' ) { |
89 | 92 | $dbw->delete( $table, $row, __METHOD__ ); |
90 | | - // @todo Check if page is currently actually encouraged to prevent duplicate log entries. |
91 | 93 | $logger->addEntry( 'encourage', $title, null, array( serialize( $params ) ) ); |
92 | 94 | } else { |
93 | 95 | $index = array( 'tgr_group', 'tgr_lang' ); |
94 | 96 | $dbw->replace( $table, array( $index ), $row, __METHOD__ ); |
95 | | - // @todo Check if page is currently actually discouraged to prevent duplicate log entries. |
96 | | - $logger->addEntry( 'discourage', $title, null, array( serialize( $params ) ) ); |
| 97 | + |
| 98 | + // Prevent duplicate log entries. |
| 99 | + if( $priority !== 'discouraged' ) { |
| 100 | + $logger->addEntry( 'discourage', $title, null, array( serialize( $params ) ) ); |
| 101 | + } |
97 | 102 | } |
98 | 103 | |
99 | 104 | $this->listPages(); |