Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document migration to new box commands #433

Merged
merged 1 commit into from
May 8, 2024
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
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']
))();
```
Loading