in a content plugin onContentPrepare set scriptoptions via:
Both are set correctly on the page
now enable cache
what you will see now is that addScriptOptions is only displayed on first page visit (page generated) but on second page visit (page from cache) the options are not on the page.
addScriptDeclaration works both on first page view and on page view from cache.
$document->addScriptOptions should be stored in the cache
$document->addScriptOptions is NOT stored in the cache
Joomla 3.9.12
I ran into this issue after migrating my custom javascript variables in my plugin from addScriptDeclaration to addScriptOptions following this guide: https://docs.joomla.org/J3.x:Adding_JavaScript_and_CSS_to_the_page#Adding_the_Options_to_Your_JavaScript_Code
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-04 14:20:00 |
Closed_By | ⇒ | SharkyKZ |
Closed_By | SharkyKZ | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @SharkyKZ by The JTracker Application at issues.joomla.org/joomla-cms/26975
Please test PR #21007.