Skip to content

Commit

Permalink
Merge branch '4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveb-p committed Oct 3, 2023
2 parents 2894870 + c40d411 commit 3344bea
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/bundle/ApiLoader/BoostFactorProviderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
namespace Ibexa\Bundle\Solr\ApiLoader;

use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider;
use Ibexa\Solr\FieldMapper\BoostFactorProvider;
use LogicException;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

Expand Down Expand Up @@ -48,6 +50,10 @@ public function __construct(

public function buildService()
{
if ($this->container === null) {
throw new LogicException(sprintf('Unable to build %s due to missing container reference', BoostFactorProvider::class));
}

$repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig();

$connection = $this->defaultConnection;
Expand Down
6 changes: 6 additions & 0 deletions src/bundle/ApiLoader/IndexingDepthProviderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
namespace Ibexa\Bundle\Solr\ApiLoader;

use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider;
use Ibexa\Solr\FieldMapper\IndexingDepthProvider;
use LogicException;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

Expand Down Expand Up @@ -43,6 +45,10 @@ public function __construct(

public function buildService()
{
if ($this->container === null) {
throw new LogicException(sprintf('Unable to build %s due to missing container reference', IndexingDepthProvider::class));
}

$repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig();

$connection = $this->defaultConnection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)

foreach ($criterion->value as $identifier) {
try {
$validIds[] = $contentTypeHandler->loadByIdentifier($identifier)->id;
$validIds[] = $contentTypeHandler->loadByIdentifier((string) $identifier)->id;
} catch (NotFoundException $e) {
// Filter out non-existing content types, but track for code below
$invalidIdentifiers[] = $identifier;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Query/Content/CriterionVisitor/Ancestor.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
{
$idSet = [];
foreach ($criterion->value as $value) {
foreach (explode('/', trim($value, '/')) as $id) {
foreach (explode('/', trim((string)$value, '/')) as $id) {
$idSet[$id] = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Query/Location/CriterionVisitor/Ancestor.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
{
$idSet = [];
foreach ($criterion->value as $value) {
foreach (explode('/', trim($value, '/')) as $id) {
foreach (explode('/', trim((string)$value, '/')) as $id) {
$idSet[$id] = true;
}
}
Expand Down

0 comments on commit 3344bea

Please sign in to comment.