Closed philippwiddra closed 10 years ago
Yes you are right I have this fixed on master but not pushed yet. And not in npm for sure.
This part is for loading the custom views into the mainview - http://simov.github.io/express-admin-site/#customjson
but since you can completely omit the app
key which represents the custom view it get's undefined.
The really bad thing about this is not the bug but instead that the app don't have full test coverage yet.
I'm closing this to avoid conflicts with my fix and yes that type of things are really annoying ..
@philippwiddra this was the fix https://github.com/simov/express-admin/commit/bde27397b3a93fab14831a85a24e01978313bedf
I'm not sure if that is intended and the problem was on my side, but I had to fix this to get the admin starting.
If the
view.mainview
variable is not defined,!view.mainview
evaluates to true so the boolean expression continues to test with!view.mainview.show
, which of course throws an error because node can't call a value from undefined.You can easiely rewrite that as
(view.mainview && view.mainview.show)
, because in this caseview.mainview
evaluates to false if it's undefined, and so the second part is not even checked (because it's an AND).But as it appears also the
view
variable can be undefined, so I had to use(view && view.mainview && view.mainview.show)
.That way this boolean expression represents the exact opposite of the original one which made it easy to also just omit the
continue;
part.Here the original output with errorstack. The error appears after logging in, thats why the
/login
route logged normally.