? ? Success

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
7 Jul 2018

Pull Request for Issue #20903 .

Summary of Changes

This patch fixes a Cache for ScriptOptions, and Language strings (JavaScript).

Testing Instructions

Need to test Component and Module caching
(I assume you have installed Joomla! with default testing content.)

Edit components/com_content/views/article/tmpl/default.php, add there:

JFactory::getDocument()->addScriptOptions('foo', array('bar' => 'beer ?'));
JText::script('JGLOBAL_AUTH_ACCESS_GRANTED');

JFactory::getDocument()
	->addScriptDeclaration('console.log(Joomla.getOptions("foo", "That a fail!"));console.log(Joomla.JText._("JGLOBAL_AUTH_ACCESS_GRANTED", "That a fail!"));');

Then edit mod_custom /modules/mod_custom/tmpl/default.php, add there:

JFactory::getDocument()->addScriptOptions('bar', array('foo' => 'panda ?'));
JText::script('JGLOBAL_AUTH_CANCEL');

JFactory::getDocument()
	->addScriptDeclaration('console.log(Joomla.getOptions("bar", "That a fail!"));console.log(Joomla.JText._("JGLOBAL_AUTH_CANCEL", "That a fail!"));');

Then enable Caching, and open a page with a Custom module view (in testing data it /custom url).
Open Browser developer console.
Clear Joomla cache!.

Back to opened page, and do 2 reload of the page (push F5, usually).
1 refresh will display the page without cache
2 refresh will display a cached page

Expected result

In browser console, after each refresh you should see a messages, like on this screen (order can be diferent):

screen 2018-07-07 09 51 07 190x90

Actual result

In browser console you can see these message only after first refresh, after second (and further page reload) you will see message That a fail!

Documentation Changes Required

no

avatar Fedik Fedik - open - 7 Jul 2018
avatar Fedik Fedik - change - 7 Jul 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Jul 2018
Category Libraries
avatar Fedik Fedik - change - 7 Jul 2018
The description was changed
avatar Fedik Fedik - edited - 7 Jul 2018
d069776 7 Jul 2018 avatar Fedik c.s
avatar Fedik Fedik - change - 7 Jul 2018
Labels Added: ?
avatar Quy
Quy - comment - 11 Jul 2018

Is issue #20546 related?

avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Jul 2018
Status Pending Information Required
avatar Fedik
Fedik - comment - 11 Jul 2018

@Quy yeap, that is the same issue

avatar franz-wohlkoenig franz-wohlkoenig - change - 17 Jul 2018
Status Information Required Discussion
avatar Ruud68 Ruud68 - test_item - 4 Nov 2019 - Tested successfully
avatar Ruud68
Ruud68 - comment - 4 Nov 2019

I have tested this item successfully on 341a5dc

also fixes this wrong behavior in (content) plugins using addScriptOptions #26975


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21007.

avatar Ruud68
Ruud68 - comment - 4 Nov 2019

I have tested this item successfully on 341a5dc

also fixes this wrong behavior in (content) plugins using addScriptOptions #26975


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21007.

avatar uglyeoin
uglyeoin - comment - 5 Nov 2019

Can I fetch this in Patch Tester or not?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21007.

avatar uglyeoin
uglyeoin - comment - 5 Nov 2019

Can I fetch this in Patch Tester or not?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21007.

avatar uglyeoin
uglyeoin - comment - 5 Nov 2019

Perhaps I have got this wrong, but when I test I get "that a fail" with or without the patch. Initially i do see the array foo, bar, but on second load I do not see it. Can you provide further instructions please?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21007.

avatar uglyeoin
uglyeoin - comment - 5 Nov 2019

Perhaps I have got this wrong, but when I test I get "that a fail" with or without the patch. Initially i do see the array foo, bar, but on second load I do not see it. Can you provide further instructions please?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21007.

avatar uglyeoin uglyeoin - test_item - 5 Nov 2019 - Tested successfully
avatar uglyeoin
uglyeoin - comment - 5 Nov 2019

I have tested this item successfully on 341a5dc

I have tested this and I see the results as expected.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21007.

avatar Quy Quy - change - 5 Nov 2019
Status Discussion Ready to Commit
avatar Quy
Quy - comment - 5 Nov 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21007.

avatar rdeutz rdeutz - change - 24 Nov 2019
Labels Added: ?
avatar HLeithner HLeithner - change - 5 Dec 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-12-05 22:42:21
Closed_By HLeithner
avatar HLeithner HLeithner - close - 5 Dec 2019
avatar HLeithner HLeithner - merge - 5 Dec 2019
avatar HLeithner
HLeithner - comment - 5 Dec 2019

It took some time but finally it's merged thanks for your work.

Add a Comment

Login with GitHub to post a comment