Page 1 of 1

Zimbra's code minification is breaking zimlet

Posted: Mon Nov 28, 2016 11:31 pm
by fostah
Platform: Zimbra 8.6

Problem: After installing an open source zimlet (ConverseJS: https://github.com/Zimbra-Community/com_zimbra_converse), I am getting unusual console errors. When running with ?dev=1, the zimlet works fine.

Console Error: Uncaught TypeError: ee is not a function(…)
Zimlets-nodev_all.js.zgz?language=en&country=US&cosId=e00428a1-0c00-11d9-836a-000d93afea2a:23709 Uncaught TypeError: Cannot read property 'initialize' of undefined(…)

I dug farther into the code minified by zimbra and noticed that ee was defined many times. Below you can see its specified as a function, and right after that its defined as an object.

Is there any way to configure the minification process or disable it for certain zimlets? Or has anyone else ran into this issue?

Any help is greatly appreciated.

Code: Select all

function ee(){
var v=d_(this._milliseconds)/1000,j=d_(this._days),p=d_(this._months),d,y,z;
d=e1(v/60),y=e1(d/60),v%=60,d%=60,z=e1(p/12),p%=12;
var m=z,q=p,x=j,w=y,g=d,k=v,b=this.asSeconds();
return b?(b<0?"-":"")+"P"+(m?m+"Y":"")+(q?q+"M":"")+(x?x+"D":"")+(w||g||k?"T":"")+(w?w+"H":"")+(g?g+"M":"")+(k?k+"S":""):"P0D"
}
var aa,t5=e9.momentProperties=[],e7=!1,aa={}
,e3,aa={}
,a3=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,t3=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,aa={}
,aa={}
,a2=/\d/,a0=/\d\d/,aa=/\d{3}/,a7=/\d{4}/,aa=/[+-]?\d{6}/,aa=/\d\d?/,ee=/\d{1,3}/,b_=/\d{1,4}/,aa=/[+-]?\d{1,6}/,ee=/\d+/,_U=/[+-]?\d+/,F_=/Z|[+-]\d\d:?\d\d/gi,t8=/[+-]?\d+(\.\d{1,3})?/,e_=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,oo={}
,ee={}
,O_=0,oo=1,aa=2,_b=3,_T=4,oo=5,oo=6;
ee("M",["MM",2],"Mo",function(){
return this.month()+1
}


FWIW: I tried clearing my browser cache and clearing the zimlet on the server with zmprov. Neither helped.

Re: Zimbra's code minification is breaking zimlet

Posted: Mon Nov 13, 2017 1:35 pm
by ozzi
Hi

Try to launch webmail with ?dev=1 and see if it works.
If it doesn't, its your code, if it does, its the minification.

Keep us posted