Dokument migration to new box commands
authorMarcel Werk <burntime@woltlab.com>
Tue, 7 May 2024 13:50:35 +0000 (15:50 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 7 May 2024 13:50:35 +0000 (15:50 +0200)
See https://github.com/WoltLab/WCF/pull/5906

docs/migration/wsc60/deprecations_removals.md
docs/migration/wsc60/php.md

index a3d8b3fc146b8bb2ac279d3375695f888a672527..c0756884423a3f427ebc43c631046e869d71d612 100644 (file)
@@ -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
 
index a0ab06584e274767a3d8e683f8efbfb67aa4780b..826814192b6fe5f4e68daacd1940b5dca1c7d41f 100644 (file)
@@ -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']
+))();
+```