Hello,
We have just installed Service Pack 4 in our servers and ContextHub is now failing to show Ui Modes.
We are getting this error in the Chrome console, while trying to edit a Segment (Audience):
Uncaught TypeError: window.injectContextHubUI is not a function
The segmentation is not working at all within our pages, and the segmentation toolbar is also not being displayed while previewing content.
Anyone knows a solution for this?
(Edited: by the way, I am migrating from 6.4 SP3)
Solved! Go to Solution.
Views
Replies
Total Likes
Hi guys,
I finally found the cause and a solution for the problem.
I don't know why, but the guys here (programmers) have used the keyword "let" in some Javascript code ("let" was introduced in ECMAScript 6).
It was working fine before SP4, but a simple change in our code to "var", making the code complaint with old Javascript versions, solved the problem.
The code was in a custom implementation of a Store, inside the following JS file:
/apps/myproject/components/contexthub/stores/mycustomstore/store.mycustomstore.js
You need to make sure that ContentHub was included to a Page Component: Setup ContextHub
Also, you can try to recompile clientlibs: How to force a recompilation of all Sling scripts jsps, java, and sightly in AEM 6.4
Views
Replies
Total Likes
As part of 6.4.4.0 release notes [0], there was an update to Jquery library. you might want to check if there isn't a conflict in jquery libraries.
Note from release notes:
Migrate contexthub to jquery 3. NPR-28397: Hotfix for GRANITE-19902
[0]
Views
Replies
Total Likes
Hi Guys, I am still not able to use ContextHub with AEM 6.4 SP4.
I have tried to load various clientlibs, including the following:
- granite.query
- granite.utils
- cq.jquery
- cq.wcm.foundation
- cq.wcm.foundation-main
It works correctly under no-SP, SP1, SP2 and SP3.
Views
Replies
Total Likes
Hello,
I do not see any issue with the editing of Audiences or loading of we-retail contexthub in 6.4 Sp4.
However, there is another issue with the /etc/cloudsettings.styles.css/libs/settings/cloudsettings/legacy/contexthub request throwing 500 intermittently which is resolved in Sp6 (NPR-29946).
Is there any error in the logs?
Regards,
Vishu
Views
Replies
Total Likes
Hi dhaliwal,
You are right, the We.Retail uses the default ContextHub Path and Segments Path.
If I change my project to use the default ones (like in We Retail) then the segmentation toolbar displays correctly while editing Audience (Segments) and also while authoring my Pages.
But in our case, we are using custom Ui Modes. We need to change those paths in page/audience configuration.
Views
Replies
Total Likes
Looking up in the error logs, the only thing that I could see is this error:
==> error.log <==
25.09.2019 15:28:24.189 *WARN* [0:0:0:0:0:0:0:1 [1569436104123] GET /editor.html/conf/myproject/settings/wcm/segments/novo.html HTTP/1.1] org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy Ignoring reference to /conf/myproject/settings from /conf/myproject/settings - Probably misconfigured as it ends with '/settings'
I don't know if it relates to the Contexthub problem.
Views
Replies
Total Likes
Hi guys,
I finally found the cause and a solution for the problem.
I don't know why, but the guys here (programmers) have used the keyword "let" in some Javascript code ("let" was introduced in ECMAScript 6).
It was working fine before SP4, but a simple change in our code to "var", making the code complaint with old Javascript versions, solved the problem.
The code was in a custom implementation of a Store, inside the following JS file:
/apps/myproject/components/contexthub/stores/mycustomstore/store.mycustomstore.js
Our application is relying heavily on ECMAscript 6 but we believe this is not the common error that triggers this javascript error. To solve it, we loaded the following clientlib in our component customerheaderlib.html
Views
Replies
Total Likes