Skip to content

Commit a96aacc

Browse files
committed
DOC-3305: Fix various issues found across major versions.
1 parent a2f64da commit a96aacc

5 files changed

Lines changed: 61 additions & 78 deletions

File tree

modules/ROOT/pages/migration-from-4x-to-8x.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -264,21 +264,21 @@ The undocumented `editor.documentBaseUrl` property has been removed.
264264
console.log('documentBaseUrl', editor.documentBaseUrl);
265265
266266
// Use this instead
267-
console.log('documentBaseURI', editor.documentBaseURI.getURI());
267+
console.log('documentBaseURI', editor.editorManager.documentBaseURI.getURI());
268268
----
269269

270-
TIP: Use `editor.documentBaseURI.getURI()` for all base URL operations.
270+
TIP: Use `editor.editorManager.documentBaseURI.getURI()` for all base URL operations.
271271

272272
**Impact**: This change improves URL handling consistency by removing an undocumented API that was not aligned with the documented `documentBaseURI` property.
273273

274274
**Migration steps:**
275275

276-
To update all references of `documentBaseUrl` to the new API, replace any usage of `editor.documentBaseUrl` (or similar) with `editor.documentBaseURI.getURI()`. The property `documentBaseUrl` has been removed, and the correct way to access the document base URL is now through the `documentBaseURI` property, which is a URI object. You can then call `.getURI()` on it to get the string value of the URL.
276+
To update all references of `documentBaseUrl` to the new API, replace any usage of `editor.documentBaseUrl` (or similar) with `editor.editorManager.documentBaseURI.getURI()`. The property `documentBaseUrl` has been removed, and the correct way to access the document base URL is now through the `editorManager.documentBaseURI` property, which is a URI object. You can then call `.getURI()` on it to get the string value of the URL.
277277

278278
**Migration checklist:**
279279

280280
* [ ] Search your codebase for all instances of `editor.documentBaseUrl`.
281-
* [ ] Replace them with `tinymce.activeEditor.documentBaseURI.getURI()` (or `editor.documentBaseURI.getURI()` if you have an `editor` reference).
281+
* [ ] Replace them with `tinymce.activeEditor.editorManager.documentBaseURI.getURI()` (or `editor.editorManager.documentBaseURI.getURI()` if you have an `editor` reference).
282282

283283
===== skipFocus and skip_focus Consolidation (v8)
284284

@@ -293,17 +293,17 @@ The `skipFocus` and `skip_focus` options for the `ToggleToolbarDrawer` command h
293293
.Example:
294294
[source,js]
295295
----
296-
// Old TinyMCE 7 usage
297-
editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true });
298-
299-
// New TinyMCE 8 usage
296+
// Old approach (deprecated in TinyMCE 8)
300297
editor.execCommand('ToggleToolbarDrawer', false, { skipFocus: true });
298+
299+
// New approach (recommended)
300+
editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true });
301301
----
302302

303303
**Migration checklist:**
304304

305305
* [ ] Locate all instances of `ToggleToolbarDrawer` command usage
306-
* [ ] Replace `skip_focus` with `skipFocus` in command options
306+
* [ ] Replace `skipFocus` with `skip_focus` in command options
307307
* [ ] Update any custom plugins using this command
308308
* [ ] Test toolbar drawer behavior after changes
309309

