salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.27k stars 2.03k forks source link

Fix #10382 - Fix issue with enum keys being used when setting values #10383

Open JackBuchanan opened 3 months ago

JackBuchanan commented 3 months ago

Update how enums fields are handled when setting workflow values

Description

Add extra case to switch statement to handle enums When a varchar is being set to the value of an enum use the enum label When a enum is being set to the value of an enum use the enum key

Motivation and Context

Fixes issue with varchars being set with enum key values

How To Test This

See #10382

Types of changes

Final checklist

serhiisamko091184 commented 2 months ago

Hi @JackBuchanan,

Thanks for your PR!

Regards, Serhii

johnM2401 commented 1 week ago

Hey @JackBuchanan Apologies, I'd marked this Approved but have just found a possible issue, (and don't seem to have permissions to dismiss my approval review)

However:

It looks as though the value may be lost when trying to convert to another enum type, when set through workflow.

For example, in this gif, I try to port the value from a Dropdown field to a Multienum field. However, the value is lost.

wfEnumtypechange

I believe this was possible before this change, so perhaps something that needs addressed.

Would you be able to investigate when you get a moment? Thanks!