sahana / eden

Sahana Eden is an Open Source Humanitarian Platform which can be used to provide solutions for Disaster Management, Development, and Environmental Management sectors.. Please sign CLA when submitting pull requests: http://bit.ly/SSF-eCLA
http://eden.sahanafoundation.org
Other
389 stars 558 forks source link

Sahana Chat Issues #1092

Closed tudorian closed 8 years ago

tudorian commented 9 years ago

Some times the following error appears when the chat windows is loaded TypeError: deps is undefined if (!deps.splice) {

file : converse.nojquery.js line 405 col 12

define = function (name, deps, callback) {

    //This module may not have dependencies
    if (!deps.splice) {
        //deps is not an array, so probably means
        //an object literal or factory function for
        //the value. Adjust args.
        callback = deps;
        deps = [];
    }

    if (!hasProp(defined, name) && !hasProp(waiting, name)) {
        waiting[name] = [name, deps, callback];
    }
};
flavour commented 9 years ago

This looks like an upstream issue...this file is vanilla upstream as far as I know. I would talk to the developrs of that project to get that resolved...and then please pass on the results to us here so that we update the file accordingly.

tudorian commented 9 years ago

ok great!

tudorian commented 9 years ago

i have a new version of converse.jquery.js. How can i generate the minified version of sahana chat?

flavour commented 9 years ago

Did you get this from upstream? General new version or specific fix for us?

1st test it using ?debug=1 If it works well then you can also compile & retest minified: http://eden.sahanafoundation.org/wiki/DeveloperGuidelines/Minify

or else send it to me for me to include/compile

tudorian commented 9 years ago

Yes from upstream. I tested it on my local deployment but without success. I think there is a javascript loadin problem because sometimes the chat works and sometimes it doesn't

graeme-f commented 9 years ago

You need to have the nojquery version because a conflict will occur when both converse and web2py try and load their version of jquery

On 10 June 2015 at 17:16, Tudor Bugnar notifications@github.com wrote:

Yes from upstream. I tested it on my local deployment but without success. I think there is a javascript loadin problem because sometimes the chat works and sometimes it doesn't

— Reply to this email directly or view it on GitHub https://github.com/flavour/eden/issues/1092#issuecomment-110769915.

tudorian commented 9 years ago

I still cannot figure out why the problem appears. Sometimes a value that is passed to converse is null and a method of converse tries to access a property of that null object

tudorian commented 9 years ago

The problem appears in converse.nojquery when fastclick.js call the define function from converse.nojquery

if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {

    // AMD. Register as an anonymous module.
    define(function() {
        return FastClick;
    });
} else if (typeof module !== 'undefined' && module.exports) {
    module.exports = FastClick.attach;
    module.exports.FastClick = FastClick;
} else {
    window.FastClick = FastClick;
}