Skip to content

ListItemAttachments webUrl property is not working #1975

@Floris-Pleegzorg-Oost-Vlaanderen

Description

Category

[ ] Enhancement

[X ] Bug

[ ] Question

Version

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

If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.

Expected / Desired Behavior / Question

I want to use ListItemAttachments in my project and I test with sharepoint.com/_layouts/15/workbench.aspx.

My component request looks like this.

<ListItemAttachments
                    webUrl="https://tenantname.sharepoint.com/sites/Data/"
                    listId="0299c622-3efe-4b97-81f1-7e082d157bla"
                    itemId={15}
                    context={context}
                />

Observed Behavior

I always get the following message "Problem loading attachment, reason: files is null"
In the webbrowser console I see that instead of the webUrl being used the base url is used. I see this:

https://tenantname.sharepoint.com/_api/web/lists(@listId)/items(@itemId)/AttachmentFiles?@listId=guid'0299c622-3efe-4b97-81f1-7e082d157bla'&@itemId=15

I expected:

https://tenantname.sharepoint.com/sites/Data/_api/web/lists(@listId)/items(@itemId)/AttachmentFiles?@listId=guid'0299c622-3efe-4b97-81f1-7e082d157bla'&@itemId=15

I think that the problem is that in the file
src/controls/listItemAttachments/ListItemAttachments.tsx

this._spservice is called but webUrl is not always passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions