Ver 7.10.10 to 7.10.36 workflows that create records default fields to first var in list

Dear Forum,

We have been using SuiteCRM 7.10 for about 3 years, no issues (per-se), upgraded few months to 7.10.36, again no issues (per-se) other than just noticed any workflows we created in 7.10.10 (or 7.10.36) that use a “Select Action” of CREATE RECORD, and related to a FIELD that is a value (and not another drop down etc field type) now default to the first FIELD in the list, effectively corrupting all workflows that we open, and then save.

As such, we cannot modify any workflow as it overwrites the variables wiht the first one in th elist and makes it useless. No errors in logs, nothing.

If we change the SELECT ACTION to MODIFY RECORD, no corruption takes place. Seem sto only be where CREATE RECORD is used.

Never seen this in 7.10.10 (or before). This is critical. We can finnd nothing mentioned anywhere on this, and wonder if anyone else is finding same issue, or whether it is something ebvironmental (which we feel is unilkely given the above not replicable with MODIFY action).

Most bizarre, but renders system totally useless after years of investment and trust in Suite CRM.

Anyone any similar experience or ideas as we are utterly stumped.

All best folks, LJ.

Folks, hte only clue i can see is in the error.log:

[Sun Dec 11 20:32:11.757596 2022] [php7:notice] [pid 14056:tid 1036] [client ::1:51468] PHP Notice: Undefined index: cr_oinc_base_currency_c in C:\Bitnami\suitecrm-7.10.10-0\apps\suitecrm\htdocs\modules\AOW_WorkFlow\aow_utils.php on line 946, referer: http://localhost:8080/suitecrm/index.php

cr_oinc_base_currency_c
This is the var i am referencing, but it fails to reference it, as explained above, and defaults to the first available var in the list (always).

Hope this may help others that may be experienceing simialr issues, and anyone that might be able to give any kind assistance?

And at line 946 in aow_utils.php we observe:

   switch ($bean->field_defs[$field]['type']) {
        case 'datetime':
        case 'datetimecombo':
            // If value is array, don't attempt to convert to DB format
            if (empty($value) || is_array($value)) {
                break;
            }
            if ($value == 'NULL') {
                $value = '';
                break;
            }
            if (! preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/', $value)) {
                // This appears to be formatted in user date/time
                $value = $timedate->to_db($value);
            }
            break;
        case 'date':
            // If value is array, don't attempt to convert to DB format
            if (empty($value) || is_array($value)) {
                break;
            }
            if ($value == 'NULL') {
                $value = '';
                break;
            }
            if (! preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $value)) {
                // This date appears to be formatted in the user's format
                $value = $timedate->to_db_date($value, false);
            }
            break;
        case 'time':
            if (empty($value)) {
                break;
            }
            if ($value == 'NULL') {
                $value = '';
                break;
            }
            if (preg_match('/(am|pm)/i', $value)) {
                // This time appears to be formatted in the user's format
                $value = $timedate->fromUserTime($value)->format(TimeDate::DB_TIME_FORMAT);
            }
            break;
        case 'double':
        case 'decimal':
        case 'currency':
        case 'float':
            if ($value === '' || $value == null || $value == 'NULL') {
                break;
            }
            if (is_string($value)) {
                $value = (float)unformat_number($value);
            }
            break;
        case 'uint':
        case 'ulong':
        case 'long':
        case 'short':
        case 'tinyint':
        case 'int':
            if ($value === '' || $value == null || $value == 'NULL') {
                break;
            }
            if (is_string($value)) {
                $value = (int)unformat_number($value);
            }
            break;
        case 'bool':
            if (empty($value)) {
                $value = false;
            } elseif (true === $value || 1 == $value) {
                $value = true;
            } elseif (in_array((string)$value, $boolean_false_values)) {
                $value = false;
            } else {
                $value = true;
            }
            break;
    }

the field related where --None-- is stated was same as in the modify action below, “Case VAT *M” but gets reset to None (as that is first option in list).

Hmmm. Seems this is related to:

Is this fix likely to work on 7.10.36:

Thanks

FIXED :slight_smile: