Skip to content

PaginatedArrayList vs ArrayList creating problems at Permissions Filter #9246

@oarrietadotcms

Description

@oarrietadotcms

This was reported by a client: https://my.dotcms.com/tickets/detail.dot?id=4e783d02-dd82-4182-b8af-2ed5fa492eaa

In summary, they get different results in edit mode vs live mode using .totalResults value.

#set($events = $calendar.findEvents(...))
$events.totalResults

The problem:

  1. This is find events main logic.
  2. eventFactory.find(...) is returning a PaginatedArrayList.
  3. PaginatedArrayList has a totalResults property that we can use.
  4. BUT perAPI.filterCollection(...) is returning an ArrayList if the user is not an Admin.

So depending on the role you have, you will get an Arraylist or a PaginatedArrayList from the same Viewtool method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions