You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/how-to/how-to-upgrade-content-types.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ To fix this limitation for versions 1.3+, Page Builder uses Magento's native upg
8
8
9
9
The Page Builder team recently had to change the configuration of the Row's full-width appearance to fix a layout issue. The fix was simple. We moved a style attribute from one element in the Row's full-width appearance to another element. But without the upgrade helpers, our change to the Row's configuration would have broken all previously saved Page Builder content with Rows. And because all Page Builder content starts with a Row, all Page Builder content would be broken!
10
10
11
-
To fix this issue, we used the Page Builder DOM helper classes (`Magento\PageBuilder\Model\Dom\*`) to create a converter and a data patcher for the native Row content type:
11
+
To fix this issue, we used the Page Builder DOM helper classes (`Magento\PageBuilder\Model\Dom\*`) to create a converter and a data patch for the native Row content type:
12
12
13
13
1.**Converter** (See `FixFullWidthRowPadding.php`)
14
-
2.**Patcher** (See `UpgradeFullWidthPadding.php`)
14
+
2.**Data Patch** (See `UpgradeFullWidthPadding.php`)
15
15
16
16

17
17
@@ -82,9 +82,9 @@ class FixFullWidthRowPadding implements DataConverterInterface
82
82
}
83
83
```
84
84
85
-
### Patcher class example
85
+
### Data patch class example
86
86
87
-
The patcher class implements the `DataPatchInterface`. Specifically, it uses the framework's `UpgradeContentHelper` class to apply the converter class to all the database entities where Page Builder content exists. These locations are provided by the `UpgradableEntitiesPool`, described later in this topic.
87
+
The data patch class implements the `DataPatchInterface`. Specifically, it uses the framework's `UpgradeContentHelper` class to apply the converter class to all the database entities where Page Builder content exists. These locations are provided by the `UpgradableEntitiesPool`, described later in this topic.
88
88
89
89
Page Builder's `UpgradeFullWidthPadding` class is provided here as an example implementation:
90
90
@@ -225,7 +225,7 @@ To use Page Builder's content upgrade helpers for your own content-type configur
225
225
226
226
1. Implement the `DataConverterInterface` to create a converter for your content type, using Page Builder's `FixFullWidthRowPadding` class as an example.
227
227
228
-
1. Implement the `DataPatchInterface` to create a patcher for your content type, using Page Builder's `UpgradeFullWidthPadding` class as an example.
228
+
1. Implement the `DataPatchInterface` to create a data patch for your content type, using Page Builder's `UpgradeFullWidthPadding` class as an example.
229
229
230
230
1. Make a copy of the data in the `content` fields of existing entities (`cms_page`, `cms_block`, and so on). You will compare this content with the content changes made after running your upgrade patch.
231
231
@@ -235,10 +235,10 @@ To use Page Builder's content upgrade helpers for your own content-type configur
235
235
236
236
1. Compare your post-upgraded content to the previous content.
237
237
238
-
If the conversion didn't convert your content as planned, remove your entry from the `patch_list` table, switch away from your test branch, and run `bin/magento setup:upgrade`to reset the database content and try again.
238
+
If the conversion didn't convert your content as planned, remove your entry from the `patch_list` table, restore your database content to the original values, tweak your converter, then run `bin/magento setup:upgrade`again. Repeat as necessary.
239
239
240
240
## How to upgrade overloaded Page Builder content types
241
241
242
-
If you have overloaded the configurations of native Page Builder content types, you need to review Page Builder's native configuration changes for each release. If necessary, you will need to create a converter and patcher to customize how the native content types are updated for your changes.
242
+
If you have overloaded the configurations of native Page Builder content types, you need to review Page Builder's native configuration changes for each release. If necessary, you will need to create a converter and data patch to customize how the native content types are updated for your changes.
243
243
244
244
For example, in version 1.3, we updated the configuration of the native Row content type. As mentioned, we moved the padding attribute of the `full-width` appearance from the `<main>` element to the `<inner>` element. So if your Row configuration is different in your custom content type (for example, you removed the `<inner>` element), then you will need to upgrade your overloaded Row as described in the previous steps.
0 commit comments