RequestModelAccessor gives incorrect channel in OrderHistoryViewModelBuilder

Hi,

We have an issue in a customer solution, where we have two channels, channel1 and channel2. We use a constructor injected instance of RequestModelAccessor to get the channel (_requestModelAccessor.RequestModel.ChannelModel.Channel) which works great elsewhere. In OrderHistoryViewModelBuilder however we always get channel1 from the requestmodel, even when we are visiting from channel2. Is this a bug or are we missing something obvious here?

Regards,
Felix

Litium version: 7.6.1

Can you check the URL on OrderHistoryPanelViewModel.OrderHistoryLink if it’s for the correct channel? Maybe the pointer field value is set to a specific channel.

The URL in OrderHistoryLink points to channel1, so that seems to be the issue. Any idea why that might be happening?

Also, it seems to work fine when visiting the site from the CMS in BO, or when using “Preview as published in a new tab”.

If you can check the database you can see if there’s a GUID for channel1 stored with the pointer value. You can read a little about it in this other thread: Search against Lucene index with pointeritem not working - #6 by NilsN

Removing and re-adding the pointer should clear it up.

Ah, now I see. Removed the pointer and added it again and it started working. Thanks!

Now it seems like it disregarded the channel selection for the field when previewing, is that a bug?

Not sure. If it’s reproducible you could report it as a bug so the team can investigate. Might be that when in administration mode the channel selected for the preview overrules the other.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.