Fix NOTICE messages caused by undefined indexes

1.10.x
Yannick Warnier 10 years ago
parent 074927729c
commit 1f49d03571
  1. 2
      main/admin/skills_import.php
  2. 4
      main/inc/lib/skill.lib.php

@ -190,7 +190,7 @@ if ($_POST['formSent'] AND $_FILES['import_file']['size'] !== 0) {
if (is_array($skills)) { if (is_array($skills)) {
foreach ($skills as $my_skill) { foreach ($skills as $my_skill) {
if (!in_array($my_skill['SkillName'], $skill_id_error)) { if (isset($my_skill['SkillName']) && !in_array($my_skill['SkillName'], $skill_id_error)) {
$skills_to_insert[] = $my_skill; $skills_to_insert[] = $my_skill;
} }
} }

@ -613,7 +613,7 @@ class Skill extends Model
$attributes = array( $attributes = array(
'skill_id' => $skill_id, 'skill_id' => $skill_id,
'parent_id' => $parent_id, 'parent_id' => $parent_id,
'relation_type' => $params['relation_type'], 'relation_type' => (isset($params['relation_type'])?$params['relation_type']:0),
//'level' => $params['level'], //'level' => $params['level'],
); );
$skill_rel_skill->save($attributes); $skill_rel_skill->save($attributes);
@ -1030,7 +1030,7 @@ class Skill extends Model
* @param int $skillId The skill id * @param int $skillId The skill id
* @param int $courseId Optional. The course id * @param int $courseId Optional. The course id
* @param int $sessionId Optional. The session id * @param int $sessionId Optional. The session id
* @return boolean Wheter the user has the skill return true. Otherwise return false * @return boolean Whether the user has the skill return true. Otherwise return false
*/ */
public function user_has_skill($userId, $skillId, $courseId = 0, $sessionId = 0) public function user_has_skill($userId, $skillId, $courseId = 0, $sessionId = 0)
{ {

Loading…
Cancel
Save