on 07-23-2018 7:43 AM
Hi there, The problem is that I get an error in the browser console, while trying to open nested component:
"TypeError: Cannot read property 'toLowerCase' of undefined"
It happens because in function editComponent (which is in cmsItemDropdown.js) itemToEdit.typeCode is undefiened. But why and when it should be set up I can't figure out. If anybody have faced with such problem and could help - I'd really appreciate your help! Thanks in advance!
I've found the root cause and fixed it. The problem in the file: web/features/cmssmarteditContainer/components/cmsComponents/cmsItemDropdown/services/nestedComponentManagementService.js. In componentInfo object field .componentType represents deprecated typeCode, which presents only in cms components, that extend AbstractCMSComponent , but not CMSItemComponent. To fix it I've overiden original service nestedComponentManagementService:
angular.module('overridenNestedComponentManagementServiceModule', [...])
.service('nestedComponentManagementService', function(...) {
...
var prepareComponentData = function(...) {
var componentType = componentInfo.componentType || componentInfo.content.itemtype;
...
return {
...
componentType: componentType,
...
... {
typeCode: componentType,
itemtype: componentType,
...
}, ...),
};
};
...
});
More details in my blog:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.