FormBuilder with relationship and custom field fields to encode correctly (5.70)
Odd bug on 5.70/RC where it's generating afform markup that looks like:
<af-entity security="FBAC" type="Relationship"
name="Relationship2" label="Relation 2"
actions="{create: true, update: true}"
data="{contact_id_a: ['Individual1'], relationship_type_id: '13', "MyCustom.MyField": '1'}" />
This is a custom field on a relationship, that is used in the form. Because of the double-quotes around the MyCustom field, it's causing an AngualrJS syntax error.
To reproduce:
- Create a custom-group/field for Relationships
- Create a form that adds a relationship, and pre-selects a value for the custom field
Save the form, then do a full page reload (sometimes it's not obvious at first). It will fail to load correctly, and JS errors in the console.
I can fix the syntax by manually editing the file, but then it creeps back when we do changes to the form.
For what it's worth, my test site is on PHP 8.0, and dmaster is on PHP 8.2.