From: erickson Date: Wed, 15 Sep 2010 17:02:16 +0000 (+0000) Subject: when IDL class is not defined, load it inline instead of throwing exceptions. *tips... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=932793f29af411c8f7535176637b467081ff9355;p=evergreen%2Fbjwebb.git when IDL class is not defined, load it inline instead of throwing exceptions. *tips hat to miker* git-svn-id: svn://svn.open-ils.org/ILS/trunk@17698 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index fd0d0edd4..801c824df 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -63,7 +63,7 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { this.fmIDL = fieldmapper.IDL.fmclasses[this.fmClass]; if(this.fmClass && !this.fmIDL) - throw new Error("IDL class '" + this.fmClass + "' not defined"); + fieldmapper.IDL.load([this.fmClass]); this.suppressLinkedFields = args.suppressLinkedFields || []; @@ -364,7 +364,7 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { 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"); + fieldmapper.IDL.load([this.fmClass]); if(!fieldmapper.IDL.fmclasses[linkClass].permacrud) return false; if(!fieldmapper.IDL.fmclasses[linkClass].permacrud.retrieve) return false; diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js index 66ac5de48..cb042062d 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js @@ -20,8 +20,8 @@ if(!dojo._hasResource['openils.widget.AutoWidget']) { if(this.fmObject) this.fmClass = this.fmObject.classname; this.fmIDL = fieldmapper.IDL.fmclasses[this.fmClass]; - if(this.fmClass && !this.fmIDL) - throw new Error("IDL class '" + this.fmClass + "' not defined"); + if(this.fmClass && !this.fmIDL) + fieldmapper.IDL.load([this.fmClass]); this.buildSortedFieldList(); },