Bug #99498
open"type=user" in ext_conf_template.txt: Value is not passed to custom method anymore
0%
Description
We have an extension that creates a custom field for the Extension Manager:
// ext_conf_template.txt
# cat=Basic; type=user[Vendor\Extension\Helpers\MyCustomHelper->textfield]; label=My Label
myVarName =
The MyCustomHelper
class looks like this (just an example, of course senseless as standard "inputs" exist in the Core ;)
<?php
namespace My\Extension\Helpers;
class MyCustomHelper {
public function textfield( $conf = [] )
{
return "<input name=\"{$conf['fieldName']}\" class=\"form-control\" value=\"{$conf['fieldValue']}\"></input>";
}
}
- The field gets rendered correctly, but $conf['fieldValue']
is always empty / NULL.
- If you fill out the field, it gets saved correctly in the LocalConfiguration.php / settings.php - but it is not passed back to the method when the custom form in the Extension Configuration Manager is rendered.
- The saved value can also be accessed using GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('my_extension_key');
.
Possible starting point:
- Value exists and is correct in EXT:cms-install/Classes/Controller/SettingsController.php
- Value does NOT exists in EXT:cms-core/Classes/TypoScript/AST/Visitor/AstConstantCommentVisitor.php->parseNodeComment()
Updated by Georg Ringer almost 2 years ago
- Status changed from New to Accepted
- Assignee set to Christian Kuhn
Updated by Christian Kuhn almost 2 years ago
- Related to Feature #97816: New TypoScript parser added
Updated by Christian Kuhn almost 2 years ago
Well, confirmed.
The ast visitor 'AstConstantCommentVisitor' simply does not receive 'current' values from system/settings.php.
To properly solve this, this comment should be resolved: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/install/Classes/Controller/SettingsController.php#L440 This however is a bit of work and requires refactoring some template magic and JS along the way. Not too simple to get done, and needs to be tested along with the constant editor to not break details for it.
Updated by Christian Kuhn almost 2 years ago
- Related to Task #98357: Revamp Constant Editor added
Updated by Christian Kuhn almost 2 years ago
Could you maybe switch to a type=string field for now, as done for instance in ext:styleguide ext_conf_template.txt with this? (Just in case your use case is similar to the example you mentioned).
# cat=Text/200/10; type=string; label=String 1 - help text:Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vel sollicitudin odio. string_1 = value
Updated by Christian Kuhn almost 2 years ago
Unsure when we find time to fix this, I need to ask you to go with the workaround for now:
GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('my_extension_key');
Updated by David Bascom almost 2 years ago
Sure – we'll go with the workaround for now.
Thanks for the quick response and check!
Updated by Benni Mack almost 2 years ago
- Target version changed from 12.2 to 12.3
Updated by Benni Mack over 1 year ago
- Target version changed from 12.3 to 12 LTS
Updated by Benni Mack over 1 year ago
- Target version changed from 12 LTS to Candidate for patchlevel
Updated by Georg Ringer about 1 year ago
- Has duplicate Bug #101835: fieldValue not supplied for user function defined field in install tool added