Flowpack.Listable icon indicating copy to clipboard operation
Flowpack.Listable copied to clipboard

Method `count` is not callable in untrusted context (`totalCount`)

Open mhsdesign opened this issue 2 years ago • 0 comments

I get an error in combination with Flowpack Simple search at line: https://github.com/Flowpack/Flowpack.Listable/blob/0dfe9e278b7c52d06ec25ca179356106737caa89/Resources/Private/Fusion/PaginatedCollection.fusion#L31

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

mhsdesign avatar Feb 13 '23 08:02 mhsdesign