Skip to content

[BUGFIX] Render links in checkbox label in TYPO3 Forms#895

Open
dextar47 wants to merge 1 commit into
TYPO3-Headless:feature/typo3-v14from
dextar47:feature/typo3-v14
Open

[BUGFIX] Render links in checkbox label in TYPO3 Forms#895
dextar47 wants to merge 1 commit into
TYPO3-Headless:feature/typo3-v14from
dextar47:feature/typo3-v14

Conversation

@dextar47

Copy link
Copy Markdown
Contributor

Rendering of links inside checkbox label was not working. In TYPO3 14 LTS, now there is an RTE box for checkbox label. Links should be rendered for frontend JSON.

@dextar47

dextar47 commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

fixes #894

@twoldanski twoldanski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, first for all thanks for PR & letting us know about this new feature in TYPO3 forms. Please refactor code to support this feature in more abstract way, we should support more cases that only containing links (that can be limited in particular project, also should be used for this form decorators, we can easily adjust in different projects.

// TYPO3 v14 introduced native RTE support for form element labels; without this step,
// labels containing internal page links would be output as raw t3://page?uid=X URIs
// instead of resolved frontend URLs.
$formDefinition = $this->resolveRteLinksInFormDefinition($formDefinition);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in decorator

* @param array<mixed> $formDefinition
* @return array<mixed>
*/
private function resolveRteLinksInFormDefinition(array $formDefinition): array

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go to decorator

$element['renderables'] = $this->resolveRteLinksInRenderables($element['renderables']);
}

// Only process labels that contain an internal TYPO3 URI — skip plain-text labels

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is most usable use case for this new feature, but, on ext:headless should handle all rte cases, this can be limited in project override, we should go more abstract.

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.

2 participants