Skip to content

Commit 96d29d0

Browse files
committed
Add migration guide for quotes
1 parent abd9dc5 commit 96d29d0

File tree

3 files changed

+84
-4
lines changed

3 files changed

+84
-4
lines changed

docs/migration/wsc61/deprecations_removals.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ With version 6.2, we have deprecated certain components and removed several othe
1515
- `wcf\data\user\avatar\UserAvatarAction` ([WoltLab/WCF#6051](https://github.com/WoltLab/WCF/pull/6051))
1616
- `wcf\data\user\avatar\UserAvatarEditor` ([WoltLab/WCF#6051](https://github.com/WoltLab/WCF/pull/6051))
1717
- `wcf\data\user\avatar\UserAvatarList` ([WoltLab/WCF#6051](https://github.com/WoltLab/WCF/pull/6051))
18-
- `wcf\data\user\avatar\UserAvatarList` ([WoltLab/WCF#6163](https://github.com/WoltLab/WCF/pull/6163))
19-
- `wcf\lib\system\message\quote\AbstractMessageQuoteHandler` ([WoltLab/WCF#6163](https://github.com/WoltLab/WCF/pull/6163/))
20-
- `wcf\lib\system\message\quote\IMessageQuoteHandler` ([WoltLab/WCF#6163](https://github.com/WoltLab/WCF/pull/6163/))
21-
- `wcf\lib\system\message\quote\QuotedMessage` ([WoltLab/WCF#6163](https://github.com/WoltLab/WCF/pull/6163/))
18+
- `wcf\data\user\avatar\UserAvatarList` ([WoltLab/WCF#6051](https://github.com/WoltLab/WCF/pull/6051))
19+
- `wcf\data\IMessageQuoteAction` ([WoltLab/WCF#6163](https://github.com/WoltLab/WCF/pull/6163/))
20+
- `wcf\system\message\quote\AbstractMessageQuoteHandler` ([WoltLab/WCF#6163](https://github.com/WoltLab/WCF/pull/6163/))
21+
- `wcf\system\message\quote\IMessageQuoteHandler` ([WoltLab/WCF#6163](https://github.com/WoltLab/WCF/pull/6163/))
22+
- `wcf\system\message\quote\QuotedMessage` ([WoltLab/WCF#6163](https://github.com/WoltLab/WCF/pull/6163/))
2223

2324
#### Methods
2425

docs/migration/wsc61/quotes.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Migrating from WoltLab Suite 6.1 – Quotes
2+
3+
In the upcoming version of WoltLab Suite, the handling of quotes has been revamped to enhance user experience.
4+
Quotes are now stored client-side in the browser's local storage, allowing synchronization across browser tabs.
5+
6+
## Using the New Quote System
7+
8+
The interfaces `wcf\data\IMessageQuoteAction` and `wcf\system\message\quote\IMessageQuoteHandler` are no longer required to generate the quotes, and the implemented classes or functions can be completely removed.
9+
10+
The object that can be quoted:
11+
12+
- **must** have implemented the interface `wcf\data\IMessage`.
13+
- should have implemented the interface `wcf\data\IEmbeddedMessageObject`.
14+
15+
Using of `WoltLabSuite/Core/Ui/Message/Quote` is no longer required and only `WoltLabSuite/Core/Component/Quote/Message::registerContainer()` should be used so that a message can be quoted
16+
17+
```smarty
18+
<!-- Previous -->
19+
<script data-relocate="true">
20+
$(function() {
21+
require(["WoltLabSuite/Core/Ui/Message/Quote"], ({ UiMessageQuote }) => {
22+
{include file='shared_messageQuoteManager' wysiwygSelector='text' supportPaste=true}
23+
24+
new UiMessageQuote($quoteManager, "wcf\\data\\foo\\Foo", "com.woltlab.foo", ".message", ".messageBody", ".messageBody > .messageText", true);
25+
});
26+
});
27+
</script>
28+
29+
<!-- Use instead -->
30+
<script data-relocate="true">
31+
require(["WoltLabSuite/Core/Component/Quote/Message"], ({ registerContainer }) => {
32+
registerContainer(".message", ".messageBody", "wcf\\data\\foo\\Foo", "com.woltlab.foo");
33+
});
34+
</script>
35+
```
36+
37+
## Adjustments to the forms
38+
39+
The functions `MessageQuoteManager::readFormParameters()` and `MessageQuoteManager::saved()` must be called both in the form for creating and editing the entry.
40+
This is necessary if the text input does support quotes. Regardless of whether the entry itself can be quoted later or not.
41+
42+
```PHP
43+
use wcf\system\message\quote\MessageQuoteManager;
44+
45+
class FooAddForm extends \wcf\form\MessageForm {
46+
47+
#[\Override]
48+
protected function readFormParameters()
49+
{
50+
parent::readFormParameters();
51+
52+
// …
53+
54+
// Read the quotes that are to be deleted after the message has been successfully saved
55+
MessageQuoteManager::getInstance()->readFormParameters();
56+
}
57+
58+
#[\Override]
59+
protected function saved()
60+
{
61+
parent::saved();
62+
63+
// …
64+
65+
// Save the used quotes so that they're deleted on the client with the next request
66+
MessageQuoteManager::getInstance()->saved();
67+
}
68+
}
69+
```
70+
71+
### Pre-filling of text
72+
73+
The automatic pre-filling of text when creating a new entry with previously marked quotes is no longer supported and has been removed in the new version.
74+
75+
### Changes to the FormBuilder
76+
77+
The functions `WysiwygFormContainer::quoteData()` and `WysiwygFormField::quoteData()` are no longer required, it is sufficient to use the function `supportQuotes()`.
78+
The functions `MessageQuoteManager::readFormParameters()` and `MessageQuoteManager::saved()` are called by `WysiwygFormField` and don't need to be called separately.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ nav:
130130
- 'From WoltLab Suite 6.1':
131131
- 'Deprecations and Removals': 'migration/wsc61/deprecations_removals.md'
132132
- 'Templates': 'migration/wsc61/templates.md'
133+
- 'Quotes': 'migration/wsc61/quotes.md'
133134
- 'From WoltLab Suite 6.0':
134135
- 'PHP API': 'migration/wsc60/php.md'
135136
- 'Templates': 'migration/wsc60/templates.md'

0 commit comments

Comments
 (0)