Skip to content

Commit

Permalink
Add TODO comments regarding resolving page properties (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasnatter authored Jul 13, 2020
1 parent 36aa511 commit 8ba6c88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Content/ContentTypeResolver/PageSelectionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Sulu\Bundle\HeadlessBundle\Content\ContentView;
use Sulu\Bundle\HeadlessBundle\Content\Serializer\PageSerializerInterface;
use Sulu\Bundle\PageBundle\Content\PageSelectionContainer;
use Sulu\Component\Content\Compat\PropertyInterface;
use Sulu\Component\Content\Compat\PropertyParameter;

Expand Down Expand Up @@ -55,6 +56,9 @@ public function resolve($data, PropertyInterface $property, string $locale, arra
$property->getParams()
);

// the PageSelectionContainer resolves the data defined in the $params using the default content types
// for example, this means that the result contains an array of media entities instead of an array of ids
// TODO: find a solution that returns the unresolved data which can be passed to the resolvers of this bundle
/** @var mixed[] $pagesData */
$pagesData = $this->pageSelectionContainerFactory->createContainer(
$data,
Expand Down
3 changes: 3 additions & 0 deletions Content/DataProviderResolver/PageResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public function resolve(
int $page = 1,
?int $pageSize = null
): DataProviderResult {
// the PageDataProvider resolves the data defined in the $propertyParameter using the default content types
// for example, this means that the result contains an array of media entities instead of an array of ids
// TODO: find a solution that returns the unresolved data which can be passed to the resolvers of this bundle
$providerResult = $this->pageDataProvider->resolveResourceItems(
$filters,
$propertyParameter,
Expand Down

0 comments on commit 8ba6c88

Please sign in to comment.