Nikerabbit has uploaded a new change for review.

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


Change subject: Some bandage to avoid fatal errors in non-TUX
......................................................................

Some bandage to avoid fatal errors in non-TUX

Bug: 44137
Change-Id: If4f11abcf4c571b43be901b801321e7a032a4b63
---
M utils/TranslationEditPage.php
1 file changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/35/54335/1

diff --git a/utils/TranslationEditPage.php b/utils/TranslationEditPage.php
index ff52e9a..8a3b029 100644
--- a/utils/TranslationEditPage.php
+++ b/utils/TranslationEditPage.php
@@ -86,7 +86,14 @@
                        return;
                }
 
-               $translation = $helpers->getTranslation();
+               $handle = new MessageHandle( $this->getTitle() );
+               $groupId = MessageIndex::getPrimaryGroupId( $handle );
+
+               $translatio = '';
+               if ( $groupId ) {
+                       $translation = $helpers->getTranslation();
+               }
+
                $targetLang = Language::factory( $helpers->getTargetLanguage() 
);
                $textareaParams = array(
                        'name' => 'text',
@@ -98,7 +105,7 @@
                        'dir' => $targetLang->getDir(),
                );
 
-               if ( !$wgUser->isAllowed( 'translate' ) ) {
+               if ( $groupId || !$wgUser->isAllowed( 'translate' ) ) {
                        $textareaParams['readonly'] = 'readonly';
                }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4f11abcf4c571b43be901b801321e7a032a4b63
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>

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

Reply via email to