User tests: Successful: Unsuccessful:
When asset implements WebAssetAttachBehaviorInterface and added while onBeforeCompilehead event, then onAttachCallback was ignored.
The PR is fixing it.
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');
}
});Nothing happen
you get an empty page with "FooBar" text
Please select:
Reference:
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
I have tested this item ✅ successfully on 2d1475d
| Status | Pending | ⇒ | Ready to Commit |
RTC
| Labels |
Added:
RTC
bug
PR-5.1-dev
|
||
| 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 |
Thank you @Fedik and for testing @martin-zw @viocassel
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.