Few days ago I started using new 2.1.1 and yesterday when I tried to use minify plugin (
http://modx.com/extras/package/minify) but it doesn’t worked.
Making some debug I’ve noticed that plugin worked fine but when it try to override $modx->documentOutput nothing in the output change
<?php
$minCSS = $modx->getOption('minify_css',null,'1');
$minJS = $modx->getOption('minify_js',null,'1');
$minAsync = $modx->getOption('minify_async',null,'1');
$base_path = MODX_CORE_PATH.'/components/minify/';
$f = $base_path.'functions.minify.php';
if (file_exists($f)) {include $f;} else {$modx->log(modX::LOG_LEVEL_ERROR,'Minify not found at: '.$f);}
$output = $modx->documentOutput;
if ($minCSS) {
$CSS = new Optimized('css',$output,$info);
$output = $CSS->getOutput();
}
if ($minJS) {
$JS = new Optimized('js',$output,$info);
$output = $JS->getOutput();
}
if ($minAsync) {
$Async = new Optimized('async',$output,$info);
$output = $Async->getOutput();
}
$modx->documentOutput = $output;
$modx->log(MODX_LOG_LEVEL_ERROR,$modx->documentOutput); //correct
To make it work I changed to
$modx->resource->_output = $output;
Is this a bug or a new features of this release?