Skip to content

Commit

Permalink
Fix SQL error value too long, add input maxlength
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisjacquet committed Jan 26, 2025
1 parent 90d548c commit 063b5fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Changes in 12.1.2
- Fix PHP warning when updating course period teacher in Moodle/functions.php & Moodle/Scheduling/Courses.php
- Fix enrol teacher into course instead of just assigning teacher role in Moodle/functions.php, Moodle/Scheduling/Courses.php & Moodle/School_Setup/Rollover.php
- MySQL fix You can't specify target table 'ac' for update in FROM clause in Courses.fnc.php
- Fix Moodle error Short name is already used for another course in Moodle/Scheduling/Courses.php & Moodle/School_Setup/Rollover.php
- Fix Moodle error Short name is already used for another course in Moodle/functions.php, Moodle/Scheduling/Courses.php & Moodle/School_Setup/Rollover.php
- Fix SQL error value too long, add input maxlength in StudentsUsersInfo.fnc.php

Changes in 12.1.1
-----------------
Expand Down
7 changes: 6 additions & 1 deletion ProgramFunctions/StudentsUsersInfo.fnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ function _makeDate( $value, $column = 'MEDICAL_DATE' )
*
* @since 3.6 Add custom input size per column.
* @since 11.3 Required TITLE value for existing entries
* @since 12.1.2 Fix SQL error value too long, add input maxlength
*
* @global array $THIS_RET
* @global string $table
Expand All @@ -801,10 +802,14 @@ function _makeComments( $value, $column )

$input_size = 12;

$input_maxlength = 100;

if ( $column === 'TIME_IN'
|| $column === 'TIME_OUT' )
{
$input_size = 5;

$input_maxlength = 20;
}
elseif ( $column === 'COMMENTS'
|| $column === 'TITLE' )
Expand All @@ -824,7 +829,7 @@ function _makeComments( $value, $column )
$value,
'values[' . $table . '][' . $THIS_RET['ID'] . '][' . $column . ']',
'',
'size="' . AttrEscape( $input_size ) . '"' . $required
'size="' . AttrEscape( $input_size ) . '" maxlength="' . AttrEscape( $input_maxlength ) . '"' . $required
);
}

Expand Down

0 comments on commit 063b5fc

Please sign in to comment.