Add Dynamic Css to module does not work with php 8 Topic is solved

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
User avatar
JTema
Joomla! Guru
Joomla! Guru
Posts: 682
Joined: Sun Apr 13, 2008 8:10 pm

Add Dynamic Css to module does not work with php 8

Post by JTema » Sat Jul 31, 2021 11:59 am

Hello it seems that adding Dynamic Css to a joomla 3.x module like below does not work with php 8.0.6. There is no problem with php 7.3.1 but with 8.0.6 it does not work. On page source you can see the css.php is loaded but has no effect on styling.Anyone else has the same observation? Thanks in advance.

Code: Select all

$document->addStyleSheet(JURI::root().'modules/mod_mymodule/css/mod_mymodule.css.php');
http://www.joomlatema.net - Joomla Extensions and Templates
https://andalusa.joomlatema.net - Andalusa Professional Responsive Joomla Template

User avatar
JTema
Joomla! Guru
Joomla! Guru
Posts: 682
Joined: Sun Apr 13, 2008 8:10 pm

Re: Add Dynamic Css to module does not work with php 8

Post by JTema » Sun Aug 01, 2021 12:01 pm

It is weird but just changing mod_mymodule.css.php header from

Code: Select all

header('content-type: text/css');
$module->id = $_GET['id'];
to

Code: Select all

header('content-type: text/css');
$moduleId = $_GET['id'];
resolved problem with php 8 which there was no problem with php 7.3.1
http://www.joomlatema.net - Joomla Extensions and Templates
https://andalusa.joomlatema.net - Andalusa Professional Responsive Joomla Template


Post Reply

Return to “Joomla! 3.x Coding”