yii-debug-toolbar icon indicating copy to clipboard operation
yii-debug-toolbar copied to clipboard

Disable and hide yii-debug-toolbar when jQuery is not defined.

Open kachar opened this issue 11 years ago • 1 comments

Console error which halts the javascript on the whole page. Uncaught ReferenceError: jQuery is not defined.

Review on Reviewable

kachar avatar Jun 19 '13 09:06 kachar

Temporary quick solution is to exclude debug-toolbar scripts from script map For example if you exclude jquery.js from script map. You may also exclude these scripgs

this code is in Controller::init

$cs = Yii::app()->clientScript; $cs->scriptMap["jquery.js"] = false;

$cs->scriptMap['yii.debugtoolbar.js'] = false; $cs->scriptMap['yii.debugtoolbar.css'] = false;

but there is another problem that toolbar generate service info that contains in layout I solve this problem (in my case it is at module, but you also can do it at the same Controller::init) by disabling debug toolbar

/* @var CLogRouter $log */ $log = Yii::app()->log; foreach($log->routes as $logRoute) { if($logRoute instanceof YiiDebugToolbarRoute) { $logRoute->enabled = false; } }

Panoptik avatar Nov 08 '13 11:11 Panoptik