Skip to content

Commit 468bde9

Browse files
committed
PB-370: Introduce upgrade mechanism for Page Builder content
1 parent 175664b commit 468bde9

File tree

4 files changed

+16
-26
lines changed

4 files changed

+16
-26
lines changed

app/code/Magento/PageBuilder/Model/Dom/Document.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class Document implements DocumentInterface
2323
/**
2424
* @var ObjectManagerInterface
2525
*/
26-
private $objectManager;
26+
protected $objectManager;
2727

2828
/**
2929
* @var GtDomDocument
3030
*/
31-
private $document;
31+
protected $document;
3232

3333
/**
3434
* Document constructor.
@@ -41,7 +41,6 @@ public function __construct(
4141
) {
4242
$this->objectManager = $objectManager;
4343
$this->document = $this->objectManager->create(GtDomDocument::class, [ 'document' => $document ]);
44-
$this->document->createDocumentFragment();
4544
}
4645

4746
/**

app/code/Magento/PageBuilder/Model/Dom/HtmlDocument.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
use Gt\Dom\HTMLDocument as GtDomHTMLDocument;
1111
use Magento\Framework\ObjectManagerInterface;
12-
use Magento\PageBuilder\Model\Dom\Adapter\ElementInterface;
1312
use Magento\PageBuilder\Model\Dom\Adapter\HtmlCollectionInterface;
1413
use Magento\PageBuilder\Model\Dom\Adapter\HtmlDocumentInterface;
1514

@@ -18,16 +17,6 @@
1817
*/
1918
class HtmlDocument extends Document implements HtmlDocumentInterface
2019
{
21-
/**
22-
* @var ObjectManagerInterface
23-
*/
24-
private $objectManager;
25-
26-
/**
27-
* @var GtDomHTMLDocument
28-
*/
29-
private $document;
30-
3120
/**
3221
* HtmlDocument constructor.
3322
* @param ObjectManagerInterface $objectManager
@@ -37,7 +26,7 @@ public function __construct(
3726
ObjectManagerInterface $objectManager,
3827
string $document = ""
3928
) {
40-
$this->objectManager = $objectManager;
29+
parent::__construct($objectManager, $document);
4130
$this->document = $this->objectManager->create(GtDomHTMLDocument::class, [ 'document' => $document ]);
4231
}
4332

app/code/Magento/PageBuilder/Model/Dom/XmlDocument.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
*/
1717
class XmlDocument extends Document implements XmlDocumentInterface
1818
{
19-
/**
20-
* @var ObjectManagerInterface
21-
*/
22-
private $objectManager;
23-
24-
/**
25-
* @var GtDomXmlDocument
26-
*/
27-
private $document;
28-
2919
/**
3020
* XmlDocument constructor.
3121
*
@@ -36,7 +26,7 @@ public function __construct(
3626
ObjectManagerInterface $objectManager,
3727
string $document = ""
3828
) {
39-
$this->objectManager = $objectManager;
29+
parent::__construct($objectManager, $document);
4030
$this->document = $this->objectManager->create(GtDomXmlDocument::class, [ 'document' => $document ]);
4131
}
4232
}

app/code/Magento/PageBuilder/etc/di.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,18 @@
295295
<item name="content" xsi:type="boolean">true</item>
296296
</item>
297297
</item>
298+
<item name="catalog_category_entity_text" xsi:type="array">
299+
<item name="identifier" xsi:type="string">attribute_id</item>
300+
<item name="fields" xsi:type="array">
301+
<item name="value" xsi:type="boolean">true</item>
302+
</item>
303+
</item>
304+
<item name="catalog_product_entity_text" xsi:type="array">
305+
<item name="identifier" xsi:type="string">attribute_id</item>
306+
<item name="fields" xsi:type="array">
307+
<item name="value" xsi:type="boolean">true</item>
308+
</item>
309+
</item>
298310
</argument>
299311
</arguments>
300312
</type>

0 commit comments

Comments
 (0)