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

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

Moderators: ooffick, General Support Moderators

Forum rules
Locked
User avatar
JTema
Joomla! Guru
Joomla! Guru
Posts: 733
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://asgardia.joomlatema.net - Asgardia Joomla Gardening Template

User avatar
JTema
Joomla! Guru
Joomla! Guru
Posts: 733
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://asgardia.joomlatema.net - Asgardia Joomla Gardening Template


Locked

Return to “Joomla! 3.x Coding”