diff --git a/migrations/44-50/new-features.md b/migrations/44-50/new-features.md index d63f3734..58183d27 100644 --- a/migrations/44-50/new-features.md +++ b/migrations/44-50/new-features.md @@ -37,6 +37,51 @@ public function onAfterDispatch(Joomla\CMS\Event\Application\AfterDispatchEvent } ``` +#### Content events have own classes + +Each content event now have own event class, PR: https://github.com/joomla/joomla-cms/pull/41226 + +#### User events + +Each user event now have own event class, PR: https://github.com/joomla/joomla-cms/pull/41317 + +The event `onUserAuthenticate` now is a real event, PR: https://github.com/joomla/joomla-cms/pull/41485 + +#### Finder events have own classes + +Each finder event now have own event class, PR: https://github.com/joomla/joomla-cms/pull/41320 + +#### Module events have own classes + +Each module event now have own event class, PR: https://github.com/joomla/joomla-cms/pull/41413 +`onAfterRenderModules` should now use `$event->getContent()` and `$event->updateContent($content)`, instead of modification by reference. The referencing still works but will be removed in the future. + +#### Installer events have own classes + +Each installer event now have own event class, PR: + - https://github.com/joomla/joomla-cms/pull/41322 + - https://github.com/joomla/joomla-cms/pull/41518 + +#### Privacy component events have own classes + +Each event of Privacy component now have own event class, PR: https://github.com/joomla/joomla-cms/pull/41486 + +#### Custom fields events have own classes + +Each Custom fields event now have own event class, PR: https://github.com/joomla/joomla-cms/pull/41495 + +#### Events for Actionlog, Cache, Contact, Checkin components have own classes + +Each event for Actionlog, Cache, Contact, Checkin components have own class, PR: https://github.com/joomla/joomla-cms/pull/41488 + +#### Menu events have own classes + +Each menu event now have own event class, PR: https://github.com/joomla/joomla-cms/pull/41498 + +#### com_ajax events have own classe + +com_ajax events event now have own event class, PR: https://github.com/joomla/joomla-cms/pull/41524 + #### New plugin events - System event `onAfterInitialiseDocument`, allows to access to Document instance at early stage of Document life, PR: https://github.com/joomla/joomla-cms/pull/40512 diff --git a/migrations/44-50/removed-backward-incompatibility.md b/migrations/44-50/removed-backward-incompatibility.md index fd948b8b..35396b0f 100644 --- a/migrations/44-50/removed-backward-incompatibility.md +++ b/migrations/44-50/removed-backward-incompatibility.md @@ -186,7 +186,89 @@ public function __construct(DispatcherInterface $dispatcher, array $config, more // Assign the extra arguments to internal variables } ``` - + +### Module event `onAfterRenderModules` backward compatibility + +- PR: https://github.com/joomla/joomla-cms/pull/41413 +- Description: `onAfterRenderModules` should now use `$event->getContent()` and `$event->updateContent($content)`, instead of modification by reference. The referencing still works but will be removed in the future. + +```php +// Old +function onAfterRenderModules(&$content, &$params){ + $content .= 'foobar'; +} + +// New +function onAfterRenderModules(Joomla\CMS\Event\Module\AfterRenderModulesEvent $event){ + $content = $event->getContent(); + $content .= 'foobar'; + + $event->updateContent($content); +} +``` + +### Custom Fields event `onCustomFieldsAfterPrepareField` backward compatibility + +- PR: https://github.com/joomla/joomla-cms/pull/41495 +- Description: `onCustomFieldsAfterPrepareField` should now use `$event->getValue()` and `$event->updateValue($value)`, instead of modification by reference. The referencing still works but will be removed in the future. + +```php +// Old +function onCustomFieldsAfterPrepareField($context, $item, $field, &$value){ + $value .= 'foobar'; +} + +// New +function onCustomFieldsAfterPrepareField(Joomla\CMS\Event\CustomFields\AfterPrepareFieldEvent $event){ + $value = $event->getValue(); + $value .= 'foobar'; + + $event->updateValue($value); +} +``` + +### Installer event `onInstallerBeforeInstallation`, `onInstallerBeforeInstaller`, `onInstallerAfterInstaller` backward compatibility + +- PR: https://github.com/joomla/joomla-cms/pull/41518 +- Description: `onInstallerBeforeInstallation`, `onInstallerBeforeInstaller` should now use `$event->getPackage()` and `$event->updatePackage($package)`, instead of modification by reference. The referencing still works but will be removed in the future. + +```php +// Old +function onInstallerBeforeInstaller($model, &$package){ + $package['foo'] = 'bar'; +} + +// New +function onInstallerBeforeInstaller(Joomla\CMS\Event\Installer\BeforeInstallerEvent $event){ + $package = $event->getPackage() ?: []; + $package['foo'] = 'bar'; + + $event->updatePackage($package); +} +``` + +Additionally `onInstallerAfterInstaller`, should use `$event->getInstallerResult()`, `$event->updateInstallerResult($result)`, and `$event->getMessage()`, `$event->updateMessage($message)`. + +### Installer event `onInstallerBeforePackageDownload` backward compatibility + +- PR: https://github.com/joomla/joomla-cms/pull/41518 +- Description: `onInstallerBeforePackageDownload` should now use `$event->getUrl()` and `$event->updateUrl($url)`, instead of modification by reference. The referencing still works but will be removed in the future. + +```php +// Old +function onInstallerBeforePackageDownload(&$url, &$headers){ + $url .= '&foo=bar'; +} + +// New +function onInstallerBeforePackageDownload(Joomla\CMS\Event\Installer\BeforePackageDownloadEvent $event){ + $url = $event->getUrl(); + $url .= '&foo=bar'; + + $event->updateUrl($url); +} +``` + ### Removed 3rd party libraries ## Joomla\Ldap