sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Property Bag value got lost after creating modern site

Open rbarten opened this issue 8 years ago • 2 comments

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Property Bag value should be kept stored after setting it.

Observed Behavior

When we set a Property Bag value immediately after creating a modern site and enable scripting. The value got lost after a few seconds. When we reset it after that, the value keeps stored.

Steps to Reproduce

  1. Create Modern Site with New-PnPSite
  2. Set NoScriptSite to false
  3. Set Property Bag Value
  4. Check if value is kept stored.

See script below:

$adminConnection = Connect-PnPOnline -Url "https://contoso-admin.sharepoint.com" -Credentials PnPCreds -ReturnConnection
$siteTitle = "[SiteTitle]"
$siteUrl = New-PnPSite -Type TeamSite -Title $siteTitle -Alias $siteTitle -Connection $adminConnection -ErrorAction Stop
$property = "TEST"
Set-PnPTenantSite -Connection $adminConnection -Url $siteUrl -NoScriptSite:$false -Sharing ExistingExternalUserSharingOnly

Connect-PnPOnline -Url $siteUrl -Credentials PnPCreds

Set-PnPPropertyBagValue -Key $property -Value $siteTitle

function CheckPropertyBagValue() {
    do{
        $prop = Get-PnPPropertyBag -Key $property 
        Write-Host "Property has value: $prop" -ForegroundColor Green
    } while($prop.Length -gt 0)
    Write-Host "Property is empty!!!" -ForegroundColor Red
}

CheckPropertyBagValue

rbarten avatar Mar 16 '18 10:03 rbarten

I am also seeing this issue. It does not happen always though... Same thing also happens on communication sites. Also after creating a modern site many different elements get renamed or recreated (e.g. Site Groups). This is all related to the async provisioning of modern sites. What we need is an event to find out when a modern site is really provisioned...

OliverZeiser avatar Mar 19 '18 11:03 OliverZeiser

This issue is being closed as part of an issue list cleanup project. Issues with no activity in the past 6 months that aren't tracked by engineering as bugs were closed as part of this inititive. If this is still an issue, please follow the steps outlined to re-open the issue.

msft-github-bot avatar Jan 22 '20 21:01 msft-github-bot