Cast the group name as a string

This allows the options to be grouped by association fields.
bug #10416 [Form] Allow options to be grouped by objects (felds)

This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10416).

Discussion
----------

[Form] Allow options to be grouped by objects

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

ae3f02f Cast the group name as a string