-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EZP-30136: Updating content with "ezuser" field will not commit chang…
…es to Solr (#2544) * Added missing slot for UpdateUser signal * Added missing slot for ElasticSearch and test
- Loading branch information
1 parent
ce0dccc
commit 3346119
Showing
4 changed files
with
94 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the eZ Publish Kernel package. | ||
* | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Publish\Core\Search\Common\Slot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal; | ||
use eZ\Publish\Core\Search\Common\Slot; | ||
|
||
/** | ||
* A Search Engine slot handling UpdateUserSignal. | ||
*/ | ||
class UpdateUser extends Slot | ||
{ | ||
/** | ||
* Receive the given $signal and react on it. | ||
* | ||
* @param \eZ\Publish\Core\SignalSlot\Signal $signal | ||
*/ | ||
public function receive(Signal $signal) | ||
{ | ||
if (!$signal instanceof Signal\UserService\UpdateUserSignal) { | ||
return; | ||
} | ||
|
||
$userContentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo( | ||
$signal->userId | ||
); | ||
|
||
$this->searchHandler->indexContent( | ||
$this->persistenceHandler->contentHandler()->load( | ||
$userContentInfo->id, | ||
$userContentInfo->currentVersionNo | ||
) | ||
); | ||
|
||
$locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent( | ||
$userContentInfo->id | ||
); | ||
foreach ($locations as $location) { | ||
$this->searchHandler->indexLocation($location); | ||
} | ||
} | ||
} |
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