Closed jansenbe closed 5 years ago
@pkbullock : was looking at LoadPublishingPageFromWebServices and as things go wrong when parsing the page file for web part properties, more specifically because the "cleaning" work did not result in valid XML.
I was wondering why we don't use the AngleSharp HtmlParser instead, the document was already loaded in there and we could retrieve all WebPartContent/WebPart nodes that way...this would possibly avoid the XML issues.
This is just an observation, did not test this and maybe there's a specific reason for the current approach that I'm not aware of.
@jansenbe I did start to look at using AngleSharp initially, but had problems where HTML/XML mixture was causing issues with node crawling and encoding (if i remember), AngleSharp does support XML but because we are using version 0.9 of AngleSharp, the XML module isn't supported, at the time, i felt the code change was too great but perhaps should have discussed this with you.
There are points in the code that are smelly, i don't particular like my approach. I will patch for now, and revisit this after.
Thx @pkbullock : do you have time to handle this before the October release?
@jansenbe in a peak but hopefully will be clear after this weekend or sooner. Client Intranet went live weekend just gone so clearing the sawdust. ☺️
@jansenbe how did the above get produced btw? Think might seen a reference in another ticket to web part in wiki page?
It was referenced in #234, but I moved it over here as it was something different than the original issue
@gautamdsheth i suspect just need to add "asp" to list of prefixes because its the built in asp.net prefix. The rest are dynamically determined by the assembly references at the top of the page. If i remember custom controls need to be referenced in the header.
hey @pkbullock , the issue is coming from the OOTB dataform webpart. Not sure how to fix it. When reaching this line, it throws the error:
Have attached the generated xml, the issue occurs when reaching this section:
<asp:Parameter DefaultValue="{134230eb-f079-4802-8e4d-d26529454f70}" Name="ListID"></asp:Parameter>
@gautamdsheth thank you for this, it is very useful in reproduction steps. I just need to add a step to either declare the prefix or remove it from Xml parsing. I will submit PR for this.
Hi both,
been investigating this one, i am not sure its worth fixing, i cannot reproduce this easily, for example not able to create a data form web part on Publishing Page in 2013 in the pages library, SharePoint Designer doesn't allow me to do that, possibly a remnant from a previous migration .
In addition, there is no web part modern option for this - https://github.com/SharePoint/sp-dev-modernization/blob/master/Tools/SharePoint.Modernization/SharePointPnP.Modernization.Framework/Nuget/webpartmapping.xml#L748
Granted its a bug in the XML parsing with 'asp' but that a ASP.NET prefix and perhaps, i should just do something dirty by removing the prefix, we cannot do anything with the tag. We just need it not to blow up the page.
Thoughts?
Hi @pkbullock , @gautamdsheth ,
DataForm web part is from 2010 timeframe and has most likely just survived the migrations. We indeed can't migrate that one but that same page hosting this web part most likely will also contain other content/webparts that can be migrated. Having a fix that prevents this page from failing is something we need to enable that scenario. Ideally we at least see there's a DataForm web part, not having it's properties is fine.
Sorry! looking back my response wasn't the right attitude to this problem, i will get on and fix this soon submit a PR.
@pkbullock , thanks for your PR, I've just merged it.
@gautamdsheth / @krishnachaluvadi : this will be part of the upcoming October release. Alternatively you need to build from our dev branch (like @gautamdsheth already has been doing for testing things).
Question .. we are seeing this on a migration and rather than "asp" we are seeing "spssvc". Do you know of a way to get around this error? Is there anything we can do to the source page layout to permit the page to migrate without the error? Any other work around suggestions?
Log output of the failed request.
Modernisation Summary Report
Warnings during transformation
Critical Errors during transformation
9/9/2019 11:03:12 PM - /dept/opa/pages/default.aspx
'asp' is an undeclared prefix. Line 82, position 2. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node) at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup() at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.LoadXml(String xml) at SharePointPnP.Modernization.Framework.Pages.BasePage.LoadPublishingPageFromWebServices(String fullUrl) at SharePointPnP.Modernization.Framework.Pages.PublishingPageOnPremises.Analyze(PageLayout publishingPageTransformationModel) at SharePointPnP.Modernization.Framework.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)
Individual Page details
Transformation Details: /dept/opa/pages/default.aspx
Page Transformation Settings
Transformation Operation Details