Skip to content

Commit

Permalink
Dokument migration to new box commands
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntimeX committed May 7, 2024
1 parent 8b3a387 commit 0bf1492
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/migration/wsc60/deprecations_removals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 22 additions & 0 deletions docs/migration/wsc60/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -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']
))();
```

0 comments on commit 0bf1492

Please sign in to comment.