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

Method count is not callable in untrusted context (totalCount) #46

Open
mhsdesign opened this issue Feb 13, 2023 · 0 comments
Open

Method count is not callable in untrusted context (totalCount) #46

mhsdesign opened this issue Feb 13, 2023 · 0 comments

Comments

@mhsdesign
Copy link

I get an error in combination with Flowpack Simple search at line:

totalCount = ${Type.getType(props.collection) == 'array' ? q(props.collection).count() : props.collection.count()}

props.collection has changed in Flowpack.SimpleSearch with this pr:
https://github.com/Flowpack/Flowpack.SimpleSearch.ContentRepositoryAdaptor/pull/39/files#diff-ffc206e78cb0c19096185c41a6daf40384dee16565b7a919e5438c6ce1d2cb7fR223

and is no longer a simple array but and \ArrayIterator or better a \Traversable

the fusion in totalCount should be changed to account for \Traversables

a current workaround is to call Array.values on props.collection before passing it to Flowpack.Listable:PaginatedCollection

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