Time Type field is not saved and Generate Fatal error

Hello Everyone,

In Suitecrm Older version I have created a custom field using “time” type.
When I upgrade suitecrm to 7.11.7 version then due to this field type I am facing 500 fatal error into PHP error log.

[b] [client ::1:52034] PHP Warning:  Declaration of SugarFieldTime::save(&$bean, &$inputData, &$field, &$def, $prefix = '') should be compatible with SugarFieldBase::save(&$bean, $params, $field, $properties, $prefix = '') in /var/www/html/crm/include/SugarFields/Fields/Time/SugarFieldTime.php on line 0, referer: https://localhost/crm/index.php?module=master_shift&action=EditView&return_module=master_shift&return_action=DetailView
 [client ::1:52034] PHP Fatal error:  Uncaught Error: Cannot pass parameter 2 by reference in /var/www/html/crm/include/MVC/Controller/SugarController.php:649\nStack trace:\n#0 /var/www/html/crm/include/MVC/Controller/SugarController.php(504): SugarController->pre_save()\n#1 /var/www/html/crm/include/MVC/Controller/SugarController.php(491): SugarController->pre_action()\n#2 /var/www/html/crm/include/MVC/Controller/SugarController.php(466): SugarController->handle_action()\n#3 /var/www/html/crm/include/MVC/Controller/SugarController.php(361): SugarController->process()\n#4 /var/www/html/crm/include/MVC/SugarApplication.php(112): SugarController->execute()\n#5 /var/www/html/crm/index.php(52): SugarApplication->execute()\n#6 {main}\n  thrown in /var/www/html/crm/include/MVC/Controller/SugarController.php on line 649, referer: https://localhost/crm/index.php?module=master_shift&action=EditView&return_module=master_shift&return_action=DetailView
[/b]

When I change the type to “varchar” into Vardef file then a record will save.
Please give me an idea for this issue

You have to adjust the parameter types to fit the changes in the parent class.

Please share the complete code of your customizations if you need help with that.

Ok.
I am using following code for create time type fields.


'time_from' => array(
			'name' => 'time_from',
			'vname' => 'LBL_TIME_FROM',
			'type' => 'time',
			'required' => false,
			'reportable' => false,
		),

If I am putting this code in Account then It is working. But same code is not working for Document Module Or my Custom module.

Now, What is the difference between both vardefs or backend Logic?

Can you please open a new issue with this on Github?

https://github.com/salesagility/SuiteCRM/issues/

If you didn’t change code, only vardefs, then it should be working, I guess…

I have created a new issue on git. Please give me an update

“Time Type field is not saved and Generate Fatal error #7983.”

1 Like