CMS MADE SIMPLE FORGE

CGFEURegister

 

[#12214] Fatal error on date type fields

avatar
Created By: Mathieu Muths (airelibre) (airelibre)
Date Submitted: Fri Dec 13 09:41:16 -0500 2019

Assigned To: Robert Campbell (calguy1000)
Version: 1.0.3
CMSMS Version: 2.2.13
Severity: None
Resolution: Fixed
State: Open
Summary:
Fatal error on date type fields
Detailed Description:
When trying to submit a registration form with a date type field, I got a fatal
error about cge_param::get_date complaining about the "$key" variable type which
is supposed to be: "areinf"

I changed CGExtensions/lib/class.cge_param.php line 242 from :
public static function get_date($params,areinf $key,$dflt = null)

To :
public static function get_date($params, $key, $dflt = null)

(removed "areinf" for which I didn't find any other reference in the code, so
maybe a typo error?)


Then, in CGFEUReg, I got another error related to the with() method.
In lib/class.RegistrationManager.php line 248 I changed:
case 8:    // date
                if( cge_param::exists($formdata, $field->name.'Month') ) {
$user = $user->with(cge_param::get_separated_date($formdata,
$field->name));
                } else {
$user = $user->with(strtotime(cge_param::get_date($formdata,
$field->name)));
                }
                break;
            }

To :
case 8:    // date
                if( cge_param::exists($formdata, $field->name.'Month') ) {
$user = $user->with($field->name,
cge_param::get_separated_date($formdata, $field->name));
                } else {
$user = $user->with($field->name,
strtotime(cge_param::get_date($formdata, $field->name)));
                }
                break;
            }


> changed the first param of the "with" functions calls



History

Comments
avatar
Date: 2019-12-13 12:38
Posted By: Robert Campbell (calguy1000)

Fixed both things in SVN, thanks
      
Updates

Updated: 2019-12-13 12:39
resolution_id: 5 => 7

Updated: 2019-12-13 12:38
resolution_id: => 5