No Code Attached Yet
avatar jschmi102
jschmi102
20 Jan 2022

When progressive caching is enabled inline style settings of module is ommitted.
Module creates style definition via "addStyleDeclaration". Definition is successfully created - but only once! Then on all following pages style setting is gone (means "addStyleDeclaration" will not be executed anymore). This problem does not happen with Version 4.0.x

avatar jschmi102 jschmi102 - open - 20 Jan 2022
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Jan 2022
avatar zero-24
zero-24 - comment - 20 Jan 2022

Hmm when did this happen or changing and do you have an example extension to test with?

Please also show us the exact configuration options set compared to the default settings so we can reproduce and debug the issue.

avatar jschmi102
jschmi102 - comment - 20 Jan 2022

Hi,
Module issues: $document->addStyleDeclaration($stylesheet);
This results (correctly) in style definition:

<style type="text/css">
....
...style-settings from $stylesheet
....
</style> 

Setting Joomla's Global Configuration->"System ->System cache->ON Progressive caching" will cause problem.
First call will setup module layout on page correctly - subsequent calls (e.g. "reload page") will omit style setting and layout of module is incorrect as style definition is not available.
You may download/install package (contains plugin and module):
https://www.jschmidt-systemberatung.de/downloads/jsvisit_counter-v2.1.1.zip

avatar jschmi102
jschmi102 - comment - 20 Jan 2022

hi,
when checking my module's setting I found that "$document->addStyleSheet" does work correctly - only
$document->addStyleDeclaration seem to be affected and cause problem.

avatar jschmi102
jschmi102 - comment - 21 Jan 2022

this is interesting... if i change
$document->addStyleDeclaration($stylesheet);
into

$styletag = "\n<style>\n" . $stylesheet . "\n</style>";
$document->addCustomTag($styletag); 

which creates same html-code the problem disapears - seems that addStyleDeclaration interferes so with caching configs that a problem may be created.

avatar zero-24
zero-24 - comment - 23 Jan 2022

Hmm I'm not deep into our caching code but from my understanding progressive cache fully caches the module content that would include addStyleDeclaration and that there is a setting within modules to disable caches: Please take a look here for an example:
https://github.com/joomla-extensions/weblinks/blob/master/src/modules/mod_weblinks/mod_weblinks.xml#L191-L208

avatar jschmi102
jschmi102 - comment - 23 Jan 2022

hi,
I had done this check already - I think that there is a bug processing caching. Main indication is that progressive cache works perfectly with joomla 4 but does not with 3.10.5. My guess is that caching of html-header goes wrong, as "addStyleDeclaration" will modify/add inline style definitions to html-header.

avatar jschmi102 jschmi102 - change - 28 Jan 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-01-28 15:13:32
Closed_By jschmi102
avatar jschmi102 jschmi102 - close - 28 Jan 2022
avatar jschmi102
jschmi102 - comment - 28 Jan 2022

hi,
after have done a couple of tests on my sites I found that the problem disapears if I enable the page cache system plugin. As content now is retrieved from cached page entry all content is complete (nothing missing).
On the other hand I could not find out any reason for my problem.

avatar zero-24
zero-24 - comment - 28 Jan 2022

Thanks for checking back :)

Add a Comment

Login with GitHub to post a comment