SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 1k forks source link

Site Design Rest API Does Not Make createSPList Verbs Correctly ( SiteScriptUtility GetSiteScriptFromWeb GetSiteScriptFromList ) #9332

Open influential-eliot opened 10 months ago

influential-eliot commented 10 months ago

Incident

When running the GetSiteScriptFromWeb API endpoint on the Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility API it does not build the createSPList verb correctly.

It places the 'Title' in the 'listName' key, which will cause incorrectly made sites when the script is applied as the list or library will not be at the required location. This will obviously then mean that any relative links in the new site to said list or library will have the potential to be wrong.

This also occurs (and is even displayed as an example) on the GetSiteScriptFromList endpoint.


Example

Colloquial

As an example the following url and title:

... will result in a list created at this URL when the script is applied:

JSON

This is what is actually created:

{
    "verb": "createSPList",
    "listName": "Document Management",
    ...
}

Here are the properties that SHOULD be created:

{
    "verb": "createSPList",
    "listName": "documentmanagement",
    ...
    "subactions": [
        {
            "verb": "setTitle",
            "title": "Document Management"
        }
    ]
}

EDIT NOTES

I've added the GetSiteScriptFromList part.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ghost commented 10 months ago

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

influential-eliot commented 7 months ago

Hiya, what's going on with this, it is now causing client issues with automated script generation.

Sorry, I don't mean to add pressure by saying that ... however it should make the script so that the list is created with the same URL and Title/Display Name so that links in new sites can be appropriately made.

Again, sorry to add this!