Skip to content

Adding multiple list views with feature deployment breaks the list #9827

Open
@EA12

Description

@EA12

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version 126.0.2592.113 (Official build) (64-bit)
  • SPFx version 1.18.2
  • Node.js version 18.19.0

Describe the bug / error

If you open the default view, you see an error message.

image

If you navigate to the list settings, you see an error.

image

If you the the url to open the second view, you see "Error" on the Browser-Tab and errors in the console.

image

It may has to do with the new list layout?

image

The elements.xml:

<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Field ID="{4d6e9ca0-d0c3-4686-8c2c-ea0dcfb4bc63}" Name="Title_EN" DisplayName="Title_EN" Type="Text" Group="ABC" /> <ContentType ID="0x010085586ab8fc79479ba6eceb515b334002" Name="CustomTest" Group="ABC" Description="Create" Inherits="FALSE"> <FieldRefs> <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Required="FALSE"/> <FieldRef ID="{4d6e9ca0-d0c3-4686-8c2c-ea0dcfb4bc63}" Name="Title_EN" /> </FieldRefs> </ContentType> <ListInstance CustomSchema="TestSchema.xml" FeatureId="00bfea71-de22-43b2-a848-c05709900100" Title="Test" Description="Multiple views test." TemplateType="100" Url="Lists/Test"> </ListInstance> </Elements>

And the TestSchema.xml:

<List xmlns:ows="Microsoft SharePoint" Title="Test" EnableContentTypes="TRUE" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Test" BaseType="0" RootWebOnly="FALSE" xmlns="http://schemas.microsoft.com/sharepoint/"> <MetaData> <ContentTypes> <ContentTypeRef ID="0x010085586ab8fc79479ba6eceb515b334002" /> </ContentTypes> <Fields></Fields> <Views> <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="First" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx"> <XslLink Default="TRUE">main.xsl</XslLink> <JSLink>clienttemplates.js</JSLink> <RowLimit Paged="TRUE">30</RowLimit> <Toolbar Type="Standard" /> <ViewFields> <FieldRef Name="Title"></FieldRef> </ViewFields> <Query> <OrderBy> <FieldRef Name="ID" Ascending="FALSE" /> </OrderBy> </Query> </View> <View BaseViewID="2" Type="HTML" WebPartZoneID="Main" DisplayName="Second" DefaultView="FALSE" MobileView="TRUE" MobileDefaultView="FALSE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="Second.aspx"> <XslLink Default="TRUE">main.xsl</XslLink> <JSLink>clienttemplates.js</JSLink> <RowLimit Paged="TRUE">30</RowLimit> <Toolbar Type="Standard" /> <ViewFields> <FieldRef Name="Title"></FieldRef> <FieldRef Name="Title_EN"></FieldRef> </ViewFields> <Query> <OrderBy> <FieldRef Name="ID" Ascending="TRUE" /> </OrderBy> </Query> </View> </Views> <Forms> <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /> <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /> <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /> </Forms> </MetaData> </List>

From my package-solution.json:

"features": [ { "title": "views Feature", "description": "The feature that activates elements of the views solution.", "id": "5ebe2b32-9764-44e4-80d7-a77dab51ce38", "version": "1.0.0.0", "assets": { "elementManifests": [ "elements.xml" ], "elementFiles": [ "TestSchema.xml" ] } } ]

Please have a look into it. - Thanks.

Steps to reproduce

  1. Create a new webpart project with react.
  2. Add an elements.xml to deploy a custom field (text), a content type and a list.
  3. Add a schema.xml for the list and include two views.
  4. deploy the solution and add the app

Expected behavior

Both views should be valid

Metadata

Metadata

Assignees

Labels

Needs: Triage 🔍Awaiting categorization and initial review.area:spfx-in-listssharepoint-developer-supportsharepoint-developer-supporttype:bug-confirmedConfirmed bug, not working as designed / expected.type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions