Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] Supply field's config and form's handle to extraRenderableFieldData method #8849

Closed

Conversation

martyf
Copy link
Contributor

@martyf martyf commented Oct 16, 2023

The key tweak here is supplying the form's handle to the new extraRenderableFieldData method.

This allows the potential for form-specific calculations to take place within a custom fieldtype.

Further to this, to prevent fields being rendered multiple times, the Form tag has been tweaked to collect the fields from the sections, if the form rendered any, otherwise fall back to the older way of doing it. Without this tweak, the fields get rendered twice per form.

@martyf martyf changed the title [4.x] Supply form handle to extraRenderableFieldData method [4.x] Supply field and form handle to extraRenderableFieldData method Oct 18, 2023
@martyf
Copy link
Contributor Author

martyf commented Oct 18, 2023

Revised to pass the field instance to the extraRenderableFieldData method.

This means that the specific field's configuration can be used at this level - which really opens up capabilities.

@martyf martyf changed the title [4.x] Supply field and form handle to extraRenderableFieldData method [4.x] Supply field's config and form's handle to extraRenderableFieldData method Oct 18, 2023
@martyf
Copy link
Contributor Author

martyf commented Oct 18, 2023

Revised to actually only be the field's config - that's what is important here.

It allows the logic in extraRenderableFieldData to do things differently based on how the fieldtype instance is configured.

I know this changes the definition of extraRenderableFieldData but hopefully is not in major use at the moment, and can slide in quietly?

@martyf martyf closed this Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant