Description
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.
If you navigate to the list settings, you see an error.
If you the the url to open the second view, you see "Error" on the Browser-Tab and errors in the console.
It may has to do with the new list layout?
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
- Create a new webpart project with react.
- Add an elements.xml to deploy a custom field (text), a content type and a list.
- Add a schema.xml for the list and include two views.
- deploy the solution and add the app
Expected behavior
Both views should be valid