Skip to content

FilePicker can't browse "Your organisation" tab when used in webpart on the root/home SharePoint site #1766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stevesuk opened this issue Feb 14, 2024 · 2 comments · Fixed by #1861 or #1863
Assignees
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Milestone

Comments

@stevesuk
Copy link

Category

[ ] Enhancement
[X] Bug
[ ] Question

Version

Please specify what version of the library you are using: [3.17.0]

Expected / Desired Behavior / Question

When editing a content page on the root SharePoint site, when I open the FilePicker control and click the "Your organisation" tab, and then "Images" - I expect to see a list of the files/folders from my org assets image library.

Observed Behavior

On root/home SharePoint site, it doesn't work - and you instead see a spinner icon, with an error logged in the debug console. This only happens on the root/home site. If I use the control on any other site in my SharePoint tenant, it works.

Steps to Reproduce

Create a page in the root/home site of SharePoint, and add a webpart that uses the FilePicker control, and try to browse to Images on the "Your organisation" tab.

More information:

I think the fact the page is being created on the home site (and not within a site that has a Url beginning /sites/my-site/) is confusing the code that builds the Url to fetch the org assets listing from the API.

When using the home/root site, it tries to use this Url to fetch the folder/file list from the org assets image library - which fails:

https://MYTENANT.sharepoint.com/_api/SP.List.GetListDataAsStream?listFullUrl=%27https://MYTENANT.sharepoint.com/sites/OrgAssetssites%27&RootFolder=sites/OrgAssets/ACMEImages

When on a normal site, it uses this Url, which works:

https://MYTENANT.sharepoint.com/sites/MYSITE/_api/SP.List.GetListDataAsStream?listFullUrl=%27https://MYTENANT.sharepoint.com/sites/OrgAssets/ACMEImages%27&RootFolder=/sites/OrgAssets/ACMEImages

On the first link, there seems to be some corruption around the area of /OrgAssetssites%27 (our library is called OrgAssets, but its appended the word "sites" on to the end).

Thank you!

@ghost
Copy link

ghost commented Feb 14, 2024

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@michaelmaillot
Copy link
Collaborator

Hi @stevesuk,

Nice catch!

FYI, a fix has been merged and should be available in next beta release soon.

@michaelmaillot michaelmaillot self-assigned this Aug 12, 2024
@michaelmaillot michaelmaillot added status:fixed-next-drop Issue will be fixed in upcoming release. type:bug and removed Needs: Triage 🔍 labels Aug 12, 2024
@michaelmaillot michaelmaillot added this to the 3.19.0 milestone Aug 12, 2024
@AJIXuMuK AJIXuMuK mentioned this issue Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Projects
None yet
2 participants