tried to reply on this topic, but somehow it seems i made a new topic. can you approve my thread and merge? edit: found it in javascript.back()…
[quote=matt]
Thanks for the report! fixed in: IE8 has no console · matomo-org/matomo@af7d42a · GitHub
can you please apply this patch, then delete all files in: piwik/tmp/assets/*
and try refresh. If the error still appear (or another one) under IE8 please let me know (we don’t run windows only linux and macos so we don’t test with IE8 too often)[/quote]
thanks for the quick support. in my case it was in these files:
$grep -r "Plugin file loaded" /var/www/piwik/
/var/www/piwik/plugins/ExamplePluginTemplate/javascripts/plugin.js: //console.log('Plugin file loaded');
/var/www/piwik/plugins/CoreConsole/templates/plugin/javascripts/plugin.js: //console.log('Plugin file loaded');
/var/www/piwik/plugins/ExamplePlugin/javascripts/plugin.js: //console.log('Plugin file loaded');
i checked out the current master and there it is only in one, so seems fixed.
but still not working in IE8. I managed to find the problem: it is based by jqPlots use of array.reduce() which is not supported by IE8. see MSDN[/url] and/or [url=http://stackoverflow.com/questions/7094935/ie-js-reduce-on-an-object]StackOverflow
# grep -r "series.reduce(" /var/www/piwik/
/var/www/piwik/tmp/assets/asset_manager_global_js.js:var self=this;setTimeout(function(){self.render();},1);},_setJqplotParameters:function(params){defaultParams={grid:{drawGridLines:false,borderWidth:0,shadow:false},title:{show:false},axesDefaults:{pad:1.0,tickRenderer:$.jqplot.CanvasAxisTickRenderer,tickOptions:{showMark:false,fontSize:'11px',fontFamily:window.piwik.jqplotLabelFont||'Arial'},rendererOptions:{drawBaseline:false}},axes:{yaxis:{tickOptions:{formatString:'%d'}}}};this.jqplotParams=$.extend(true,{},defaultParams,params);this._setColors();},_setTooltipPercentages:function(){this.tooltip={percentages:[]};for(var seriesIdx=0;seriesIdx!=this.data.length;++seriesIdx){var series=this.data[seriesIdx];var sum=series.reduce(function(previousValue,currentValue){if($.isArray(currentValue)&¤tValue[1]){return previousValue+currentValue[1];}
/var/www/piwik/plugins/CoreVisualizations/javascripts/jqplot.js: var sum = series.reduce(function (previousValue, currentValue) {
i tried the solution from Mozilla and just pasted the function in top of /var/www/piwik/plugins/CoreVisualizations/javascripts/jqplot.js
if ('function' !== typeof Array.prototype.reduce) {
Array.prototype.reduce = function(callback, opt_initialValue){
'use strict';
if (null === this || 'undefined' === typeof this) {
// At the moment all modern browsers, that support strict mode, have
// native implementation of Array.prototype.reduce. For instance, IE8
// does not support strict mode, so this check is actually useless.
throw new TypeError(
'Array.prototype.reduce called on null or undefined');
}
if ('function' !== typeof callback) {
throw new TypeError(callback + ' is not a function');
}
var index, value,
length = this.length >>> 0,
isValueSet = false;
if (1 < arguments.length) {
value = opt_initialValue;
isValueSet = true;
}
for (index = 0; length > index; ++index) {
if (this.hasOwnProperty(index)) {
if (isValueSet) {
value = callback(value, this[index], index, this);
}
else {
value = this[index];
isValueSet = true;
}
}
}
if (!isValueSet) {
throw new TypeError('Reduce of empty array with no initial value');
}
return value;
};
}
IE8 is still common in some huge companies, just like my customer that pays my coffee