Updated:
This has been ported over to Craft 3 in Freeform version 3.13.24
2/14/2023
I did see in the updates this was fixed for craft 4.
Freeform Version 4.0.8 November 21, 2022
- Fixed a bug where the Freeform Form element field type was not
sorting form options alphabetically.
I am currently still running Craft 3 So this is my temporary solution to get them to sort alphabetically until I upgrade to craft 4 or they port the fix to craft 3.
By default Freeform Form field type orders the forms in the dropdown by ID.
To force the field type to sort the forms Aphabetically by name you will need to edit the vendor files for the plugin on the server since this has no CP feature to change it.
The issue with this method is its always risky updating your vender files and when you install an update to the plugin this will revert back to default and you will need to change it again. Unless of course the update contains the fix for this or you are updating to version 4.0.8 or newer.
- Script Location:
- "{Your app location}\vendor\solspace\craft-freeform\packages\plugin\src\FieldTypes\FormFieldType.php"
- Currently change line 52 in FormFieldType.php:
- $forms = $freeform->forms->getAllForms();
to
$forms = $freeform->forms->getAllForms(true);
The true variable is just telling the getAllForms function to return the list alphabetically instead of by ID.