Skip to content

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

@mhsdesign

Description

@mhsdesign

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions