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
Labels |
Added:
No Code Attached Yet
|
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
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.
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.
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
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.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-01-28 15:13:32 |
Closed_By | ⇒ | jschmi102 |
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.
Thanks for checking back :)
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.