xRM-Portals-Community-Edition icon indicating copy to clipboard operation
xRM-Portals-Community-Edition copied to clipboard

Portal Name - is it needed? Can we force context to refresh in code? Cache is not refreshed on Forum Creation

Open fainelia opened this issue 7 years ago • 3 comments

Hello, Through the code we see that Portal Name is null and it looks to be an important parameter since it is used to create Portal Context and then to get the Context=PortalContext.ServiceContext if we look into Form.aspx.cs file we see that Portal Name is pulled from Language Code and it is 1033 here are the snapshots of the code: image

and then it fails the if condition because the name is expected to be: "Xrm"

image

and one more question, is it possible to force context to refresh in the code?

thank you

fainelia avatar Sep 07 '18 20:09 fainelia

and then it fails the if condition because the name is expected to be: "Xrm"

Is something not working properly due to the way this code works right now? What is the scenario where this template is being used?

is it possible to force context to refresh in the code?

What context are you referring to, and why do you want to refresh it?

amervitz avatar Sep 07 '18 21:09 amervitz

Hi,

This is just one of many examples where the use of PortalName isn't defined. We have an issue where the portal is incapable of finding a newly created forum unless we navigated to _service/about and clear the Cache, or restart the IIS web server. While attempting to debug, we noticed that the context used to retrieve the forums doesn't retrieve the most recent forums, we also noticed that the portal name being passed around to create the context is null. Example:

  1. Create a forum from the portal (We have a bilingual portal)
  2. Attempt to navigate to that forums page
  3. Receive page not found error
  4. Restart the portal or clear the cache then go back to step 2 and it works

We've identified that in the file ForumSiteMapProvider.cs at line 142, the context fails to retrieve any newly created forum nodes unless we clear cache or restart the website. Consequently line 145 returns null.

jliberta avatar Sep 07 '18 22:09 jliberta

Just to add: Forums are included in Web Notifications

fainelia avatar Sep 08 '18 01:09 fainelia