We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27291
    • 5 Posts
    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?
      • 28215
      • 4,149 Posts
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 27291
        • 5 Posts
        thankyou very much! useful link!