Skip to content
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

PropertyFieldFilePicker not finding images when org.asset library is on the root site #595

Open
1 of 3 tasks
Theleni-Nex opened this issue Dec 6, 2023 · 5 comments
Open
1 of 3 tasks
Assignees
Labels
help wanted status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:bug

Comments

@Theleni-Nex
Copy link

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your
needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the documentation to see if your question is already addressed there. This will help us ensure our documentation is up to date.

Category

  • Enhancement
  • Bug
  • Question

Version

Please specify what version of the library you are using: [ 3.13.0 (tested with latest too) ]

Expected / Desired Behavior / Question

There should be images to pick from if you go throught the file picker -> you organization -> library, no matter where the org.asset library is located.

Observed Behavior

Only a problem when the library is on the root site! When opening the FilePicker in sharepoint and choosing "Your organization" and then the org.asset library, this is shown empty even though there are images in the library.

Steps to Reproduce

Place an org.asset library on the root site. Create an spfx webpart that uses PropertyFieldFilePicker. Open the file picker in sharepoint and try to choose images from the org.asset library.

Think I know where this bug comes from:
in: src/services/OrgAssetsService.ts
line 21 and 22, messes it up since there is no /sites in the url when the org.asset library is on the root site:

  let libName = folderPath.replace(`${this._orgAssetsLibraryServerRelativeSiteUrl}/`, "");
  libName = libName.split("/")[0];

Thanks!

@ghost
Copy link

ghost commented Dec 6, 2023

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

@ghost ghost added the Needs: Triage 🔍 label Dec 6, 2023
@joelfmrodrigues
Copy link
Collaborator

@Theleni-Nex thanks for reporting the issue and providing your findings. Would you be willing to submit a PR with the fix?

@daniellinden22
Copy link
Contributor

daniellinden22 commented Feb 18, 2024

@joelfmrodrigues I'll happily submit a PR with a fix today or Tuesday (I work with @Theleni-Nex, so we have discussed it).
While the lines (21-22) provided are not the cause, they appear in the getListItemsByListId function and this function adds an extra / in a query parameter for the URL for the REST API call, causing the request to fail later.

@joelfmrodrigues joelfmrodrigues added the status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. label Feb 19, 2024
@daniellinden22
Copy link
Contributor

@joelfmrodrigues I have submitted a PR, please provide feedback if you have any. Is there anything else I should do, or be aware of, as of now?

@joelfmrodrigues
Copy link
Collaborator

Hi @daniellinden22, many thanks. We will review and merge or submit feedback as appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:bug
Projects
None yet
Development

No branches or pull requests

3 participants