-
-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Exception: No query supplied" in the listing block #3839
Comments
@wesleybl It's related to the server-side rendering of the listing block, see https://6.dev-docs.plone.org/volto/blocks/ssr.html It's probably a bug, that code needs to be brought more in line with the rest of the listing block data fetching preparations. |
@tiberiuichim i'm trying to modify the listing block, to return more calalog metadata. But I saw that there are requests in getAsyncData.js and in withQuerystringResults.jsx. Which of these files should I make changes to? Or on both? |
@wesleybl both. getAsyncData is only used on the server-side rendering path. It's meant to populate the Redux store that will be used by the listing block components. Here's a page that hopefully will explain this mechanism: https://training.plone.org/effective-volto/addons/asyncconnect.html withQuerystringResults is used by the listing block to fetch the data. In principle these two functions should produce exactly the same query (pagination excluded, as there's no URL-based set current page). If they don't, it's a bug in the getAsyncData and should be fixed. |
@tiberiuichim as I understand it, this is a mechanism to prevent the page from loading without the listing. But on the Browser side, the listing can be modified, after server rendering. That's it? Well it looks like the way it is today, when we don't have a criterion, nothing is rendered on the server side ( The listing only appears because volto/src/components/manage/Blocks/Listing/withQuerystringResults.jsx Lines 104 to 106 in 20840fd
when we don't have query. It may be necessary to create a "default query", both in |
@tiberiuichim @sneridagh any opinions here? I propose the default query: const defaultQuery = [
{
i: 'path',
o: 'plone.app.querystring.operation.string.relativePath',
v: '::1',
},
]; when we have no defined criteria. This query will have the same result as the items key of the content. |
@wesleybl Ok, +1 |
Describe the bug
When we load a page that has a listing block, without a search criteria, we get the error below in Plone:
Who makes this call is getAsyncData.js
It sends the
query
parameter as an empty list.It looks like it's an attempt to render the block server-side, but I don't quite understand it. The fact is that the block works without getAsyncData. So I'm not quite sure what the idea is here.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No error in Plone.
Software (please complete the following information):
The text was updated successfully, but these errors were encountered: