loadTagNamespaces in /libs/cq/tagging/widget.js is loading the tagNamespaces wrongly when I give tagsBasePath as /etc/tags/facebook/work for xtype:tags?
Hello Team,
I have a requirement to show up the tags only for tag path /etc/tags/facebook/work. I played with tagsBasePath as /etc/tags/facebook/work to get only facebook work tags displayed. But when I click on the tag to get added, tag is not getting added. When I digged into the code, I am seeing the following error. I am not sure If I should not change the tagsBasePath and please help me how to achieve my functionality.
loadTagNamespaces: function() {
this.tagNamespaces = {};
var tagJson = this.loadJson(this.tagsBasePath + CQ.tagging.TAG_LIST_JSON_SUFFIX + "?count=false");
if (tagJson && tagJson.tags) {
CQ.Ext.each(tagJson.tags, function(t) {
this.tagNamespaces[t.name] = t;
}, this);
}
this.setupPopupMenu();
this.tagNamespacesLoaded = true;
}
facebook:work/employer/305115773870 -- nsTagId
getNamespaceDefinition: function(nsTagID) {
if (!this.tagNamespacesLoaded) {
this.loadTagNamespaces();
}
var nsName = CQ.tagging.parseTagID(nsTagID).namespace;
return this.tagNamespaces[nsName];
}
Here as a result : I am getting the getNamespaceDefinition function returning the value as undefined.
checkMaximum: function(tag) {
var ns;
if (typeof tag === "string") {
// new tag
if (this.displayTitles) {
ns = this.getNamespaceDefinitionByTitlePath(tag);
} else {
ns = this.getNamespaceDefinition(tag);
}
} else {
// existing tag
ns = this.getNamespaceDefinition(tag.tagID);
}
if (ns === null) {
// if the namespace is not found, we can't change for a maximum and have to accept it
return true;
}
var cfg = this.getNamespaceConfig(ns.name); -- ns.name of undefined is giving the above error for which I have provided the stack trace.
...
}
values that I got out of debug:
Best Regards,
Durga