Adds better error handling to missing grid editors
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
<p class="red">Something went wrong with this editor, below is the data stored:</p>
|
||||
<pre>{{control | json}}</pre>
|
||||
@@ -572,18 +572,31 @@ angular.module("umbraco")
|
||||
control.$index = index;
|
||||
control.$uniqueId = $scope.setUniqueId();
|
||||
|
||||
//error handling in case of missing editor..
|
||||
//should only happen if stripped earlier
|
||||
if(!control.editor){
|
||||
control.$editorPath = "views/propertyeditors/grid/editors/error.html";
|
||||
}
|
||||
|
||||
if(!control.$editorPath){
|
||||
var editorConfig = $scope.getEditor(control.editor.alias);
|
||||
control.editor = editorConfig;
|
||||
|
||||
//if its a path
|
||||
if(_.indexOf(control.editor.view, "/") >= 0){
|
||||
control.$editorPath = control.editor.view;
|
||||
if(editorConfig){
|
||||
control.editor = editorConfig;
|
||||
|
||||
//if its a path
|
||||
if(_.indexOf(control.editor.view, "/") >= 0){
|
||||
control.$editorPath = control.editor.view;
|
||||
}else{
|
||||
//use convention
|
||||
control.$editorPath = "views/propertyeditors/grid/editors/" + control.editor.view + ".html";
|
||||
}
|
||||
}else{
|
||||
//use convention
|
||||
control.$editorPath = "views/propertyeditors/grid/editors/" + control.editor.view + ".html";
|
||||
control.$editorPath = "views/propertyeditors/grid/editors/error.html";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user