Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

cms_page lookup fails because availableFilters scope is set to default #527

Open
slri opened this issue Oct 22, 2020 · 0 comments
Open

cms_page lookup fails because availableFilters scope is set to default #527

slri opened this issue Oct 22, 2020 · 0 comments

Comments

@slri
Copy link

slri commented Oct 22, 2020

cms_page type's availableFilters scope is set to default, making lookup fail. When scope is set to catalog it works.

Versions:
vsf-api 1.12.0
es7.9

Prerequisites:

  • have a cms_page with an identifier (example: test)

Steps to reproduce:

  • open /api/catalog/your-index/cms_page/_search?from=0&request=%7B"_availableFilters"%3A%5B%5D%2C"_appliedFilters"%3A%5B%7B"attribute"%3A"identifier"%2C"value"%3A%7B"like"%3A"test"%7D%2C"scope"%3A"default"%7D%5D%2C"_appliedSort"%3A%5B%5D%2C"_searchText"%3A""%7D&request_format=search-query&response_format=compact&size=50&sort=

Expected result:

  • your requested cms page is shown

Actual result:

  • you get all cms pages

Now try this:

  • open /api/catalog/your-index/cms_page/_search?from=0&request=%7B"_availableFilters"%3A%5B%5D%2C"_appliedFilters"%3A%5B%7B"attribute"%3A"identifier"%2C"value"%3A%7B"like"%3A"test"%7D%2C"scope"%3A"catalog"%7D%5D%2C"_appliedSort"%3A%5B%5D%2C"_searchText"%3A""%7D&request_format=search-query&response_format=compact&size=50&sort=

Expected and actual result:

  • your requested cms page is shown

We've implemented a quick hack to get this to work in catalog.ts:

if (entityType === 'cms_page') {
    requestBody._appliedFilters[0].scope = 'catalog';
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant