Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions migrations/44-50/new-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
84 changes: 83 additions & 1 deletion migrations/44-50/removed-backward-incompatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= '<strong>foobar</strong>';
}

// New
function onAfterRenderModules(Joomla\CMS\Event\Module\AfterRenderModulesEvent $event){
$content = $event->getContent();
$content .= '<strong>foobar</strong>';

$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 .= '<strong>foobar</strong>';
}

// New
function onCustomFieldsAfterPrepareField(Joomla\CMS\Event\CustomFields\AfterPrepareFieldEvent $event){
$value = $event->getValue();
$value .= '<strong>foobar</strong>';

$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
Expand Down