Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX:BP:11.2] Use plugin namespace as label for flexforms #3553

Conversation

dkd-friedrich
Copy link
Member

Backport of #3549


When you configure additional pluginnamespaces via extension configuration, the dropdown in the plugin flexform shows Default followed by empty entries.

Extension Configuration to reproduce this:

$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['solr']['pluginNamespaces'] => 'search,sitesearch,newssearch,eventsearch'

The view.pluginNamespace DropDown shows up with the folowing Field:

<select class="form-select form-control-adapt">
    <option value="tx_solr" selected="selected">Default</option>
    <option value="search"></option>
    <option value="sitesearch"></option>
    <option value="newssearch"></option>
    <option value="eventsearch"></option>
</select>

It is hard to select an plugin namespace with empty labels.

The user function that returns the entries creates the labels with
$label = $namespace === 'tx_solr' ? 'Default' : '':

public function getAvailablePluginNamespaces(array &$parentInformation)
{
$extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class);
$namespaces = [];
foreach ($extensionConfiguration->getAvailablePluginNamespaces() as $namespace) {
$label = $namespace === 'tx_solr' ? 'Default' : '';
$namespaces[$namespace] = [$label, $namespace];
}
$parentInformation['items'] = $namespaces;
}

This pull requests uses the namespace instead of an empty string for the label:
$label = $namespace === 'tx_solr' ? 'Default' : $namespace

@dkd-friedrich dkd-friedrich merged commit 3fcea2a into TYPO3-Solr:release-11.2.x Mar 27, 2023
@dkd-friedrich dkd-friedrich deleted the bugfix/release-11.2.x/fix-pluginnamespace-flexform branch March 27, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants