forked from TYPO3-Solr/ext-solr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
!!![TASK] Pass pages to preAddModifyDocuments hook
Now the preAddModifyDocuments hook is called for pages as well. Also the indexPagePostProcessPageDocument hook is deprecated and superseeded by: ``` $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['IndexQueueIndexer'] ['preAddModifyDocuments'] ``` Fixes: TYPO3-Solr#2285 Ports: TYPO3-Solr#3076
- Loading branch information
Showing
6 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Tests/Integration/IndexQueue/FrontendHelper/TestPageIndexerDocumentsModifier.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace ApacheSolrForTypo3\Solr\Tests\Integration\IndexQueue\FrontendHelper; | ||
|
||
use ApacheSolrForTypo3\Solr\IndexQueue\Item; | ||
use ApacheSolrForTypo3\Solr\IndexQueue\PageIndexerDocumentsModifier; | ||
use ApacheSolrForTypo3\Solr\System\Solr\Document\Document; | ||
|
||
class TestPageIndexerDocumentsModifier implements PageIndexerDocumentsModifier | ||
{ | ||
/** | ||
* Allows Modification of the Documents before they go into index | ||
* | ||
* @param Item $item | ||
* @param int $language | ||
* @param Document[] $documents | ||
* @return array|void | ||
*/ | ||
public function modifyDocuments(Item $item, int $language, array $documents) | ||
{ | ||
foreach ($documents as $document) { | ||
$document->addField('postProcessorField_stringS', 'postprocessed'); | ||
} | ||
|
||
return $documents; | ||
} | ||
} |