Project

General

Profile

Task #104733

Updated by Sébastien Delcroix 3 months ago

Since #96998, there's no more __construct() method more in Extbase validators, thus they can't be instanciated with options anymore, they have to implement setOptions. 
 The following code doesn't work since TYPO3v12 : 

 <pre><code class="php"> 
 $message->addValidator(GeneralUtility::makeInstance(StringLengthValidator::class, ['minimum' => 5, 'maximum' => 20])); 
 </code></pre> 


 Instead the method createValidator must be used like this : 

 <pre><code class="php"> 
 $message->createValidator( 
	 'StringLength', 
	 ['minimum' => 5, '5, 'maximum' => 20] 
 ); 
 </code></pre> 


 The form extension documentation contains a code example on how to build forms programmatically that must be updated to respect this ( 
 https://docs.typo3.org/c/typo3/cms-form/main/en-us/D/FrontendRendering/Index.html#apireference-frontendrendering-programmatically ) 

 I'll try to provide a patch (that would be my first contribution using the official gerrit process).

Back