Hi ES Team,

I am not very familiar with the ES product and thus this might not work and
you can ignore this fix.

AFAIU when adding a custom asset type on ES, the "RXT" file and ".json"
need to be mapped correctly.

Most of the time, novice users might not get mapped these two files
correctly and can cause this error when trying to log into the "publisher"
App.


> HTTP Status 500 - org.mozilla.javascript.WrappedException: Wrapped
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.EcmaError: TypeError: Cannot read property "meta"
> from null (/publisher/modules/ext/core/extension.core.js#320)
> (/publisher/controllers/assets_router.jag#83)


Before outputting """TypeError: Cannot read property "meta" from null"" may
be we can print in which "field/ field property" it fails.

Therefore, I propose we can add the following on the
(/publisher/modules/ext/core/extension.core.js#320).

function addPropertyToField(field, property) {

        *if(!field){*
*            log.error("Null field found when adding `"+property.name
<http://property.name>+"` to the `"+property.field+"`...!");*
*        }*

*        if(!property){*
*            log.error("Null FieldProperty found on "+field.name
<http://field.name>);*
*        }*

        if (!field.meta) {
            field.meta = {};
        }

        field.meta[property.name] = property.value;
    }

And this will output a more readable error before the TypeError. for
instance;

ERROR {JAGGERY.assets.default.assets:jag} -  Null field found when adding
> `hidden` to the `overview.createdtime`...!


WDYT?

-- 
With Regards,

*Rasika Perera*
Software Engineer
M: +94 71 680 9060 E: [email protected]
LinkedIn: http://lk.linkedin.com/in/rasika90

WSO2 Inc. www.wso2.com
lean.enterprise.middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to