Skip to content

Commit

Permalink
Fix SQL error invalid input syntax for type integer: ""
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisjacquet committed Jul 28, 2023
1 parent 076b080 commit 6a17caa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Changes in 11.1
- Fix SQL error null value in column "student_id" in Eligibility/Student.php
- Fix SQL error Unknown column 'a.ADDRESS' in 'where clause' in Percent.php
- CSS Fix PDF Frame background when multiple pages in HonorRoll.fnc.php
- Fix SQL error invalid input syntax for type integer: "" in Registration.fnc.php & RegistrationSave.fnc.php

Changes in 11.0.2
-----------------
Expand Down
18 changes: 14 additions & 4 deletions modules/Custom/includes/Registration.fnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function RegistrationContact( $name, $contact )
echo '</td></tr>';
}

if ( ! empty( $contact['fields'] ) )
if ( ! empty( trim( $contact['fields'], '||' ) ) )
{
echo '<tr><td>';

Expand Down Expand Up @@ -357,7 +357,12 @@ function RegistrationContactFields( $name, $categories )
global $request,
$field;

$category_ids = "'" . str_replace( '||', "','", trim( $categories, '||' ) ) . "'";
$category_ids = "'0'";

if ( trim( $categories, '||' ) )
{
$category_ids = "'" . str_replace( '||', "','", trim( $categories, '||' ) ) . "'";
}

$request = $name . '[fields]';

Expand Down Expand Up @@ -398,7 +403,7 @@ function RegistrationYourAddress( $address )

RegistrationAddress( 'address' );

if ( ! empty( $address['fields'] ) )
if ( ! empty( trim( $address['fields'], '||' ) ) )
{
echo '</td></tr><tr><td>';

Expand All @@ -425,7 +430,12 @@ function RegistrationAddressFields( $name, $categories )
global $request,
$field;

$category_ids = "'" . str_replace( '||', "','", trim( $categories, '||' ) ) . "'";
$category_ids = "'0'";

if ( trim( $categories, '||' ) )
{
$category_ids = "'" . str_replace( '||', "','", trim( $categories, '||' ) ) . "'";
}

$request = $name . '[fields]';

Expand Down
1 change: 1 addition & 0 deletions modules/Custom/includes/RegistrationSave.fnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ function RegistrationSaveStudent( $config, $values )
global $FileUploadsPath;

if ( ! $config['fields']
|| ! trim( $config['fields'], '||' )
|| ! $values )
{
return false;
Expand Down

0 comments on commit 6a17caa

Please sign in to comment.