Form Plugin v5.1.0 : prepare_form_fields()

Can I confirm that since v5.1.0 enforces the requirement of all fields to have a “name” field even if logically they don’t require them, fields such as spacer.

I think it’s in the new prepare_form_fields()

If I don’t include a name field they don’t render, took a while to figure out what was going on.

@adrianw, It sure looks like that…

classes/TwigExtensions.php: lines 83-87

/ Make sure that the field has a name.
$name = $name ?? $field['name'] ?? null;
if (!is_string($name) || $name === '') {
    return null;

You might consider creating an issue stating this is a breaking change.

thanks for looking at thing @pamtbaau . I will raise it, I just wanted to be sure I hadn’t fallen into a different trap or was doing something wrong in the first place.

@adrianw, To the benefit of the community, it will be appreciated if you could share the link to the issue and report back any conclusions.

The issue was raised

It has been confirmed as a Bug, and a fix has been created (which I have successfully tested locally).

I imagine that it will be included in the next plugin release.

1 Like

The fix was released in v5.1.1 of the Form plugin, I’ve download and tested the release with the form that was problematic and everything worked as it should.

1 Like