Fixed  Importing a style gives error

Junior

Well-known member
When I attempt to import a style I get the following error:
The provided file was not a valid XML file. Please provide a valid XML file.
The XML I am importing is a copy of a style already on my site that I exported. I've tried exporting it multiple times. I've tried uploading it as a new style and overwriting. XenForo 1.0.1
 
Oddly enough it downloads one of my other styles and imports it just fine. Seems to be something going wrong with just this one xml
 
It's actually a unique skin that I'd like to stay one of a kind :/ I'll post a ticket.

Edit: Solved, going to attempt to duplicate error.
Edit: Reproduced. I edited the google_analytics template replacing this line:

Code:
var _gaq = [['_setAccount', '{$xenOptions.googleAnalyticsWebPropertyId}'], ['_trackPageview']];

With this:

Code:
var _gaq = [['_setAccount', '{$xenOptions.googleAnalyticsWebPropertyId}'], ['_setDomainName','www.website.com'], ['_trackPageview']];
Note: Dug deeper and found thats not the problem. Any edit of the google_analytics template seems to cause the XML error.
 
It may be related to the "]]" looking like the end of CDATA. I will have to confirm though.
 
I'm going to send in a ticket. When restoring the analytics template, I was able to import it but the js_head and the page_container template had missing data causing the site to render oddly. I had to go and copy the data from the old template to the new one.
 
Just for reference, I edited the analytics template (just to add a space) and was able to export and import the resulting style XML. You'll need to provide the XML that doesn't work for you.
 
I've been meaning to send in a ticket. Just being lazy and all. I'm going to mention now, when reverting the template and uploading the pm, a few of the templates were messed up. They the page_container and js_head (idk full name off the top of my head) we're missing lines. These are both customized templates. I had to copy and past them from the original xml for things to display properly.

I'll get a ticket up now.
 
Turned out to be this line:

// /* ]]> */</script><script type="text/javascript"

Which contains the end of a CDATA string.
 
CDATA string ends are now escaped in during the template export (and replaced during import).
 
Top Bottom