Skip to content

Country select box does not work without EXT:static_info_tables #652

@alexander-nitsche-governikus

Description

I am experiencing

Too few arguments to function In2code\Femanager\UserFunc\StaticInfoTables::__construct(), 0 passed in /opt/typo3/vendor/typo3/cms-core/Classes/
Utility/GeneralUtility.php on line 2992 and exactly 2 expected

for EXT:femanager:8.3.0 (latest) in TYPO3 v12 (not latest) and PHP 8.2 with having extension configuration

overrideFeUserCountryFieldWithSelect = 1

and no EXT:static_info_tables installed, which the extension documentation confirms should work:

# cat=basic/enable/200; type=boolean; label= Replace the input field for a fe_user's country with a select box.: This feature can be active without static_info_tables, but will use data from static_info_tables if it is installed.
overrideFeUserCountryFieldWithSelect = 0

Probably the idea is to fallback to TYPO3's native country list since TYPO3 v12.

Having a look into dependency injection (DI) cache the mentioned StaticInfoTables is explicitely excluded from injection by being listed in

public function getRemovedIds(): array
{
  ..
  'In2code\\Femanager\\UserFunc\\StaticInfoTables' => true,
}

and i assume this is due to the conditional DI compiler pass in Configuration/Services.php which only includes the StaticInfoTables class, if the Country class of EXT:static_info_tables exists, which is not the case:

return function (ContainerConfigurator $configurator, ContainerBuilder $containerBuilder) {
    ..
    if (class_exists(Country::class)) {
        $containerBuilder->registerForAutoconfiguration(StaticInfoTables::class)->addTag('femanager.userfunc.staticinfotables');
        $containerBuilder->addCompilerPass(new PublicServicePass('femanager.userfunc.staticinfotables'));

        $services->set(StaticInfoTables::class)
            ->public();
    }
};

Can you confirm this bug and indicate what the solution should be: Removing the condition from the compiler pass or specifying that "overrideFeUserCountryFieldWithSelect" can only be enabled if EXT:static_info_tables is installed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions