Fixed rare case where a resource's dashboard would not load

This commit is contained in:
DallonF
2012-08-15 10:36:10 -07:00
parent d6d00391d0
commit 53dd5cffda

View File

@@ -80,7 +80,7 @@ Dashboard.prototype.route = function(ctx) {
if (parts.length) {
resourceId = parts[0];
resource = ctx.server.resources.filter(function(r) { return r.path === '/' + resourceId.toLowerCase() })[0];
resource = ctx.server.resources.filter(function(r) { return r.name === resourceId.toLowerCase() })[0];
if (resource) {
@@ -103,7 +103,12 @@ Dashboard.prototype.route = function(ctx) {
render(ctx, options);
}
resourceType = resource.constructor;
debug("Editing resource %s of type %s", resourceId, resourceType.name);
if (resourceType.dashboard) {
if (resourceType.dashboard.pages) {