caolan/kanso — Issue #320: Error on field validator
Author: osher
Created: 2011-12-01 21:29:55+00:00
State: open

I'm doing the get started tutorial, on node 0.6.2, ubuntu server and npm 1.0.11, google-chrome.

I came to the point I add field validators.

The field validators crush when the error is that the user does not have admin role (error is not connected to a field).

falls on the line

```

var errsBelowPath = function (errs, path) {
return _.filter(errs, function (e) {
for (var i = 0, len = path.length; i < len; ++i) {
if (path[i] !== e.field[i]) { //<--------------- this line, e.field is undefined
return false;
}
}
return true;
});
};

```

stack trace: (copied from chrome's console)

```

Uncaught TypeError: Cannot read property '0' of undefined
errsBelowPath
_.filter._.select
errsBelowPath
Form.renderFields
_.reduce._.foldl._.inject
Form.renderFields
Form.toHTML
exports.addtype kanso.js:572
exports.getDesignDoc kanso.js:4016
exports.addtype kanso.js:519
exports.runUpdate kanso.js:2526
exports.runUpdateBrowser kanso.js:2481
exports.handle.window.location kanso.js:2787
exports.createRequest kanso.js:2206
exports.newUUID kanso.js:3682
exports.createRequest kanso.js:2198
exports.handle kanso.js:2735
exports.init.window.onpopstate kanso.js:1992
exports.setURL kanso.js:2864
(anonymous function) kanso.js:1934
oa jquery-1.4.2.min.js:18
c.event.handle jquery-1.4.2.min.js:55
c.event.add.j.handle.o jquery-1.4.2.min.js:49

```