Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 30a4e3f

Browse files
committed
More compatibilty fixes.. Now works on _both_ 3.2.x and 3.3.
1 parent c6b3ed6 commit 30a4e3f

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

src/Parser/Field/FieldFactory.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public static function build(
4343
$fieldCollection = new FieldCollection([]);
4444
}
4545

46+
$repeatingFieldCollection = null;
47+
$repeatingCollection = null;
48+
4649
foreach ($fields as $label => $field) {
4750
if ($fieldCollection instanceof RepeatingFieldCollection) {
4851
$data = $field->getValue();
@@ -102,8 +105,7 @@ public static function build(
102105
}
103106

104107
//Must NOT be a repeater
105-
if (!isset($repeatingFieldCollection) || !$repeatingFieldCollection) {
106-
$repeatingFieldCollection = null;
108+
if (!$repeatingFieldCollection) {
107109
$fieldCollection->add($type);
108110
}
109111
}

src/Parser/Field/Type/Taxonomy.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ public function render()
99
/** @var \Bolt\Storage\Collection\Taxonomy $taxonomies */
1010
$taxonomies = $this->getValue();
1111

12+
$attributes = [];
13+
1214
foreach ($taxonomies as $taxonomy) {
1315
$type = $taxonomy->getTaxonomytype();
1416
$slug = $taxonomy->getSlug();

src/Storage/Query/Handler/PagingHandler.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Bolt\Extension\Bolt\JsonApi\Storage\Query\PagingResultSet;
77
use Bolt\Storage\Query\ContentQueryParser;
88
use Bolt\Storage\Query\SearchQuery;
9+
use Bolt\Version;
910
use Doctrine\DBAL\Query\QueryBuilder;
1011

1112
/**
@@ -21,17 +22,26 @@ public function __invoke(ContentQueryParser $contentQuery)
2122
$cleanSearchQuery = $contentQuery->getService('search');
2223

2324
foreach ($contentQuery->getContentTypes() as $contenttype) {
25+
$parameters = $contentQuery->getParameters();
26+
2427
//Find out if we are searching or just doing a simple query
25-
if ($contentQuery->hasParameter('filter')) {
28+
if (array_key_exists('filter', $parameters)) {
2629
$query = clone $cleanSearchQuery;
2730
} else {
2831
$query = $contentQuery->getService('select');
2932
}
3033

3134
$repo = $contentQuery->getEntityManager()->getRepository($contenttype);
32-
$query->setQueryBuilder($repo->createQueryBuilder('_' . $contenttype));
35+
36+
if (Version::compare('3.3', '<=')) {
37+
// Only for Bolt version 3.3 and up.
38+
$query->setQueryBuilder($repo->createQueryBuilder('_' . $contenttype));
39+
} else {
40+
// Only for Bolt versions up to 3.2.x.
41+
$query->setQueryBuilder($repo->createQueryBuilder($contenttype));
42+
}
3343
$query->setContentType($contenttype);
34-
$query->setParameters($contentQuery->getParameters());
44+
$query->setParameters($parameters);
3545

3646
//Set the search parameter if searching
3747
if ($query instanceof SearchQuery) {

0 commit comments

Comments
 (0)