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

[BUG]: Fix Typo in searchResultClassName Configuration Key #4225

Open
BreathCodeFlow opened this issue Nov 21, 2024 · 0 comments · May be fixed by #4226
Open

[BUG]: Fix Typo in searchResultClassName Configuration Key #4225

BreathCodeFlow opened this issue Nov 21, 2024 · 0 comments · May be fixed by #4226

Comments

@BreathCodeFlow
Copy link

Description

There is a typo in the configuration key for searchResultClassName in the code. The key contains an unintended trailing space ('searchResultClassName ') which leads to incorrect behavior when retrieving the configuration value.


Steps to Reproduce

return $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '] ?? SearchResult::class;

  1. Configure the searchResultClassName in TYPO3_CONF_VARS:
    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName'] = \CustomNamespace\CustomSearchResult::class;
  2. Attempt to use the custom class in the Solr integration.
  3. The custom class is not used because the incorrect key ('searchResultClassName ') is being checked.

Expected Behavior

The code should check for the key without the trailing space ('searchResultClassName') and fall back to the default SearchResult::class if not set.


Actual Behavior

The code currently checks for the key with a trailing space ('searchResultClassName '), which causes the custom configuration to be ignored.


Proposed Fix

Replace the following line:

return $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '] ?? SearchResult::class;

With:

return $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName'] ?? SearchResult::class;
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 a pull request may close this issue.

1 participant