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

Refactor: update text block conversion to use text block type #7697

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

jonwaldstein
Copy link
Contributor

@jonwaldstein jonwaldstein commented Jan 24, 2025

Resolves #

Description

This updates the text block conversion to use the first class TextBlockType.

This is the first in series approach to moving away from the untyped $block->getAttribute() and toward specific block types with typed block attributes in the form of object properties.

This also caught and fixes an issue with the BlockType class so it will always cast values as intended. So if you are expecting a boolean and for some reason the block does not have the attribute it will still return a boolean type instead of null. This makes sure the block type property types are always valid types and can be confidently used in typed methods in the fields api.

Affects

  • Custom text block fields in the VFB

Visuals

N/A

Testing Instructions

  • Make sure new and existing custom text blocks work as expected on v3 forms

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@jonwaldstein jonwaldstein marked this pull request as ready for review January 24, 2025 19:44
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