added useful exception that is typical w/ autofieldwidget when an IDL class is not...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 15 Sep 2010 02:30:32 +0000 (02:30 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 15 Sep 2010 02:30:32 +0000 (02:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17667 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js

index d94fd41..84bdb76 100644 (file)
@@ -358,6 +358,8 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
         _getLinkSelector : function() {
             var linkClass = this.idlField['class'];
             if(this.idlField.reltype != 'has_a')  return false;
+            if(!fieldmapper.IDL.fmclasses[linkClass]) // class neglected by AutoIDL
+                throw new Error("IDL Class '" + linkClass + "' not defined");
             if(!fieldmapper.IDL.fmclasses[linkClass].permacrud) return false;
             if(!fieldmapper.IDL.fmclasses[linkClass].permacrud.retrieve) return false;