Skip to content

Commit

Permalink
Bugfix photo name when assign student ID with leading 000 bis
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisjacquet committed Sep 10, 2015
1 parent 1cb2404 commit 4c72508
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions modules/Students/Student.php
Expand Up @@ -202,15 +202,19 @@
}
elseif (!isset($error)) //new student
{
if ( ( $student_id = filter_input( INPUT_POST, 'assign_student_id', FILTER_VALIDATE_INT ) ) > 0 )
if ( isset( $_REQUEST['assign_student_id'] )
&& $_REQUEST['assign_student_id'] !== '' )
{
if(count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='".$student_id."'"))))
if ( ( $student_id = filter_input( INPUT_POST, 'assign_student_id', FILTER_VALIDATE_INT ) ) > 0 )
{
$error[] = sprintf(_('That %s ID is already taken. Please select a different one.'),Config('NAME'));
if(count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='".$student_id."'"))))
{
$error[] = sprintf(_('That %s ID is already taken. Please select a different one.'),Config('NAME'));
}
}
else
$error[] = _('Please enter valid Numeric data.');
}
else
$error[] = _('Please enter valid Numeric data.');

//hook
do_action('Students/Student.php|create_student_checks');
Expand Down

0 comments on commit 4c72508

Please sign in to comment.