Fixes #8613: FragmentCache storing empty content causes problem with PageCache

This commit is contained in:
kidol
2015-05-31 15:31:07 +02:00
parent 816ebd1e17
commit 9b3a6989f5
2 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,7 @@ Yii Framework 2 Change Log
- Enh #8486: Added support to automatically set the `maxlength` attribute for `Html::activeTextArea()` and `Html::activePassword()` (klimov-paul)
- Enh #8566: Added support for 'only' and 'except' options for `yii\web\AssetManager::publish()` (klimov-paul)
- Enh #8574: Added `yii\console\controllers\MessageController` support .pot file creation (pgaultier)
- Enh #8613: `yii\widgets\FragmentCache` will not store empty content anymore which fixes some problems related to `yii\filters\PageCache` (kidol)
- Chg #6354: `ErrorHandler::logException()` will now log the whole exception object instead of only its string representation (cebe)
- Chg #8556: Extracted `yii\web\User::getAuthManager()` method (samdark)

View File

@ -104,6 +104,9 @@ class FragmentCache extends Widget
echo $content;
} elseif ($this->cache instanceof Cache) {
$content = ob_get_clean();
if ($content === false || $content === '') {
return;
}
array_pop($this->getView()->cacheStack);
if (is_array($this->dependency)) {
$this->dependency = Yii::createObject($this->dependency);