Vorto and Archetype are not working in the Extended Content of Merchello
Both of these packages are not working correctly in the Extended Content of Merchello, while they work just fine in the normal umbraco content.
The following error is being thrown - "Cannot read property 'contentTypeAlias' of null" on line 305 in the vorto.js file, which is located in the App_Plugins folder.
I have debugged the problem and basically the issue is that "editorState.current" is being null. This is due that - "editorState" is expected to be injected in and filled but instead it is just being null.
Now I ran out of ideas how to fix this, thus I came here for your help. I think I have supplied enough detail on the issue, but if something is not clear please let me know.
Can someone help me out in fixing such issue please?
To anyone in the future who has this same issue I have fixed it by doing the following:
Added the following block of code in line 13 of the vorto.js file, which can be found in the App_Plugins folder:
if (currentSection == "merchello")
{
currentSection = "content";
// 2871 is the id of any umbraco content node
editorState.current.id = 2871;
// 1129 is the id of the home page umbraco content node
editorState.current.parentId = 1129;
}
Also I have added the following line of code on line 6957 of the merchello.controllers.js file, which can also be found in the App_Plugins folder
editorState.set(scaffold);
Its a little bit of hacking but its a workaround that works.
The line number you're referencing might change as new Merchello versions are released. Can you specify where you're actually adding the line of JS relative to a method or at least provide a snippet with some of the surrounding code?
angular.module("umbraco").controller("Our.Umbraco.PropertyEditors.Vorto.vortoEditor", [
'$scope',
'$rootScope',
'appState',
'editorState',
'formHelper',
'umbPropEditorHelper',
'Our.Umbraco.Resources.Vorto.vortoResources',
'Our.Umbraco.Services.Vorto.vortoLocalStorageService',
function ($scope, $rootScope, appState, editorState, formHelper, umbPropEditorHelper, vortoResources, localStorageService) {
var currentSection = appState.getSectionState("currentSection");
if (currentSection == "merchello")
{
currentSection = "content";
// 2871 is the id of the packages umbraco content node
editorState.current.id = 2871;
// 1129 is the id of the home page umbraco content node
editorState.current.parentId = 1129;
}
And
// The content type scaffold
function loadScaffold() {
// every detached content associated with a variant MUST share the same content type,
var detachedContentType = $scope.productVariant.detachedContentType();
if (!editor.ready(detachedContentType)) {
contentResource.getScaffold(-20, detachedContentType.umbContentType.alias).then(function(scaffold) {
editor.detachedContentType = detachedContentType;
editor.scaffold = scaffold;
//currentScaffold.filterTabs($scope.contentTabs, $scope.tabs);
//currentScaffold.fillValues($scope.tabs, $scope.detachedContent);
filterTabs(scaffold);
editorState.set(scaffold);
fillValues();
stickTab();
$scope.preValuesLoaded = true;
});
} else {
filterTabs(editor.scaffold);
fillValues();
stickTab();
$scope.preValuesLoaded = true;
}
}
Vorto and Archetype are not working in the Extended Content of Merchello
Both of these packages are not working correctly in the Extended Content of Merchello, while they work just fine in the normal umbraco content.
The following error is being thrown - "Cannot read property 'contentTypeAlias' of null" on line 305 in the vorto.js file, which is located in the App_Plugins folder.
I have debugged the problem and basically the issue is that "editorState.current" is being null. This is due that - "editorState" is expected to be injected in and filled but instead it is just being null.
After some research, for the archetype package I have found this workaround: https://our.umbraco.org/projects/collaboration/merchello/merchello/76463-using-archetype-with-merchello, which works but it is kind of hacky. On vorto I have found nothing, thus I tried to make this solution also work for it, but I wasn't successful since vorto works a little bit different.
Now I ran out of ideas how to fix this, thus I came here for your help. I think I have supplied enough detail on the issue, but if something is not clear please let me know.
Can someone help me out in fixing such issue please?
Thanks
I have now updated the description to be more detailed. Can anyone give me a hand on this please? Thanks
Anyone has any input on this please?
To anyone in the future who has this same issue I have fixed it by doing the following:
Added the following block of code in line 13 of the vorto.js file, which can be found in the App_Plugins folder:
}
Also I have added the following line of code on line 6957 of the merchello.controllers.js file, which can also be found in the App_Plugins folder
Its a little bit of hacking but its a workaround that works.
Hi Fabian,
The line number you're referencing might change as new Merchello versions are released. Can you specify where you're actually adding the line of JS relative to a method or at least provide a snippet with some of the surrounding code?
Thank you!
Hi Chris,
Here you go:
And
is working on a reply...