Kaynağa Gözat

Merge branch '1.11.x' of https://github.com/chamilo/chamilo-lms into 1.11.x

Alex Aragon 8 yıl önce
ebeveyn
işleme
e665aae7fc
2 değiştirilmiş dosya ile 19 ekleme ve 2 silme
  1. 12 1
      main/admin/skill_create.php
  2. 7 1
      tests/README.md

+ 12 - 1
main/admin/skill_create.php

@@ -46,7 +46,18 @@ if ($skillParentId > 0) {
 $allSkills = $objSkill->get_all();
 $allGradebooks = $objGradebook->find('all');
 
-$skillList = [0 => get_lang('None')];
+// This procedure is for check if there is already a Skill with no Parent (Root by default)
+
+$isAlreadyRootSkill = false;
+
+foreach ($allSkills as $checkedSkill) {
+    if (intval($checkedSkill['parent_id']) > 0) {
+        $isAlreadyRootSkill = true;
+        break;
+    }
+}
+
+$skillList = $isAlreadyRootSkill ? [] : [0 => get_lang('None')];
 $gradebookList = [];
 
 foreach ($allSkills as $skill) {

+ 7 - 1
tests/README.md

@@ -12,7 +12,13 @@ which should include the vendor/behat/behat/bin/behat executable.
 Make sure you set the right base_url in behat.yml, then run (on the command
 line, from the tests/ directory): 
 ```
-../vendor/behat/behat/bin/behat -v
+../vendor/behat/behat/bin/behat features/login.feature
+../vendor/behat/behat/bin/behat features/createUser.feature
+../vendor/behat/behat/bin/behat features/createCourse.feature
+../vendor/behat/behat/bin/behat features/courseTools.feature
+../vendor/behat/behat/bin/behat features/forum.feature
+../vendor/behat/behat/bin/behat features/socialGroup.feature
+../vendor/behat/behat/bin/behat features/accessCompanyReports.feature
 ```
 
 This should run all tests and all of them should pass.