crisu83/yiistrap

Bad getAssetsUrl() in BS3 tree

Jeff86 opened this issue · 1 comments

Hi,

If you take a new yii project and put YiiStrap BS3 you'll have an error as your assets directory is empty. It will loop and create a tons of temp folders like this:

E:\xampp\htdocs\my_project\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets\599e005f\assets...

This comes from function getAssetsUrl() of TbApi.php. In BS3 code is:

protected function getAssetsUrl()
{
if (!isset($this->_assetsUrl)) {
if (($path = Yii::getPathOfAlias($this->assetsPath)) !== false) {
$this->assetsPath = $path;
}
$assetsUrl = Yii::app()->assetManager->publish($this->assetsPath, false, -1, $this->forceCopyAssets);
$this->_assetsUrl = $assetsUrl;
}
return $this->_assetsUrl;
}

In master tree it is:

protected function getAssetsUrl()
{
    if (isset($this->_assetsUrl)) {
        return $this->_assetsUrl;
    } else {
        $assetsPath = Yii::getPathOfAlias('bootstrap.assets');
        $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, $this->forceCopyAssets);
        return $this->_assetsUrl = $assetsUrl;
    }
}

The last one works perfectly and should replace the current BS3 one. Tested ok.

Kind regards,
Jeff.

Closing this for now. Please reopen if the issue still remains.