modules/ROOT/pages/migration-from-5x-to-8x.adoc

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -225,28 +225,29 @@ editor.ui.registry.addAutocompleter('myautocompleter', {
225225

226226
==== table_responsive_width replaced by table_sizing_mode (v7)
227227

228+
The `table_responsive_width` option has been replaced by xref:table-options.adoc#table_sizing_mode[`table_sizing_mode`] in TinyMCE 7.0.
229+
228230
.Example:
229231
[source,js]
230232
----
231233
// Old TinyMCE 6 configuration
232-
editor.ui.registry.addAutocompleter('myautocompleter', {
233-
ch: '@',
234-
minChars: 2,
235-
fetch: function(pattern) {
236-
return Promise.resolve(['item1', 'item2']);
237-
}
234+
tinymce.init({
235+
selector: "textarea",
236+
table_responsive_width: true
238237
});
239238
240239
// New TinyMCE 7+ configuration
241-
editor.ui.registry.addAutocompleter('myautocompleter', {
242-
trigger: '@',
243-
minChars: 2,
244-
fetch: function(pattern) {
245-
return Promise.resolve(['item1', 'item2']);
246-
}
240+
tinymce.init({
241+
selector: "textarea",
242+
table_sizing_mode: "responsive"
247243
});
248244
----
249-
** `table_responsive_width` replaced by xref:table-options.adoc#table_sizing_mode[`table_sizing_mode`].
245+
246+
**Migration checklist:**
247+
248+
* [ ] Replace `table_responsive_width` with `table_sizing_mode` in your configuration
249+
* [ ] Update the option value to match the new API
250+
* [ ] Test table responsive behavior
250251

251252
* **Default Changes in TinyMCE 7.0**:
252253
** xref:content-filtering.adoc#sandbox-iframes[`sandbox iframes`]: Now defaults to `true` (adds sandbox attribute to iframes)
@@ -306,7 +307,7 @@ Refer to version-specific release notes for changes in toolbar button names and
306307
307308
* `editor.selection.setContent` → `editor.insertContent`
308309
* `editor.fire()` → `editor.dispatch()`
309-
* `editor.documentBaseUrl` → `editor.documentBaseURI.getURI()`
310+
* `editor.documentBaseUrl` → `editor.editorManager.documentBaseURI.getURI()`
310311
====
311312

312313
=== Licensing Changes (GPL v2+ and Commercial)
@@ -352,7 +353,7 @@ Several API methods have been deprecated or removed across versions 6-8. Key cha
352353
* **Deprecated in TinyMCE 8**:
353354
** `editor.selection.setContent` → Use xref:apis/tinymce.editor.adoc#insertContent[`editor.insertContent`] instead
354355
** `editor.fire()` → Use xref:apis/tinymce.editor.adoc#dispatch[`editor.dispatch()`] instead
355-
** `editor.documentBaseUrl` → Use `editor.documentBaseURI.getURI()` instead
356+
** `editor.documentBaseUrl` → Use `editor.editorManager.documentBaseURI.getURI()` instead
356357

357358
==== skipFocus and skip_focus Consolidation (v8)
358359

@@ -367,17 +368,17 @@ The `skipFocus` and `skip_focus` options for the `ToggleToolbarDrawer` command h
367368
.Example:
368369
[source,js]
369370
----
370-
// Old TinyMCE 7 usage
371-
editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true });
372-
373-
// New TinyMCE 8 usage
371+
// Old approach (deprecated in TinyMCE 8)
374372
editor.execCommand('ToggleToolbarDrawer', false, { skipFocus: true });
373+
374+
// New approach (recommended)
375+
editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true });
375376
----
376377

377378
**Migration checklist:**
378379

379380
* [ ] Locate all instances of `ToggleToolbarDrawer` command usage
380-
* [ ] Replace `skip_focus` with `skipFocus` in command options
381+
* [ ] Replace `skipFocus` with `skip_focus` in command options
381382
* [ ] Update any custom plugins using this command
382383
* [ ] Test toolbar drawer behavior after changes
383384

modules/ROOT/pages/migration-from-5x.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ license_key: "your-license-key"
196196

197197
. **Backup and Prepare**: Ensure comprehensive backups before upgrading.
198198
. **Update Core Initialization**:
199-
.. Update `theme`, `skin`, and to refect the new oxide theme and skin.
200-
... In {productname} 4, there were multiple themes available including 'modern', 'inlite', and 'mobile'. These themes were removed in {productname} 5 and combined into a single responsive theme called "Silver".
199+
.. Verify `theme` and `skin` settings. In {productname} 5, the Silver theme with Oxide skin was already standard, so no theme changes are required when migrating to v{release-version}.
201200
.. Update `forced_root_block: false` options to `forced_root_block: "p"`.
202201
.. Consolidate toolbars.
203202
.. Review new v{release-version} defaults for security settings.

modules/ROOT/pages/migration-from-6x-to-8x.adoc

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,22 @@ This guide provides a complete migration path from TinyMCE 6 to TinyMCE 8, cover
1313

1414
== Key Changes
1515

16-
=== UI Themes and Skins
17-
18-
The theme and skin system has been updated across versions 7 and 8:
19-
20-
* **Modern Theme**: Replaced by the `silver` theme with `oxide` skin
21-
* **Lightgray Theme**: Replaced by the `silver` theme with `oxide` skin
22-
* **Mobile Theme**: Replaced by the `silver` theme with `oxide` skin
23-
24-
**Migration Steps:**
25-
26-
1. Update theme configuration to use `silver` theme
27-
2. Update skin configuration to use `oxide` skin
28-
3. Test UI appearance and functionality
29-
30-
.Example:
31-
[source,js]
32-
----
33-
// Old TinyMCE 6 configuration
34-
tinymce.init({
35-
selector: "textarea",
36-
theme: "modern",
37-
skin: "lightgray"
38-
});
39-
40-
// New TinyMCE 7+ configuration
41-
tinymce.init({
42-
selector: "textarea",
43-
theme: "silver",
44-
skin: "oxide"
45-
});
46-
----
47-
4816
=== Plugin Ecosystem
4917

5018
The {productname} plugin ecosystem underwent changes starting in version 7.0, with several plugins being removed or reclassified.
5119

5220
* **Removed Plugins** (no longer available as of {productname} 7.0):
5321
** `template`: Removed in 7.0. Replaced by the premium xref:advanced-templates.adoc[Templates] plugin.
5422

55-
* **Now Premium Only**:
23+
* **Now Premium Only** (removed in 6.0, before this migration path):
5624
** `imagetools`: Removed in 6.0. Replaced by the premium xref:editimage.adoc[Enhanced Image Editing] feature, available via the `+editimage+` plugin introduced in TinyMCE 6.0.
5725
** `textcolor`: Removed in 6.0. Use the xref:user-formatting-options.adoc#text-color-options[premium Color Picker] functionality instead.
5826

27+
[NOTE]
28+
====
29+
If you're migrating from TinyMCE 6, these plugins (`imagetools` and `textcolor`) were already removed in version 6.0, so you won't need to migrate them. The sections below are included for reference only, in case you're upgrading from an older version or have legacy code.
30+
====
31+
5932
==== Plugin Migration Examples
6033

6134
* `template` (removed in v7):
@@ -223,15 +196,15 @@ The `editor.documentBaseUrl` property has been removed. Use `editor.editorManage
223196
const baseUrl = editor.documentBaseUrl;
224197
225198
// New approach
226-
const baseUrl = editor.documentBaseURI.getURI();
199+
const baseUrl = editor.editorManager.documentBaseURI.getURI();
227200
----
228201

229202
**Impact**: This change improves URL handling consistency by removing an undocumented API that was not aligned with the documented `documentBaseURI` property.
230203

231204
**Migration checklist:**
232205

233206
* [ ] Search your codebase for all instances of `editor.documentBaseUrl`.
234-
* [ ] Replace them with `tinymce.activeEditor.documentBaseURI.getURI()` (or `editor.documentBaseURI.getURI()` if you have an `editor` reference).
207+
* [ ] Replace them with `tinymce.activeEditor.editorManager.documentBaseURI.getURI()` (or `editor.editorManager.documentBaseURI.getURI()` if you have an `editor` reference).
235208

236209
==== skipFocus and skip_focus Consolidation
237210

@@ -246,23 +219,23 @@ The `skipFocus` and `skip_focus` options for the `ToggleToolbarDrawer` command w
246219
**Migration Steps:**
247220

248221
1. Locate all instances of `ToggleToolbarDrawer` command usage
249-
2. Replace `skip_focus` with `skipFocus` in command parameters
222+
2. Replace `skipFocus` with `skip_focus` in command parameters
250223
3. Test toolbar drawer behavior
251224

252225
.Example:
253226
[source,js]
254227
----
255-
// Old approach
256-
editor.execCommand('ToggleToolbarDrawer', false, { skip_focus: true });
257-
258-
// New approach
228+
// Old approach (deprecated in TinyMCE 8)
259229
editor.execCommand('ToggleToolbarDrawer', false, { skipFocus: true });
230+
231+
// New approach (recommended)
232+
editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true });
260233
----
261234

262235
**Migration checklist:**
263236

264237
* [ ] Locate all instances of `ToggleToolbarDrawer` command usage
265-
* [ ] Replace `skip_focus` with `skipFocus` in command options
238+
* [ ] Replace `skipFocus` with `skip_focus` in command options
266239
* [ ] Update any custom plugins using this command
267240
* [ ] Test toolbar drawer behavior after changes
268241

@@ -441,6 +414,11 @@ The `template` plugin was removed in TinyMCE 7.0. If you were using this plugin,
441414

442415
=== Image Tools Plugin Removal
443416

417+
[NOTE]
418+
====
419+
This section applies only if you're upgrading from TinyMCE 5 or earlier. The `imagetools` plugin was removed in TinyMCE 6.0, so if you're migrating from TinyMCE 6, this plugin was already unavailable.
420+
====
421+
444422
The `imagetools` plugin was removed in TinyMCE 6.0. If you were using this plugin, you need to migrate to the premium Enhanced Image Editing feature.
445423

446424
**Migration Steps:**
@@ -477,6 +455,11 @@ tinymce.init({
477455

478456
=== Text Color Plugin Removal
479457

458+
[NOTE]
459+
====
460+
This section applies only if you're upgrading from TinyMCE 5 or earlier. The `textcolor` plugin was removed in TinyMCE 6.0, so if you're migrating from TinyMCE 6, this plugin was already unavailable.
461+
====
462+
480463
The `textcolor` plugin was removed in TinyMCE 6.0. If you were using this plugin, you need to migrate to the xref:user-formatting-options.adoc#text-color-options[premium Color Picker] functionality.
481464

482465
**Migration checklist:**

modules/ROOT/pages/migration-from-7x.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true })
336336

337337

338338
* [ ] Locate all instances of `ToggleToolbarDrawer` command usage
339-
* [ ] Replace `skip_focus` with `skipFocus` in command options
339+
* [ ] Replace `skipFocus` with `skip_focus` in command options
340340
* [ ] Update any custom plugins using this command
341341
* [ ] Test toolbar drawer behavior after changes
342342

@@ -358,17 +358,17 @@ The undocumented `editor.documentBaseUrl` property has been removed.
358358
console.log('documentBaseUrl', editor.documentBaseUrl);
359359
360360
// Use this instead
361-
console.log('documentBaseURI', editor.documentBaseURI.getURI());
361+
console.log('documentBaseURI', editor.editorManager.documentBaseURI.getURI());
362362
----
363363

364-
TIP: Use `editor.documentBaseURI.getURI()` for all base URL operations.
364+
TIP: Use `editor.editorManager.documentBaseURI.getURI()` for all base URL operations.
365365

366366
**Impact**: This change improves URL handling consistency by removing an undocumented API that was not aligned with the documented `documentBaseURI` property.
367367

368368
**Migration steps:**
369369

370370

371-
To update all references of `documentBaseUrl` to the new API, replace any usage of `editor.documentBaseUrl` (or similar) with `editor.documentBaseURI.getURI()`. The property `documentBaseUrl` has been removed, and the correct way to access the document base URL is now through the `documentBaseURI` property, which is a URI object. You can then call `.getURI()` on it to get the string value of the URL.
371+
To update all references of `documentBaseUrl` to the new API, replace any usage of `editor.documentBaseUrl` (or similar) with `editor.editorManager.documentBaseURI.getURI()`. The property `documentBaseUrl` has been removed, and the correct way to access the document base URL is now through the `editorManager.documentBaseURI` property, which is a URI object. You can then call `.getURI()` on it to get the string value of the URL.
372372

373373
.For example, update this:
374374
[source, js]
@@ -380,7 +380,7 @@ to:
380380

381381
[source, js]
382382
----
383-
const baseUrl = tinymce.activeEditor.documentBaseURI.getURI();
383+
const baseUrl = tinymce.activeEditor.editorManager.documentBaseURI.getURI();
384384
----
385385

386386
This change is necessary because the undocumented `editor.documentBaseUrl` API has been removed to improve URL handling consistency. The new approach uses the documented `documentBaseURI` property, which provides a URI object with methods such as `getURI()` to retrieve the full URL string.
@@ -391,7 +391,7 @@ For more information see: link:https://www.tiny.cloud/docs/tinymce/latest/apis/t
391391

392392

393393
* [ ] Search your codebase for all instances of `editor.documentBaseUrl`.
394-
* [ ] Replace them with `tinymce.activeEditor.documentBaseURI.getURI()` (or `editor.documentBaseURI.getURI()` if you have an `editor` reference).
394+
* [ ] Replace them with `tinymce.activeEditor.editorManager.documentBaseURI.getURI()` (or `editor.editorManager.documentBaseURI.getURI()` if you have an `editor` reference).
395395

396396
'''
397397

0 commit comments

Comments
 (0)