Browse Source

Fix skill code translation - refs BT#13589

Angel Fernando Quiroz Campos 7 years ago
parent
commit
fa39c12d87
1 changed files with 6 additions and 3 deletions
  1. 6 3
      main/inc/lib/skill.lib.php

+ 6 - 3
main/inc/lib/skill.lib.php

@@ -1024,6 +1024,9 @@ class Skill extends Model
         if (!isset($params['parent_id'])) {
             $params['parent_id'] = 1;
         }
+
+        $params['gradebook_id'] = isset($params['gradebook_id']) ? $params['gradebook_id'] : [];
+
         $skillRelSkill = new SkillRelSkill();
         $skillRelGradebook = new SkillRelGradebook();
 
@@ -1971,9 +1974,9 @@ class Skill extends Model
         }
 
         $camelCase = 'SkillCode'.api_underscore_to_camel_case(
-                str_replace(' ', '_', $code)
-            );
+            str_replace(' ', '_', $code)
+        );
 
-        return isset($GLOBALS[$camelCase]) ? $GLOBALS[$camelCase] : '';
+        return isset($GLOBALS[$camelCase]) ? $GLOBALS[$camelCase] : $code;
     }
 }