Asset Manager publish() forceCopy & linkAssets conflict

Issue #198 new
created an issue


I found an issue with my Yii asset manager setup and yii-bootstrap. See for details.

Short version: In Bootstrap.php (line 328);

Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG)

If YII_DEBUG is true, forceCopy conflicts with linkAssets.

I'd propose to remove that setting and just configure it via config/main.php

Tested with 1.1.13-RC and Yii-Bootstrap 1.2.0

Comments (5)

  1. Maurizio Domba

    Just a note... the latest commit gives an option to developers to set $publishAssets, but the default value remains the same so it would still produce the same problem as reported on the yii issue

  2. Christoffer Niska repo owner

    I wasn't aware of this issue, we can change the default value to be something else than YII_DEBUG. Maurizio, is it generally bad pratice to use YII_DEBUG within custom extensions? I'm mainly wondering if it's alright to choose between normal and compressed version of scripts depending on YII_DEBUG?

  3. schmunk42 reporter

    is it generally bad pratice to use YII_DEBUG within custom extensions?

    I think it's not best practice ;) I once had access control bound to YII_DEBUG - thought it was OK in the first place, but then realized it's not clear for the user/developer, that this constant may change also the behavior of modules or extensions of his app.

    Just my 2cents.

    btw: In which "version" (994ac4671763) is this setting available, >2.0?

  4. Log in to comment