Issue Bug Closed

#101835fieldValue not supplied for user function defined field in install tool

Daniel Fischer 09/04/23, 08:12 updated 09/07/23, 07:45

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}'>";
    }
}

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 2

  1. Georg Ringer changed Duplicates #99498 09/07/23, 07:38

  2. Georg Ringer commented and changed status New Closed 09/07/23, 07:45

    thanks for your report. closed as duplicate of #99498 which also contains a temporary solution