Skip to content
Snippets Groups Projects
Commit ff5854a3 authored by Garvin Hicking's avatar Garvin Hicking Committed by Christian Kuhn
Browse files

[TASK] Allow passwordGenerator in all TCA types

FormEngine fieldControl "passwordGenerator" can be
handy with TCA type="input" as well.

The patch removes a restriction in PasswordGenerator
that binds this fieldControl exclusively to TCA
type="password".

Resolves: #101703
Related: #98540
Releases: main, 12.4
Change-Id: Ice09e0af2269d5f0aad5afa2d08215d51a04e394
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80653


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent d742e212
Branches
Tags
No related merge requests found
......@@ -22,21 +22,20 @@ use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction;
use TYPO3\CMS\Core\Utility\StringUtility;
/**
* Renders a widget where a password can be generated, typically used with type=password
* Renders a widget to generate a random string in JavaScript.
*
* @internal Only to be used by TYPO3. Might change in the future.
* This is typically used in combination with TCA type=password as password
* generator, but can be potentially used with other field input types as well.
*
* @internal This is still a bit experimental and may change, for instance to
* be combined with passwordPolicies.
*/
class PasswordGenerator extends AbstractNode
{
public function render(): array
{
$parameterArray = $this->data['parameterArray'];
if (($parameterArray['fieldConf']['config']['type'] ?? '') !== 'password') {
return [];
}
$options = $this->data['renderData']['fieldControlOptions'];
$itemName = (string)$parameterArray['itemFormElName'];
$itemName = (string)$this->data['parameterArray']['itemFormElName'];
$id = StringUtility::getUniqueId('t3js-formengine-fieldcontrol-');
// Handle options and fallback
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment