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

Page templates do not get checked in when provisioned via ClientSidePage if the ‘Require Check Out’ setting on the Site Pages library is enabled. #1074

Open
ryder-cayden opened this issue Oct 24, 2024 · 0 comments

Comments

@ryder-cayden
Copy link

PowerShell version: 7.4.5
PnP PowerShell version: 2.12.0

Steps to reproduce the issue:

  1. Go to your Office 365 Communication site.
  2. Open the Site Pages library settings. Go to Versioning settings and enable the "Require Check Out" setting.
  3. Create a PnP Provisioning Template with the following content and save it locally to your computer:
    <pnp:ProvisioningTemplate ID="TEST-TEMPLATE" Version="1" xmlns:pnp="http://schemas.dev.office.com/PnP/2022/09/ProvisioningSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dev.office.com/PnP/2022/09/ProvisioningSchema https://raw.githubusercontent.com/pnp/PnP-Provisioning-Schema/master/PnP.ProvisioningSchema/ProvisioningSchema-2022-09.xsd">
      <pnp:ClientSidePages>
        <pnp:ClientSidePage PromoteAsNewsArticle="false" PromoteAsTemplate="true" Overwrite="true" EnableComments="false" Title="Test Template" ContentTypeID="0x0101009D1CB255DA76424F860D91F20E6C41180034AEB35D1BFDB541808759AC34C03945" ThumbnailUrl="" PageName="Templates/Test-Template.aspx" LCID="0">
          <pnp:Header Type="Default" LayoutType="NoImage" ShowTopicHeader="false" ShowPublishDate="false" ShowBackgroundGradient="false" TopicHeader="" AlternativeText="" Authors="" AuthorByLineId="-1" />
          <pnp:Sections>
            <pnp:Section Order="1" Type="TwoColumnLeft"></pnp:Section>
            <pnp:Section Order="2" Type="OneColumn"></pnp:Section>
          </pnp:Sections>
        </pnp:ClientSidePage>
      </pnp:ClientSidePages>
    </pnp:ProvisioningTemplate>
  4. Open PowerShell Core 7 and connect to SharePoint using the Connect-PnPOnline cmdlet. To best reproduce this issue, connect using an Entra App or a different user.
  5. Ensure that the Test-Template.aspx file does not already exist in the Templates folder of the Site Pages.
  6. Deploy the PnP Provisioning template that you created in step 2 by running the following PowerShell cmdlet (replace the path of the XML file accordingly):
    Invoke-PnPSiteTemplate -Path .\Test-Template.xml
  7. "From the Office 365 UI, go to the site collection, then go to the Site Pages and Templates folder. Observe that the template you deployed is checked out. If you used an Entra App or a different user in step 6, you will not be able to see the page template and will need to go to the Site Pages library settings and then to 'Manage files which have no checked-in version' to be able to see the page template, which you need to take ownership of.

Expected behavior:
When deploying a new Page Template using a PnP Provisioning template to Site Pages with the "Require Check Out" setting turned on, the Page Template must be automatically checked in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant