check the actual query limit, not one adjusted for the folders count #18222
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes an issue that occurred on the assets index page when the number of folders was exactly 50, and there were assets on the same level. In such a case, 50 folders were shown, but none of the assets. The pagination (and lazy loading for an assets index modal) is set to kick in at 100, but since the number of items shown on the screen is just 50, it won’t.
The original element query limit is set to 100. We first get the folders (50 in this case) and adjust the element query limit value by subtracting the number of folders. The new limit is now 50, which is what we want. However, a later check to see if we had hit the limit is now incorrectly met, causing us to only return the 50 folders.
If you added one more folder (or removed one), the assets started showing again, and pagination/lazy loading kicked in when going over 100.
Related issues
#18213