Project

General

Profile

Actions

Bug #87745

closed

ext_localconf.php is not loaded in BE > Settings > Extension Configuration > Configure extensions

Added by Bill Dagou about 5 years ago. Updated about 5 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-02-19
Due date:
% Done:

0%

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

Description

ext_localconf.php

<?php
defined('TYPO3_MODE') || die();

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ext']['fields'] = [
    'op1' => 'Option 1',
    'op2' => 'Option 2',
];

ext_conf_template.txt

# cat=basic; type=user[Vendor\Ext\Utility\ExtensionManagerConfigurationUtility->buildFieldsSelector]; label=Field
field =

Vendor\Ext\Utility\ExtensionManagerConfigurationUtility

<?php
namespace Vendor\Ext\Utility;

class ExtensionManagerConfigurationUtility{
    /**
     * @param array $params
     *
     * @return string
     */
    public function buildFieldsSelector(array $params): string {
        $selector = '<select id="em-'.$params['propertyName'].'" class="form-control" name="'.$params['fieldName'].'">';
        $selector .= '<option value="">'.$GLOBALS['LANG']->sL('None').'</option>';

        if (count($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ext']['fields'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ext']['fields'] as $v => $k) {
                $selectd = $params['fieldValue'] === $v ? ' selected' : '';

                $selector .= '<option value="'.htmlspecialchars($v).'"'.$selectd.'>'.$GLOBALS['LANG']->sL($k).'</option>';
            }
        }

        $selector .= '</select>';

        return $selector;
    }
}

When you go to BE > Settings > Extension Configuration > Configure extensions, you will get the Ajax error.

If the $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ext']['fields'] is moved to LocalConfiguration.php, the Configure extensions will work as expected. So, my guess is ext_localconf.php is not loaded or what.

Actions #1

Updated by Georg Ringer about 5 years ago

  • Status changed from New to Rejected

This is intended by design so that those configs are always loaded.

You can also use an additionalConfiguration file to define those settings but no ext_localconf

Actions #2

Updated by Bill Dagou about 5 years ago

Even if it works in v8?

Actions

Also available in: Atom PDF