MinifyX Not Generating Minified Files

I’ve just upgraded to MinifyX 2 and I’m not getting the minified .css or .js files - most of the time. Sometimes they show up and then disappear but either way even if they appear to be there, they are not linked to. Modx 2.8.4 PHP 7.4. No errors and no debug info.

&cacheFolder=`assets/minifyx/`
&cacheUrl=`assets/minifyx/`
&cssFilename=`style`
&minifyCss=`1`
&cssPlaceholder=`MinifyX.css`
&debug=`1`
&cssTpl=`tplMinifyXcss`
&forceUpdate=`1`
&jsFilename=`scripts`
&jsPlaceholder=`MinifyX.javascript`
&jsTpl=`tplMinifyXjs`
&minifyJs=`1`
&registerCss=`placeholder`
&registerJs=`placeholder`
&cssSources=`
[[++assets_url]]components/f6/css/foundation.css,
[[++assets_url]]components/f6/css/app.css,
[[++assets_url]]components/f6/css/animate.css,
[[++assets_url]]components/tinyslider/tiny-slider.css
`
&jsSources=`
[[++assets_url]]components/f6/js/vendor/jquery.js,
[[++assets_url]]components/tinyslider/tiny-slider.js,
[[++assets_url]]components/f6/js/vendor/what-input.js,
[[++assets_url]]components/f6/js/vendor/foundation.js,
[[++assets_url]]components/f6/js/app.js
`
]]
[[!+MinifyX.css]]
[[!+MinifyX.javascript]]```

Does it work if you change this line in the code

to this?

$placeholder = !empty($this->getProperty($type . 'Placeholder')) ? $this->getProperty($type . 'Placeholder') : '';
1 Like

Yes it does! Thank you. I’m just a bit nervous that the minified css and js files might randomly disappear again. What did that fix please?

I think there is just a bug in the newest version that tries to read the values of the properties &cssPlaceholder and &jsPlaceholder from the wrong place.

But it’s probably a good idea if you open a new issue on github, so that the author of the extra can take a proper look at it.

Thank you - I will. I don’t think &minifyJs and &minifyCss work either - they seem to be ignored.

It’s probably the same problem in this line

Trying to read the value from $this->minifyx->getOption(...) instead of $this->getProperty(...).

$result = $this->minifyx->getAssetCollection($type, $files, $this->getProperty('minify' . ucfirst($type)));
1 Like

The minifyJs and minifyCss options have to be set by system settings, since they are used by the plugin too. I am not sure about the placeholder, but it can be the same reason. Please look into the docs too.

The documentation (Usage - MinifyX) lists all four properties (jsPlaceholder, cssPlaceholder, minifyJs, minifyCss) as properties that “can be used in the snippet call”. But all of them are ignored.

In the system settings section, jsPlaceholder are cssPlaceholder are not mentioned.


Is is theoretically possible to manually add new system settings (minifyx.cssPlaceholder and minifyx.jsPlaceholder) to define the placeholders, but in my opinion this is a bug.

I am currently on vacation and will check that, when I am back. And yes, it looks like a bug for the template options. The minify option is somehow a feature. Maybe it has to be solved/documented different.

The issues are solved with 2.0.1.

2 Likes