RTC bug PR-5.1-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
16 Jan 2024

Summary of Changes

When asset implements WebAssetAttachBehaviorInterface and added while onBeforeCompilehead event, then onAttachCallback was ignored.
The PR is fixing it.

Testing Instructions

Add following code to onBeforeCompileHead of any plugin (example in to debug plugin):

$wa = \Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerAndUseScript(new class ('foobar') extends \Joomla\CMS\WebAsset\WebAssetItem implements \Joomla\CMS\WebAsset\WebAssetAttachBehaviorInterface
{
    public function onAttachCallback(\Joomla\CMS\Document\Document $doc){
        dd('FooBar');
    }
});

Actual result BEFORE applying this Pull Request

Nothing happen

Expected result AFTER applying this Pull Request

you get an empty page with "FooBar" text

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed

Reference:

https://manual.joomla.org/docs/next/general-concepts/web-asset-manager#advanced-custom-webassetitem-class

avatar Fedik Fedik - open - 16 Jan 2024
avatar Fedik Fedik - change - 16 Jan 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jan 2024
Category Libraries
avatar Fedik Fedik - change - 16 Jan 2024
The description was changed
avatar Fedik Fedik - edited - 16 Jan 2024
avatar Fedik Fedik - change - 16 Jan 2024
The description was changed
avatar Fedik Fedik - edited - 16 Jan 2024
avatar Fedik Fedik - change - 16 Jan 2024
The description was changed
avatar Fedik Fedik - edited - 16 Jan 2024
avatar Fedik Fedik - change - 16 Jan 2024
The description was changed
avatar Fedik Fedik - edited - 16 Jan 2024
avatar martin-zw martin-zw - test_item - 24 Jan 2024 - Tested successfully
avatar martin-zw
martin-zw - comment - 24 Jan 2024

I have tested this item ✅ successfully on 2d1475d


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

avatar viocassel viocassel - test_item - 26 Jan 2024 - Tested successfully
avatar viocassel
viocassel - comment - 26 Jan 2024

I have tested this item ✅ successfully on 2d1475d


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

avatar alikon alikon - change - 26 Jan 2024
Status Pending Ready to Commit
avatar alikon
alikon - comment - 26 Jan 2024

RTC


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

avatar Fedik Fedik - change - 29 Jan 2024
Labels Added: RTC bug PR-5.1-dev
avatar LadySolveig LadySolveig - change - 31 Jan 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-01-31 09:07:24
Closed_By LadySolveig
avatar LadySolveig LadySolveig - close - 31 Jan 2024
avatar LadySolveig LadySolveig - merge - 31 Jan 2024
avatar LadySolveig
LadySolveig - comment - 31 Jan 2024

Thank you @Fedik and for testing @martin-zw @viocassel

Add a Comment

Login with GitHub to post a comment