MDL-64441 badges: Remove notice when language is empty
authorSara Arjona <sara@moodle.com>
Wed, 19 Dec 2018 07:33:50 +0000 (08:33 +0100)
committerSara Arjona <sara@moodle.com>
Thu, 20 Dec 2018 15:20:05 +0000 (16:20 +0100)
badges/renderer.php

index 998e091..b88d940 100644 (file)
@@ -351,7 +351,9 @@ class core_badges_renderer extends plugin_renderer_base {
         if (!empty($badge->version)) {
             $dl[get_string('version', 'badges')] = $badge->version;
         }
-        $dl[get_string('language')] = $languages[$badge->language];
+        if (!empty($badge->language)) {
+            $dl[get_string('language')] = $languages[$badge->language];
+        }
         $dl[get_string('description', 'badges')] = $badge->description;
         if (!empty($badge->imageauthorname)) {
             $dl[get_string('imageauthorname', 'badges')] = $badge->imageauthorname;