? Pending
Pull Request for # 27163

User tests: Successful: Unsuccessful:

avatar SharkyKZ
SharkyKZ
7 May 2020

Pull Request for Issue #27163.

Summary of Changes

Fixes inline assets in module with Progressive Caching enabled.

Testing Instructions

Add some inline scripts and styles to a module:

$app->getDocument()->addStyleDeclaration('* {background:white !important;');
$app->getDocument()->addStyleDeclaration('* {background:black !important;');
$app->getDocument()->addStyleDeclaration('* {color:white !important;}');
$app->getDocument()->addStyleDeclaration('* {color:white !important;}');
$app->getDocument()->addScriptDeclaration('alert(1);');
$app->getDocument()->addScriptDeclaration('alert(2);');
$app->getDocument()->addScriptDeclaration('alert(1);');
$app->getDocument()->addScriptDeclaration('alert(2);');

Enable Progressive Caching.
View some page twice to generate cache and to load cached data.

Expected result

No warnings.
The added styles/scripts are working correctly.
Duplicated scripts/styles do not appear in source code (e.g. script with alert(1); only appears once).

Actual result

Scripts/styles don't work and warnings are generated:

Warning: md5() expects parameter 1 to be string, array given in libraries\src\Document\Document.php on line 676
Warning: stristr() expects parameter 1 to be string, array given in libraries\src\Document\HtmlDocument.php on line 338

Documentation Changes Required

No.

avatar SharkyKZ SharkyKZ - open - 7 May 2020
avatar SharkyKZ SharkyKZ - change - 7 May 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 May 2020
Category Libraries
avatar SharkyKZ SharkyKZ - change - 7 May 2020
Rel_Number 27163
Relation Type Pull Request for
Labels Added: ?
avatar ceford ceford - test_item - 8 May 2020 - Tested successfully
avatar ceford
ceford - comment - 8 May 2020

I have tested this item successfully on b5b4392

I put the suggested styles and scripts into the Breadcrumbs module. Without the patch the changes worked once but disappeared on subsequent page loads. With the patch it worked as expected every time.


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

avatar wilsonge wilsonge - change - 9 May 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-05-09 10:30:49
Closed_By wilsonge
avatar wilsonge wilsonge - close - 9 May 2020
avatar wilsonge wilsonge - merge - 9 May 2020
avatar wilsonge
wilsonge - comment - 9 May 2020

Thanks!

Add a Comment

Login with GitHub to post a comment