From 53dd5cffdaf90617d2d2080dfd0782fc6afbc816 Mon Sep 17 00:00:00 2001 From: DallonF Date: Wed, 15 Aug 2012 10:36:10 -0700 Subject: [PATCH] Fixed rare case where a resource's dashboard would not load --- lib/resources/dashboard.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/resources/dashboard.js b/lib/resources/dashboard.js index 4f8973c..78d03ea 100644 --- a/lib/resources/dashboard.js +++ b/lib/resources/dashboard.js @@ -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) {