Skip to content

Conversation

@AndyButland
Copy link
Contributor

@AndyButland AndyButland commented Nov 28, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

Fixes: #20975

Description

This PR fixes the regression described in the linked issue.

Testing

To replicate the original issue:

  • Create a media structure where you have a folder without any items in it.
  • Create a media picker on a document that allows navigation into that folder
  • Using the picker, navigate into the folder and click the "Media" root of the breadcrumb to reveal the error.

With this PR in place you should navigate back to the root without error.

Copilot AI review requested due to automatic review settings November 28, 2025 09:15
@AndyButland AndyButland changed the title Media Picker Fixed folder navigation when returning from an empty folder Media Picker Fixed folder navigation when returning from an empty folder (closes #20975) Nov 28, 2025
Copilot finished reviewing on behalf of AndyButland November 28, 2025 09:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a regression in the media picker where navigating from an empty folder back to the root caused an error. The issue occurred because the API returns a pageSize of 0 for empty folders, which was being blindly assigned to the pagination options, breaking subsequent navigation.

Key changes:

  • Added a guard condition to prevent updating pageSize when the value is 0 or less

@leekelleher leekelleher self-requested a review December 1, 2025 12:19
Copy link
Member

@leekelleher leekelleher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested out, works as described. 🚀

@leekelleher leekelleher merged commit da677c4 into v13/dev Dec 1, 2025
20 checks passed
@leekelleher leekelleher deleted the v13/bugfix/handle-empty-folder-in-media-picker branch December 1, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants