From 0bf149230d4388c86802edf83a704c8c7daa0788 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 7 May 2024 15:50:35 +0200 Subject: [PATCH] Dokument migration to new box commands See https://github.com/WoltLab/WCF/pull/5906 --- docs/migration/wsc60/deprecations_removals.md | 2 ++ docs/migration/wsc60/php.md | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/docs/migration/wsc60/deprecations_removals.md b/docs/migration/wsc60/deprecations_removals.md index a3d8b3fc..c0756884 100644 --- a/docs/migration/wsc60/deprecations_removals.md +++ b/docs/migration/wsc60/deprecations_removals.md @@ -16,6 +16,8 @@ With version 6.1, we have deprecated certain components and removed several othe - `wcf\system\session\SessionHandler::resetSessions()` ([WoltLab/WCF#3767](https://github.com/WoltLab/WCF/pull/3767)) - `wcf\system\comment\manager\ICommentManager::canModerate()` ([WoltLab/WCF#5852](https://github.com/WoltLab/WCF/pull/5852/)) +- `wcf\system\box\BoxHandler::createBoxCondition()` ([WoltLab/WCF#5906](https://github.com/WoltLab/WCF/pull/5906)) +- `wcf\system\box\BoxHandler::addBoxToPageAssignments()` ([WoltLab/WCF#5906](https://github.com/WoltLab/WCF/pull/5906)) ### JavaScript diff --git a/docs/migration/wsc60/php.md b/docs/migration/wsc60/php.md index a0ab0658..82681419 100644 --- a/docs/migration/wsc60/php.md +++ b/docs/migration/wsc60/php.md @@ -66,3 +66,25 @@ $event->setDescription( ); $event->setLink($object->getLink()); ``` + +## Box Configuration + +The Methods `wcf\system\box\BoxHandler::createBoxCondition()` and `wcf\system\box\BoxHandler::addBoxToPageAssignments()` were used for the configuration of boxes during package installation. These methods were deprecated with version 6.1, as they led to an initialization of the box handler and can therefore cause undesirable side effects. + +The new commands `wcf\system\box\command\CreateBoxCondition` and `wcf\system\box\command\CreateBoxToPageAssignments` can be used instead. + +Example: + +```php +(new \wcf\system\box\command\CreateBoxCondition( + 'boxIdentifier', + 'conditionDefinition', + 'conditionObjectType', + ['parameter' => 12345] +))(); + +(new \wcf\system\box\command\CreateBoxToPageAssignments( + 'boxIdentifier', + ['pageIdentifier'] +))(); +```