How you resolve page reference? Is it pure 7.5 or above with some update applied?
I *think* you need to load Page B by yourself. Something like this:
if (pageA.LinkType == PageShortcutType.FetchData)
{
var loader = ServiceLocator.Current.GetInstance();
var reference = ContentReference.Parse(pageA.ExternalURL);
var pageB = loader.Get(reference);
}
The fetch data functionality is not handled in the API, but rather in the PageBase class, which implements ICurrentPage. Or similar class in mvc.
Below code runs in a UserControl on Page A (and is not working).
var loader = ServiceLocator.Current.GetInstance();
PageData pageBData = loader.Get(PageBReference);
PageReference pageCLink = pageBData.GetPropertyValue("PageCReference");
PageDataCollection pdc = GetChildren(pageCLink);
With a Url-property pointing to the same PageC it works well with PafeReference.ParseUrl()
I have another example of another case where things go wrong. We have a page where there is a PageReference-property which resolves incorrectly to the same page which is being rendered (in viewmode). But... in editmode it resolves to the correct page....
I think I've found a workaround and indication that this in fact is a bug. If I republish the page containing the PageReference it resolves correctly. Very strange behaviour and complicates the upgrade process. This is with version. 7.13.2.0.
This certainly seems like a bug. I have tracked it down by downgrading the solution from 7.13.2 to 7.7.1. In 7.7.1 it works as expected but not in 7.8.0.
Note: The republishing did not solve the issue. When the Application Pool is restarted the problem re-appears.
I have the exakt same problem in my projekt. Have you found a soloution or reported it as a developer incident?
I have not found a solution for this. Registered an incident. The customer decided not to send the project to the support. Partly because of the fact that this will not longer be a problem when they change the approach in the implementation. But also that there was no possibility that they would send the Visual Studio solution to the support. There was also no available time to recreate the problem in a separate VS-solution, so the decision was made to let the ticket die.
If you decide to file a ticket you maybe could point to our ticket for reference (DI-142444).
We have an upgraded EPiServer 7.5 site. Within that site there is function in place using pages as containers for info which is used for reference when producing content in a page. In short it is something like this:
Page A reads info from Page B. Page B contains a PageReference-property pointing to Page C (which is supposed to be used as a root page for listing). In the edit UI it all seems ok. But when we programmatically tries to read the property from Page B it does not resolve to the PageReference of Page C but itself (Page B).
Is it a bug or am I missing something?