Project

General

Profile

Actions

Bug #104118

open

Avoid hard dependency on final validation viewhelper

Added by Andreas Kießling about 1 month ago. Updated about 1 month ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2024-06-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

I inherited a project that xclassed the NotEmptyViewHelper and am currently updating it to v12.4
Previously, the ViewHelper was extended, but since they are final now this can't be done anymore.
Thus i copied the code over, made the adjustments --> done, or so i thought...

Now when i tried to add a new form with EXT:form, i could not get the required sign to show up. After quite some debugging i found that there are hard dependencies with instanceof checks in place
https://github.com/search?q=repo%3ATYPO3%2Ftypo3+%22instanceof+NotEmpty%22&type=code

https://github.com/TYPO3/typo3/blob/main/typo3/sysext/extbase/Classes/Validation/Validator/NotEmptyValidator.php

IMHO this implementation needs to be changed, we can not have any hardcoded checks that way without being able to switch out the code. I know that the final declaration is unlikely to change, thus the NotEmptyValidator should probably have an interface or tag to indicate it is a required validator.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #101927: TYPO3 Fluid Core ViewHelpers should not be declared "final class"Rejected2023-09-15

Actions
Related to TYPO3 Core - Bug #100196: Remove "final" on public (!) core viewhelpersRejected2023-03-17

Actions
Actions

Also available in: Atom PDF