DevGroup-ru / dotplant2

E-Commerce CMS - Yii Framework 2 (yii2, shop)
http://dotplant.ru/
Other
640 stars 253 forks source link

Fix JS error with enabled debug panel #373

Closed m0r1arty closed 4 years ago

m0r1arty commented 7 years ago

JS bug in @app/modules/image/widgets/ImageDropzone.php current code make JS part of page:

"previewsContainer":"#w7","url":["upload"],"paramName":"file"});
then
Dropzone.uploadFiles call XMLHttpRequest.open with url === ["upload"]

but in 'debug' extension:

   XMLHttpRequest.prototype.open = function (method, url, async, user, pass) {
        var self = this;
        /* prevent logging AJAX calls to static and inline files, like templates */
        if (url.substr(0, 1) === '/' && !url.match(new RegExp("{{ excluded_ajax_paths }}"))) {

raise Error "TypeError: url.substr is not a function"
Philosoft commented 7 years ago

fix seems ok to me. @m0r1arty how to reproduce this bug?