Support

Admin Tools

#14006 Combining JS and CSS not working

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Wednesday, 05 December 2012 18:00 CST

user28055
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? No
Have I searched the tickets before posting? Yes
Have I read the documentation before posting (which pages?)? Yes
Joomla! version: 2.5.7
PHP version: 5.3.16
MySQL version: 5.1.49-3~bpo50+1-log
Host: (optional, but it helps us help you)
Admin Tools version: 2.4.1

Description of my issue:

Hi, I want to combine CSS and Javascript files with the delivery method "Plugin (slower, more secure)" in Admin Tools. If I enable both I can see with HttpFox that in addition to the js and css files (which should not be loaded but combined) another two files are loaded. One is /index.php?fetchcombinedfile=js-.. and the other one is /index.php?fetchcombinedfile=css-.. When I open them with a browser I can see that they are empty. This happens if gzip is disabled and also if it is enabled.

( I tried a plugin called jbetolo to combine, minify and compress css and js, which works fine.)

How can I fix this problem?

Thanks,
Andy

nicholas
Akeeba Staff
Manager
This means that Admin Tools experiences one of the following situations:
  • It is unable to extract the names of the Javascript files on your page. This can happen if the Admin Tools plugin is not the first plugin in the loading order or if another plugin manipulates the CSS/JS files loading in a way that makes it impossible for Admin Tools to locate them on the page.
  • You are using .php files for your CSS and Javascript instead of .js/.css. This happens when you have dynamically generated CSS and/or Javascript, or when you are using your template or a third party plugin to compress (GZip) those files. Admin Tools will never try to combine .php files containing CSS and Javascript for performance reasons.
  • Admin Tools cannot locate or read the source files. Since jBetolo worked I think this is not the case.
  • Admin Tools requires your cache directory to be writeable. If it's not then it cannot cache its combined CSS/JS files. In this case it will refrain from serving anything on your page for performance reasons.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user28055
Thanks for your fast reply!

- Admin Tools plugin is first in order
- Using joomla css/js + k2 css/js + jquery + bootstrap related css/js. And using joomla core gzip.
- jbetolo works.
- System Information says that Joomla Cache directory is writable

Do you have any other idea what the problem could be?

Thanks,
Andy

nicholas
Akeeba Staff
Manager
I would have to know the site's URL.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user28055
http://wp11045819.vwp1366.webpack.hosteurope.de/cf

btw: System Information says that configuration.php is unwriteable.

nicholas
Akeeba Staff
Manager
No idea. It looks like the template is injecting its JSS and CSS files using an onAfterRender event handler which runs after Admin Tools' one. If you switch to a different template, e.g. the built in Beez2 template, does the plugin works properly? If it does, the problem is this. The only way to fix that would be making Admin Tools the last plugin to load, but this would prevent its security features from working properly. In such a case it would be more preferable to not use the CSS and JS combination feature.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user28055
I switched to Beez2 and still no combining.
I have only following plugins enabled: Admin Tools, shlib, logout, debug, log, redirect, highlight, sef.

nicholas
Akeeba Staff
Manager
I have confirmed that it's the plugin load order. Since Amin Tools is the first plugin to run, it cannot catch all the output generated by other onAfterRender handlers. This is what also happens with the CSS and JS declarations generated by all of my components, the print CSS generated by Beez_20 and so on. I will try to find a workaround for the next version of Admin Tools.

BTW, jBetolo worked because of the same reason: it is the last plugin to load (as it was installed last), so it sees all the CSS declarations generated by all other components. My plan is to do a late binding of the onAfterRender, hopefully allowing Admin Tools to see the CSS/JS declarations generated by all other plugins and, possibly, the template itself.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user28055
Thanks for your help.

In my system plugins jbetolo is ordered right after admin tools. If I order jbetolo 1st and admin tools 2nd the behaviour does not change: jbetolo works and admin tools with the described problem.

I have tried following: disabled all 3rd party plugins (system + others) and only admin tools (1st) with beez2 template on joomla article. Files to combine: css+js from standard joomla, k2 and beez2.
-> still no combining.

Maybe that helps.
(cannot tell about onAfterRender handlers, because i am not into php/js)

PS: Please, remove my posted URL from public view for privacy reasons, thanks.

nicholas
Akeeba Staff
Manager
Sorry, but in my tests the results are completely different than yours. Try the latest dev release https://www.akeebabackup.com/component/ars/repository/admin-tools-professional.html If this doesn't fix the issue you have, I can't do anything else to help you.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

nicholas
Akeeba Staff
Manager
Please stop editing your ticket every two minutes.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user28055
I tried the new dev release. It brings a small change: /index.php?fetchcombinedfile=css-.. is not empty anymore, it loads:

/* COMBINED FILE: templates/beez_20/css/personal.css */
+ css data of personal.css

The file /index.php?fetchcombinedfile=js-.. is still empty and all the other css+js is loaded as normal.

Is jbetolo a secure enough plugin that one can use until you found a solution for admin tools?

nicholas
Akeeba Staff
Manager
I cannot vouch for the code quality of third party software. If I haven't written it or at the very least architected it and audited its code I cannot tell you "yes, it is secure". The only thing I can tell you is that you may use it at your own risk.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!