Skip to content

Commit

Permalink
op-352 - Restore form query builders to check behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymonKostrubiec committed Jul 9, 2024
1 parent 032bb82 commit a82f7e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 3 additions & 8 deletions src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use BitBag\SyliusElasticsearchPlugin\QueryBuilder\QueryBuilderInterface;
use Elastica\Query;
use Symfony\Component\Form\FormEvent;
use Webmozart\Assert\Assert;

final class SiteWideFacetsQueryBuilder implements SiteWideFacetsQueryBuilderInterface
{
Expand All @@ -30,16 +29,12 @@ public function getQuery(FormEvent $event): Query
{
/** @var Search $data */
$data = $event->getData();
$box = $data->getBox();

Assert::notNull($box);

/** @var Query\BoolQuery $boolQuery */
$boolQuery = $this->queryBuilder->buildQuery([
'query' => $box->getQuery() ?? '',
'query' => $data['box']['query'] ?? '',

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 34 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Cannot access offset 'box' on BitBag\SyliusElasticsearchPlugin\Model\Search.
]);

foreach ($data->getFacets() as $facetId => $selectedBuckets) {
foreach ($data['facets'] ?? [] as $facetId => $selectedBuckets) {

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.1, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.1, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.2, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.2, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^5.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.12, PHP 8.3, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.

Check failure on line 37 in src/QueryBuilder/FormQueryBuilder/SiteWideFacetsQueryBuilder.php

View workflow job for this annotation

GitHub Actions / Sylius ^1.13, PHP 8.3, Symfony ^6.4

Cannot access offset 'facets' on BitBag\SyliusElasticsearchPlugin\Model\Search.
if (!$selectedBuckets) {
continue;
}
Expand All @@ -50,4 +45,4 @@ public function getQuery(FormEvent $event): Query

return new Query($boolQuery);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function getQuery(FormEvent $event, string $namePropertyPrefix): Query

$data = $this->shopProductListDataHandler->retrieveData($eventData);

/** @var Query\BoolQuery $boolQuery */
$boolQuery = $this->searchProductsQueryBuilder->buildQuery($data);

foreach ($data['facets'] ?? [] as $facetId => $selectedBuckets) {
Expand All @@ -48,4 +47,4 @@ public function getQuery(FormEvent $event, string $namePropertyPrefix): Query

return new Query($boolQuery);
}
}
}

0 comments on commit a82f7e1

Please sign in to comment.