Hi Umbracians!
Hoping somebody else has come across the same issue.
I am in the process of migrating a site from U7 to U8; as part of this, I have downloaded the "experimental" version of the migrations from here:
https://github.com/umbraco/Umbraco-CMS/pull/6002
And imported the database as per the guide (and then pointed my Umbraco 8.5.3 project at it).
This seems to have worked - the data is in the format I expect and most of it loads fine, having rewritten the templates etc. to work with Umbraco 8.
So far so good....
However, there are some macros which use the ContentAtXPath method to return groups of the same document type - e.g. for the site news, it tries to retrieve most recent news items. The code for that looks like this:
var xpath = "//newsItem [@isDoc]";
var newsItemsXpath = Umbraco.ContentAtXPath(xpath);
Looking at the "newsItemsXpath" variable after this code runs, there is an error when trying to evaluate the enumerator, which is:
ArgumentException: Could not cast or convert from System.Int64 to System.String[].
Message: "Error converting value 458 to type 'System.String[]'. Path '', line 1, position 3." string
This seems to be related to the issue described in the GitHub issue above, except that my understanding here is that ContentAtXpath will retrieve the data from the XML cache.
The News pages themselves seem to load without an issue, so I'm a bit stumped - I can't find where this data is in Umbraco 8.
Has anybody else experienced anything like this in V8 using ContentAtXPath?
(Also - is Xpath still the best way to do this? I could use Linq to get the items, which seems to work, but I'd be concerned about performance as this macro is used in quite a few places).