Skip to content

Commit 0967d4e

Browse files
committed
PB-371: Documentation for Page Builder content upgrade process
More updates from reviews
1 parent 2680eb4 commit 0967d4e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/how-to/how-to-upgrade-content-types.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ To fix this limitation for versions 1.3+, Page Builder uses Magento's native upg
88

99
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!
1010

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:
1212

1313
1. **Converter** (See `FixFullWidthRowPadding.php`)
14-
2. **Patcher** (See `UpgradeFullWidthPadding.php`)
14+
2. **Data Patch** (See `UpgradeFullWidthPadding.php`)
1515

1616
![Example converter and upgrader classes](../images/upgrade-framework-example-pb.png)
1717

@@ -82,9 +82,9 @@ class FixFullWidthRowPadding implements DataConverterInterface
8282
}
8383
```
8484

85-
### Patcher class example
85+
### Data patch class example
8686

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.
8888

8989
Page Builder's `UpgradeFullWidthPadding` class is provided here as an example implementation:
9090

@@ -225,7 +225,7 @@ To use Page Builder's content upgrade helpers for your own content-type configur
225225

226226
1. Implement the `DataConverterInterface` to create a converter for your content type, using Page Builder's `FixFullWidthRowPadding` class as an example.
227227

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.
229229

230230
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.
231231

@@ -235,10 +235,10 @@ To use Page Builder's content upgrade helpers for your own content-type configur
235235

236236
1. Compare your post-upgraded content to the previous content.
237237

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.
239239

240240
## How to upgrade overloaded Page Builder content types
241241

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.
243243

244244
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

Comments
 (0)