Bug #101835
closedfieldValue not supplied for user function defined field in install tool
0%
Description
When rendering a custom field by using type=user
for extension settings in ext_conf_template.txt
, the fieldValue
for the params
array is not supplied but fieldName
is. The variable is set but empty.
Use case for the user function would be to render a custom password field.
The user function field is rendered via {configurationItem.html -> f:format.raw()}
in ExtensionForm.html (/sysext/install/Resources/Private/Partials/Settings/ExtensionConfiguration).
Previously in version 11 there was a ViewHelper ( core:form.typoScriptConstants
) that supplied the values for fieldName
and fieldValue
.
The issue should be somewhere in extensionConfigurationGetContentAction()
in /sysext/install/Classes/Controller/SettingsController.php
Example extension configuration:
ext_conf_template.txt:
# cat=My Settings/important/a; type=user[<Vendor>\<Extension>\<Some Namespace>\PasswordField->render]; label=My important password
important.options.password =
PasswordField.php:
class PasswordField
{
public function render(array $params)
{
$fieldName = $params['fieldName'];
$fieldValue = $params['fieldValue']; //Variable is set but empty!
return "<input class='form-control' id='em-ext_key-important.options.{$fieldName}' type='password' name='important.options.{$fieldName}' value='{$fieldValue}'>";
}
}
Updated by Georg Ringer about 1 year ago
- Is duplicate of Bug #99498: "type=user" in ext_conf_template.txt: Value is not passed to custom method anymore added
Updated by Georg Ringer about 1 year ago
- Status changed from New to Closed
thanks for your report. closed as duplicate of #99498 which also contains a temporary solution