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

Deprecation: #103965 - Deprecate namespaced shorthand validator usage in extbase #4307

Open
simonschaufi opened this issue Sep 10, 2024 · 0 comments

Comments

@simonschaufi
Copy link
Collaborator

Deprecation: #103965 - Deprecate namespaced shorthand validator usage in extbase

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.2/Deprecation-103965-DeprecateNamespacedShorthandValidatorUsageInExtbase.html

Deprecation: #103965 - Deprecate namespaced shorthand validator usage in extbase

See 103965

Description

It is possible to use the undocumented namespaced shorthand notation in
extbase to add validators for properties or arguments. As an example,
TYPO3.CMS.Extbase:NotEmpty will be resolved as
TYPO3\CMS\Extbase\Validation\Validator\NotEmptyValidator or
Vendor.Extension:Custom will be resolved as
\Vendor\MyExtension\Validation\Validator\CustomValidator.

The namespaced shorthand notation for extbase validators has been marked
as deprecated and will be removed in TYPO3 v14.

Impact

Using namespaced shorthand notation in extbase will trigger a PHP
deprecation warning.

Affected installations

All installations using namespaced shorthand notation in extbase are
affected.

Migration

Extensions using the namespaced shorthand notation must use the FQCN of
the validator instead. In case of extbase core validators, the well
known shorthand validator name can be used.

Before

/**
 * @Extbase\Validate("TYPO3.CMS.Extbase:NotEmpty")
 */
protected $myProperty1;

/**
 * @Extbase\Validate("Vendor.Extension:Custom")
 */
protected $myProperty2;

After

/**
 * @Extbase\Validate("NotEmpty")
 */
protected $myProperty1;

/**
 * @Extbase\Validate("Vendor\Extension\Validation\Validator\CustomValidator")
 */
protected $myProperty2;

or

#[Extbase\Validate(['validator' => \TYPO3\CMS\Extbase\Validation\Validator\NotEmptyValidator::class])]
protected $myProperty1;

#[Extbase\Validate(['validator' => \Vendor\Extension\Validation\Validator\CustomValidator::class])]
protected $myProperty2;

Frontend, NotScanned, ext:extbase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant