diff --git a/ProgramFunctions/StudentsUsersInfo.fnc.php b/ProgramFunctions/StudentsUsersInfo.fnc.php index ed5320077..b68ea58b4 100644 --- a/ProgramFunctions/StudentsUsersInfo.fnc.php +++ b/ProgramFunctions/StudentsUsersInfo.fnc.php @@ -55,7 +55,7 @@ function _makeTextInput( $column, $name, $request ) $options .= $field['REQUIRED'] === 'Y' ? ' required' : ''; return TextInput( - $value[ $column ], + issetVal( $value[ $column ], '' ), $request . '[' . $column . ']', $name, $options, @@ -102,7 +102,7 @@ function _makeDateInput( $column, $name, $request ) } return DateInput( - $value[ $column ], + issetVal( $value[ $column ], '' ), $request . '[' . $column . ']', $name, $div, @@ -165,7 +165,7 @@ function _makeSelectInput( $column, $name, $request ) $extra = ( $field['REQUIRED'] === 'Y' ? 'required': '' ); return SelectInput( - $value[ $column ], + issetVal( $value[ $column ], '' ), $request . '[' . $column . ']', $name, $options, diff --git a/functions/ErrorMessage.fnc.php b/functions/ErrorMessage.fnc.php index 1330d413b..eb8da80d9 100644 --- a/functions/ErrorMessage.fnc.php +++ b/functions/ErrorMessage.fnc.php @@ -65,7 +65,8 @@ function ErrorMessage( $errors, $code = 'error' ) if ( count( $errors ) === 1 ) { - $return .= ': ' . issetVal( $errors[0], $errors[1] ) . '

'; + // Note: do not use issetVal() here. + $return .= ': ' . ( isset( $errors[0] ) ? $errors[0] : $errors[1] ) . '

'; } // More than one error: list. diff --git a/functions/GetGrade.fnc.php b/functions/GetGrade.fnc.php index 0c5584c3c..6a09ebe52 100644 --- a/functions/GetGrade.fnc.php +++ b/functions/GetGrade.fnc.php @@ -32,6 +32,11 @@ function GetGrade( $grade, $column = 'TITLE' ) FROM SCHOOL_GRADELEVELS", array(), array( 'ID' ) ); } + if ( ! isset( $grades[ $grade ] ) ) + { + return ''; + } + $extra = ''; if ( $column === 'TITLE' ) diff --git a/functions/GetStaffList.fnc.php b/functions/GetStaffList.fnc.php index beed0c289..1f3749ba5 100644 --- a/functions/GetStaffList.fnc.php +++ b/functions/GetStaffList.fnc.php @@ -317,7 +317,7 @@ function appendStaffSQL( $sql, $extra = array() ) ); } - if ( $extra['profile'] ) + if ( ! empty( $extra['profile'] ) ) { $options = array( $extra['profile'] => $options[ $extra['profile'] ] ); } diff --git a/functions/ListOutput.fnc.php b/functions/ListOutput.fnc.php index eac4c2c9c..5706327d1 100644 --- a/functions/ListOutput.fnc.php +++ b/functions/ListOutput.fnc.php @@ -818,7 +818,7 @@ class="button" alt="" title="' . htmlspecialchars( _( 'Search' ), ENT_QUOTES ) . foreach ( (array) $column_names as $key => $value ) { - echo '' . $link['add']['html'][$key] . ''; + echo '' . issetVal( $link['add']['html'][$key], '' ) . ''; } echo ''; diff --git a/index.php b/index.php index 6a774d841..d15607fbe 100644 --- a/index.php +++ b/index.php @@ -289,6 +289,13 @@ } else { + if ( ! isset( $_REQUEST['modfunc'] ) ) + { + $_REQUEST['modfunc'] = false; + } + + $_REQUEST['modname'] = false; + $_ROSARIO['page'] = 'create-account'; Warehouse( 'header' ); @@ -440,7 +447,10 @@ - +