Default Values shows Invalid value while editing a filed in studio in suitecrm7.13.0

Hello All,

Recently we have upgraded the suitecrm version from 7.10.x to 7.13.0. There a few fields in modules which have default values .When saving a record , there is an error at filed level saying Invalid value. This is happening for standard functinality too. The same error is showing for the listview items per page in System settings and even in studio also.Please refere to the attached screenshot for the reference.

suitecrm version : 7.13.0
PHP version : 8.0
Apache server.

Note: No fatal errors showing up in the PHP error logs and suitecrm logs

Your help is appreciated.

I have a vague idea that this is solved in the newer versions, but I am not sure, can someone confirm?

Check out this one;

Hai @pgr , @rsp Thank you for the replies. @rsp , the issue you posted is not relevant to mine . In my case , this is happening for every module which have the default values defined for the fileds (enum,text,percentage) and not allowing the record to save, and displaying the filed error as ‘Invalid value’. I am clueless why this is happening.

Any suggestions pls.

7.14 version studio works fine when there is an integer field with a default value. There are no error when the default , min , max values are set for the field in the studio, the field definition gets saved.
But the default values are not displayed in edit mode and not saved in the database when the field left blank while saving the record.

I made the following code in include/EditView/EditView2.php, the field shows the default value when the user value is empty while creating new record or editing the existing one.

foreach ($this->fieldDefs as $name => $defs) {
     if (empty($this->fieldDefs[$name]['value']) && !empty($defs['default'])) {
        $this->fieldDefs[$name]['value'] = $defs['default'];
     }
 }

The code looks something like this

Please note that this is not thoroughly tested and needs testing with many test cases and scenarios.

1 Like

Thank you @Harshad . Sorry for the late reply. I have tried your suggestion. It didnot work for my issue. The issue still persists.

Kindly let me know any other suggestions. The root cause is not yet found.

I was getting an same error for the float field.

I added two zeroes after decimal(.) and it worked.

For example,

default value: 18.00