Skip to content

Commit 1030500

Browse files
Merge pull request #273 from WoltLab/5.5-thread-subscriptions
Add migration guide for board and thread subscriptions
2 parents 97064f4 + 54deeaa commit 1030500

File tree

2 files changed

+103
-2
lines changed

2 files changed

+103
-2
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Migrating from WSC 5.4 - WoltLab Suite Forum
2+
3+
## Subscriptions
4+
5+
With WoltLab Suite Forum 5.5 we have introduced a new system for subscribing to threads and boards, which also offers the possibility to ignore threads and boards.
6+
[You can learn more about this feature in our blog](https://www.woltlab.com/article/260-new-features-in-woltlab-suite-5-5-revision-of-buttons-and-ignoring-threads/).
7+
The new system uses a separate mechanism to track the subscribed forums as well as the subscribed threads.
8+
The previously used object type `com.woltlab.wcf.user.objectWatch` is now discontinued, because the object watch system turned out to be too limited for the complex logic behind thread and forum subscriptions.
9+
10+
### Subscribe to Threads
11+
12+
Previously:
13+
14+
```php
15+
$action = new UserObjectWatchAction([], 'subscribe', [
16+
'data' => [
17+
'objectID' => $threadID,
18+
'objectType' => 'com.woltlab.wbb.thread',
19+
]
20+
]);
21+
$action->executeAction();
22+
```
23+
24+
Now:
25+
26+
```php
27+
ThreadStatusHandler::saveSubscriptionStatus(
28+
$threadID,
29+
ThreadStatusHandler::SUBSCRIPTION_MODE_WATCHING
30+
);
31+
```
32+
33+
### Filter Ignored Threads
34+
35+
To filter ignored threads from a given `ThreadList`, you can use the method `ThreadStatusHandler::addFilterForIgnoredThreads()` to append the filter for ignored threads.
36+
The `ViewableThreadList` filters out ignored threads by default.
37+
38+
Example:
39+
40+
```php
41+
$user = new User(123);
42+
$threadList = new ThreadList();
43+
ThreadStatusHandler::addFilterForIgnoredThreads(
44+
$threadList,
45+
// This parameter specifies the target user. Defaults to the current user if the parameter
46+
// is omitted or `null`.
47+
$user
48+
);
49+
$threadList->readObjects();
50+
```
51+
52+
### Filter Ignored Users
53+
54+
Avoid issuing notifications to users that have ignored the target thread by filtering those out.
55+
56+
```php
57+
$userIDs = [1, 2, 3];
58+
$users = ThreadStatusHandler::filterIgnoredUserIDs(
59+
$userIDs,
60+
$thread->threadID
61+
);
62+
```
63+
64+
### Subscribe to Boards
65+
66+
Previously:
67+
68+
```php
69+
$action = new UserObjectWatchAction([], 'subscribe', [
70+
'data' => [
71+
'objectID' => $boardID,
72+
'objectType' => 'com.woltlab.wbb.board',
73+
]
74+
]);
75+
$action->executeAction();
76+
```
77+
78+
Now:
79+
80+
```php
81+
BoardStatusHandler::saveSubscriptionStatus(
82+
$boardID,
83+
ThreadStatusHandler::SUBSCRIPTION_MODE_WATCHING
84+
);
85+
```
86+
87+
### Filter Ignored Boards
88+
89+
Similar to ignored threads you will also have to avoid issuing notifications for boards that a user has ignored.
90+
91+
```php
92+
$userIDs = [1, 2, 3];
93+
$users = BoardStatusHandler::filterIgnoredUserIDs(
94+
$userIDs,
95+
$board->boardID
96+
);
97+
```

docs/migration/wsc54/php.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ See [WoltLab/WCF#4398](https://github.com/WoltLab/WCF/pull/4398) for details.
272272

273273
### Search Form
274274

275-
After the overhaul of the search form, search providers are no longer bound to `SearchForm` and `SearchResultPage`.
275+
After the overhaul of the search form, search providers are no longer bound to `SearchForm` and `SearchResultPage`.
276276
The interface `ISearchObjectType` and the abstract implementation `AbstractSearchableObjectType` have been replaced by `ISearchProvider` and `AbstractSearchProvider`.
277277

278278
Please use [`ArticleSearch`](https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php) as a template for your own implementation
@@ -344,7 +344,7 @@ is deprecated and should be replaced with the new structure with an explicit `<i
344344
filepath="migration/wsc54/en_new.xml",
345345
) }}
346346

347-
Additionally, to now also support deleting phrases with this package installation plugin, support for a `<delete>` element has been added:
347+
Additionally, to now also support deleting phrases with this package installation plugin, support for a `<delete>` element has been added:
348348

349349
{jinja{ codebox(
350350
language="xml",
@@ -356,6 +356,10 @@ Note that when deleting phrases, the category does not have to be specified beca
356356

357357
!!! warning "Mixing the old structure and the new structure is not supported and will result in an error message during the import!"
358358

359+
## Board and Thread Subscriptions
360+
361+
See [here](form_subscriptions.md) for details.
362+
359363
## Miscellaneous Changes
360364

361365
### View Counters

0 commit comments

Comments
 (0)