umbraco / Umbraco.Cms.Integrations

MIT License
31 stars 20 forks source link

Javascript error on staging sites #173

Closed luke-brown-increment-agency closed 3 months ago

luke-brown-increment-agency commented 3 months ago

I've installed the Umbraco.Cms.Integrations.Crm.Dynamics into a client site I'm working on that is in version 10.6.1 of Umbraco. On my development machine I can add a link to microsoft dynamics using the Connect button that appears in the configuration control in the datatype in the settings area of Umbraco and connect to the correct microsoft dynamics installation and verify this. However when I've released this, to 2 seperate staging sites, the Connect and Revoke buttons don't appear on the configuration control in the datatype. A javascript error is visible in the console area when I go into Chrome dev tools: Error: [$controller:ctrlreg] http://errors.angularjs.org/1.8.3/$controller/ctrlreg?p0=Umbraco.Cms.Integrations.Crm.Dynamics.ConfigurationController at umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:25:168 at umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:117:19 at ea (umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:99:20) at p (umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:90:355) at g (umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:84:186) at umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:83:311 at Object.link (umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:321:432) at umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:35:134 at Ca (umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:108:361) at p (umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:92:340) '

'

umbraco-backoffice-js.js.v681b890be59caa30838d617ee76d51b032210541:147

I've ensured the confiuration settings are correct in appsettings and I've verified that all the files are in the App_Plugins folder on the staging site. Please could this be resolved so my client can use this integration? Let me know if you need any more information.

acoumb commented 3 months ago

Hi @luke-brown-increment-agency ,

I've tried replicating your use case and installed Dynamics on a cloud instance of Umbraco, and did not encounter any issues - you can check this demo for reference.

My settings look like this:

"Integrations": {
  "Crm": {
    "Dynamics": {
      "Settings": {
        "HostUrl": "https://org....crm4.dynamics.com/",
        "ApiPath": "api/data/v9.2/"
      }
    }
  }
}

Could you provide me with more details that could help identify the cause of the issue?

Thank you, Adrian

luke-brown-increment-agency commented 3 months ago

Hi Adrian,

Thanks for getting back to me as this is a pressing issue from our client. They are currently using hubspot forms and their subscription for this runs out next week and we need to get them onto dynamics forms by then.

Both the staging sites are hosted in Azure, not Umbraco cloud. I’m not sure if it’s possibly an Azure hosting issue, as it works in my localhost IIS.

This is my configuration, which looks the same as yours, apart from it’s crm11.dynamics.com and not crm4.dynamics.com: "Integrations": { "Crm": { "Dynamics": { "Settings": { "HostUrl": "https://{clientAPI}.api.crm11.dynamics.com/", "ApiPath": "api/data/v9.2/" } } }

}

Will this make a difference?

Let me know if you need any more info or I can help in anyway, there is a lot of pressure on me to resolve this ASAP, so I’ll help in any way I can.

Thanks,

Luke

acoumb commented 3 months ago

Could you also try clearing the cache as detailed here?

If this persists, then maybe we can schedule a meeting to walk me through the issue? Just drop me an email at aco@umbraco.com.

Regards, Adrian

luke-brown-increment-agency commented 3 months ago

Hi Adrian,

Cache busting has resolved it! I had to do 2 releases to add it in, but it worked! Thanks for all your help and also thanks for resolving it so promptly. #h5yr

Hopefully this will help anyone else who has the same issue in the future.

Thanks,

Luke

acoumb commented 3 months ago

Happy to hear that. Glad I could be of assistance.

Adrian