Drop-down in form not showing custom labels

Your software
My Mautic version is: 5,0,3
My PHP version is: 8.1.27
My Database type and version is:

Your problem
My problem is: Since Mautic 5 a new created form will not show custom labels, but the ones of the mapped field from the database.

I.e. I have a field “gender”, defined in the database as male with the Label Male and female with the Label Female.

I created a new form in which I’m using this form. In the Properties tab I defined different labels i.e. Herr with the value male and Frau with the value female.

Unfortunately these labels are not shown, but the default ones from the database.

Kind regards

Christian

Hey @taxi,

did you manage to solve the issue? I’m experiencing the exact same problem.

I tested it on a fresh installation of Mautic 5.2.3 and created a new form with a “Select: Single choice” field. I mapped this field to the predefined country list and, under the properties tab, I didn’t select “Use assigned contact/company field’s list choices.” Instead, I added a custom list. However, as soon as I do that, the form automatically pulls the predefined country list.

I tried this with different fields and the same issue occurs every time.

Am I doing something wrong? I’m quite sure this bug didn’t exist in older versions. Can anyone else confirm or help?

I found a quick solution that worked for me with the following PR:

Many thanks batijko for sending me your thoughts and solution.
No, I did not fix the problem.
I will look into your found solution.

Kind regards
Christian