? ? Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
7 Oct 2020

Pull Request for Issue #30933 .

Summary of Changes

Remove typehint for addInline() method, as it in registerAsset().
To support both types WebAssetItemInterface and String

Testing Instructions

add to index.php of the template:

$wa->addInlineScript(new \Joomla\CMS\WebAsset\WebAssetItem('inline.blabla', null, ['content' => 'alert(1);']));
$wa->addInlineScript('alert(2);');

Actual result BEFORE applying this Pull Request

an error

Expected result AFTER applying this Pull Request

you get 2 alerts

Documentation Changes Required

none

avatar Fedik Fedik - open - 7 Oct 2020
avatar Fedik Fedik - change - 7 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Oct 2020
Category Libraries
avatar ceford ceford - test_item - 8 Oct 2020 - Tested successfully
avatar ceford
ceford - comment - 8 Oct 2020

I have tested this item successfully on 1bb3013

Without the patch I get this error: 0 Argument 2 passed to Joomla\CMS\WebAsset\WebAssetManager::addInline() must be of the type string, object given, called in /Users/ceford/Sites/j4b4/libraries/src/WebAsset/WebAssetManager.php on line 193

With the patch I get two alerts. So - OK.


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

avatar ChristineWk ChristineWk - test_item - 13 Oct 2020 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 13 Oct 2020

I have tested this item successfully on 1bb3013

Confirm Actual Result/error and Expected result as @ceford. But I had to remove both lines via FTP. Think OK.


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

avatar richard67 richard67 - change - 13 Oct 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 13 Oct 2020

RTC


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

avatar richard67 richard67 - change - 13 Oct 2020
Labels Added: ? ?
avatar richard67
richard67 - comment - 15 Oct 2020

@SharkyKZ Does this PR solve everything which you've mentioned in the description of your issue #30933 ?

... and has broken code for handling WebAssetItem ...
Also wrong type of exception is thrown ...

If not, please re-open the issue and adapt the description of it, or make a new one for the remaining points.

Thanks in advance.

avatar richard67 richard67 - change - 15 Oct 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-10-15 17:38:16
Closed_By richard67
Labels
avatar richard67 richard67 - close - 15 Oct 2020
avatar richard67 richard67 - merge - 15 Oct 2020
avatar richard67
richard67 - comment - 15 Oct 2020

Thanks!

Add a Comment

Login with GitHub to post a comment