Project

General

Profile

Actions

Bug #99498

open

"type=user" in ext_conf_template.txt: Value is not passed to custom method anymore

Added by David Bascom almost 2 years ago. Updated 8 months ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Extension Manager
Start date:
2023-01-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

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()


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Feature #97816: New TypoScript parserClosed2022-06-27

Actions
Related to TYPO3 Core - Task #98357: Revamp Constant EditorClosed2022-09-16

Actions
Has duplicate TYPO3 Core - Bug #101835: fieldValue not supplied for user function defined field in install toolClosed2023-09-04

Actions
Actions #1

Updated by Georg Ringer almost 2 years ago

  • Status changed from New to Accepted
  • Assignee set to Christian Kuhn
Actions #2

Updated by Christian Kuhn almost 2 years ago

Actions #3

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.

Actions #4

Updated by Christian Kuhn almost 2 years ago

Actions #5

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
Actions #6

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');
Actions #7

Updated by David Bascom almost 2 years ago

Sure – we'll go with the workaround for now.
Thanks for the quick response and check!

Actions #8

Updated by Benni Mack almost 2 years ago

  • Target version changed from 12.2 to 12.3
Actions #9

Updated by Benni Mack over 1 year ago

  • Target version changed from 12.3 to 12 LTS
Actions #10

Updated by Benni Mack over 1 year ago

  • Target version changed from 12 LTS to Candidate for patchlevel
Actions #11

Updated by Georg Ringer about 1 year ago

  • Has duplicate Bug #101835: fieldValue not supplied for user function defined field in install tool added
Actions #12

Updated by Christian Kuhn 8 months ago

  • Assignee deleted (Christian Kuhn)
Actions

Also available in: Atom PDF