Skip to content

[5.x]: Sibling Assets do not appear when Subfolder count is too high #18213

@mike-moreau

Description

@mike-moreau

What happened?

Description

I have a filesystem with several levels of nested subfolders.

One nested folder contains 50 child folders and 16 Assets within the same parent.

Only the 50 child folders display in the table. The Assets do not display. They are not returned in the ajax request, and no pagination is displayed.

It appears that the issue is in this logic in the Asset Element's indexElements method:

count($assets) === (int)$elementQuery->limit

Both count($assets) === (int)$elementQuery->limit were 50 in my case.

If I comment that out and continue to the array_merge, then the subfolders and assets appear as expected.

Steps to reproduce

  1. Create a folder with over 50 subfolders and some Assets

Expected behavior

All items or pagination displays.

Actual behavior

Only folders display.

Craft CMS version

5.8.21

PHP version

8.3

Operating system and version

No response

Database type and version

MySQL 8

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

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