Best practice forum (Archived)

Totara sync empty custom user date field error

 
? ?
Totara sync empty custom user date field error
by ? ? - Thursday, 26 December 2013, 8:26 AM
 

When importing data in to a custom user profile date field via Totara Sync, there is an error if the date in the user.csv source file is empty. I think that Totara Sync should allow an empty field, such as it does for other field types. Errors listed below:

(Totara 2.5.2)

PHP Warning: date() expects parameter 2 to be long, string given in /Sites/totara25/user/profile/field/datetime/field.class.php on line 55

Warning: date() expects parameter 2 to be long, string given in /Sites/totara25/user/profile/field/datetime/field.class.php on line 55
PHP Notice: Undefined offset: 1 in /Sites/totara25/user/profile/field/datetime/field.class.php on line 64

Notice: Undefined offset: 1 in /Sites/totara25/user/profile/field/datetime/field.class.php on line 64
PHP Notice: Undefined offset: 2 in /Sites/totara25/user/profile/field/datetime/field.class.php on line 64

Notice: Undefined offset: 2 in /Sites/totara25/user/profile/field/datetime/field.class.php on line 64

So it would appear that Totara is passing an empty string to the date function, when perhaps it would be more appropriate so skip a call to the date function and just set the custom date field to blank if there is already a date, or don't set a date at all if there is currently no date set on the custom user profile data field.

me
Re: Totara sync empty custom user date field error
by George Angus - Thursday, 26 December 2013, 12:16 PM
Group Totara

Hi Jamie,

This has been fixed in 2.5.3 

regards,

George.

? ?
Re: Totara sync empty custom user date field error
by ? ? - Friday, 27 December 2013, 10:03 AM
 

Thanks George!