Skip to content
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

Mention in documentation that collections cannot be passed with props to PaginatedCollection #45

Open
klfman opened this issue Feb 9, 2023 · 0 comments

Comments

@klfman
Copy link

klfman commented Feb 9, 2023

Flowpack.Listable:PaginatedCollection has a collection key that must be set by the user.

The documentation shows an example:

prototype(My.Custom:Object) < prototype(Flowpack.Listable:PaginatedCollection) {
  collection = ${Search.query(site).nodeType('Something.Custom:Here').sortDesc('date')}
  ...
}

When passing the same search query as prop, it does not work:

prototype(My.Custom:Object) < prototype(Neos.Fusion:Component) {
  collection = ${Search.query(site).nodeType('Something.Custom:Here').sortDesc('date')}
  
  renderer = Flowpack.Listable:PaginatedCollection {
    collection=${props.collection}
  }
}

It was hard to find out and took me several hours of debugging to realize that this is simply not possible because of the caching configuration of PaginatedCollection, because the data passed is not saved with the cache entry (see @cache.context).

I'm not sure where exactly, but might it be worth mentioning this in the README or in the code of the fusion component itself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant