Skip to content

Commit 4c2f837

Browse files
beardcoderdkd-kaehm
authored andcommitted
[!!!][BUGFIX] remove space in searchResultClassName and searchResultSetClassName configuration keys
Existing customizations using the old keys with a trailing space will silently fall back to the default classes. See the 14.0 release notes for the migration snippet. Fixes: #4225
1 parent daa996a commit 4c2f837

4 files changed

Lines changed: 38 additions & 6 deletions

File tree

Classes/Domain/Search/ResultSet/Result/SearchResultBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ public function fromApacheSolrDocument(Document $originalDocument): SearchResult
4545

4646
protected function getResultClassName(): string
4747
{
48-
return $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '] ?? SearchResult::class;
48+
return $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName'] ?? SearchResult::class;
4949
}
5050
}

Classes/Domain/Search/ResultSet/SearchResultSetService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function getSearch(): Search
9595

9696
protected function getResultSetClassName(): string
9797
{
98-
return $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName '] ?? SearchResultSet::class;
98+
return $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName'] ?? SearchResultSet::class;
9999
}
100100

101101
/**

Documentation/Releases/solr-release-14-0.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,36 @@ should check the ``solr.indexingInstructions`` request attribute instead.
297297
those calls — the sub-request pipeline handles CWD automatically.
298298

299299

300+
!!! Trailing Space Removed from ``searchResultClassName`` and ``searchResultSetClassName`` Keys
301+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302+
303+
The configuration keys
304+
``$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName ']`` and
305+
``$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName ']``
306+
had an unintentional trailing space. The space has been removed.
307+
308+
Impact
309+
""""""
310+
311+
**Code registering a custom search result class** using the old key with a trailing space will
312+
silently fall back to the default class, since the key no longer matches.
313+
314+
Migration
315+
"""""""""
316+
317+
Remove the trailing space from the key in your ``ext_localconf.php``:
318+
319+
.. code-block:: php
320+
321+
// Before (broken — trailing space)
322+
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '] = MySearchResult::class;
323+
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName '] = MySearchResultSet::class;
324+
325+
// After (correct)
326+
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName'] = MySearchResult::class;
327+
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName'] = MySearchResultSet::class;
328+
329+
300330
!!! Upgrade to Apache Solr 10.0.0
301331
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302332

@@ -340,6 +370,7 @@ Since EXT:solr 9 and Apache Solr 7 dynamic fields based on trie fields are marke
340370
All Changes
341371
-----------
342372

373+
* [!!!][BUGFIX] Remove space in ``searchResultClassName`` and ``searchResultSetClassName`` configuration keys by @beardcoder in `#4226 <https://github.com/TYPO3-Solr/ext-solr/pull/4226>`_
343374
* [!!!][TASK] Remove jQuery dependency from frontend JavaScript by @dkd-lehnebach in `#4619 <https://github.com/TYPO3-Solr/ext-solr/pull/4619>`_
344375
* [BUGFIX] Prevent c:0 variant and content leakage on fe_group-restricted pages by @dkd-kaehm in `#4559 <https://github.com/TYPO3-Solr/ext-solr/pull/4559>`_
345376
* [!!!][TASK] Remove legacy PageIndexer system and migrate to IndexingInstructions by @dkd-kaehm in `#4559 <https://github.com/TYPO3-Solr/ext-solr/pull/4559>`_
@@ -417,6 +448,7 @@ awesome community. Here are the contributors to this release.
417448
(patches, comments, bug reports, reviews, ... in alphabetical order)
418449

419450
- `Amir Arends <https://github.com/amirarends>`_
451+
- `@beardcoder <https://github.com/beardcoder>`_
420452
- `Benni Mack <https://github.com/bmack>`_
421453
- `Florian Lehnebach <https://github.com/dkd-lehnebach>`_
422454
- `@garfieldius <https://github.com/garfieldius>`_

ext_localconf.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@
141141

142142
// ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- # ----- #
143143

144-
if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '])) {
145-
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '] = SearchResult::class;
144+
if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName'])) {
145+
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName'] = SearchResult::class;
146146
}
147147

148-
if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName '])) {
149-
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName '] = SearchResultSet::class;
148+
if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName'])) {
149+
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName'] = SearchResultSet::class;
150150
}
151151

152152
if (!isset($GLOBALS['TYPO3_CONF_VARS']['LOG']['ApacheSolrForTypo3']['Solr']['writerConfiguration'])) {

0 commit comments

Comments
 (0)