Skip to content

Commit

Permalink
Merge pull request #16 from Flowpack/master
Browse files Browse the repository at this point in the history
Merge master into 1.3
  • Loading branch information
kitsunet committed Feb 27, 2016
2 parents 8e1eba8 + 8852d80 commit 4386eb1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ class NodeIndexer extends \TYPO3\TYPO3CR\Search\Indexer\AbstractNodeIndexer {
*/
protected $contextFactory;

/**
* @Flow\Inject
* @var \TYPO3\Flow\Security\Context
*/
protected $securityContext;

/**
* the default context variables available inside Eel
*
Expand Down Expand Up @@ -162,22 +168,25 @@ protected function indexAllNodeVariants(NodeInterface $node) {
* @param string $workspaceName
*/
protected function indexNodeInWorkspace($nodeIdentifier, $workspaceName) {
$dimensionCombinations = $this->calculateDimensionCombinations();
if ($dimensionCombinations !== array()) {
foreach ($dimensionCombinations as $combination) {
$context = $this->contextFactory->create(array('workspaceName' => $workspaceName, 'dimensions' => $combination));
$indexer = $this;
$this->securityContext->withoutAuthorizationChecks(function() use ($indexer, $nodeIdentifier, $workspaceName) {
$dimensionCombinations = $indexer->calculateDimensionCombinations();
if ($dimensionCombinations !== array()) {
foreach ($dimensionCombinations as $combination) {
$context = $indexer->contextFactory->create(array('workspaceName' => $workspaceName, 'dimensions' => $combination));
$node = $context->getNodeByIdentifier($nodeIdentifier);
if ($node !== NULL) {
$indexer->indexNode($node, NULL, FALSE);
}
}
} else {
$context = $indexer->contextFactory->create(array('workspaceName' => $workspaceName));
$node = $context->getNodeByIdentifier($nodeIdentifier);
if ($node !== NULL) {
$this->indexNode($node, NULL, FALSE);
$indexer->indexNode($node, NULL, FALSE);
}
}
} else {
$context = $this->contextFactory->create(array('workspaceName' => $workspaceName));
$node = $context->getNodeByIdentifier($nodeIdentifier);
if ($node !== NULL) {
$this->indexNode($node, NULL, FALSE);
}
}
});
}

/**
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![SensioLabs Insight](https://insight.sensiolabs.com/projects/f65658fd-394a-4cd3-8c7b-639680eb4404/small.png)](https://insight.sensiolabs.com/projects/f65658fd-394a-4cd3-8c7b-639680eb4404)
[![Code Climate](https://codeclimate.com/github/kitsunet/Flowpack.SimpleSearch.ContentRepositoryAdaptor/badges/gpa.svg)](https://codeclimate.com/github/kitsunet/Flowpack.SimpleSearch.ContentRepositoryAdaptor)

SimpleSearch ContentRepositoryAdaptor
==============================================

Expand Down

0 comments on commit 4386eb1

Please sign in to comment.