Skip to content

Commit 3c82f9b

Browse files
authored
Merge pull request #343 from magento-obsessive-owls/PB-290
[Owls] PB-290: Image Content Type Fails to Render in Admin Through Block/Dynamic Block
2 parents 19b0dc9 + 19a424c commit 3c82f9b

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

app/code/Magento/PageBuilder/Model/Filter/Template.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ public function filter(string $result) : string
9191
if (!empty($matches)) {
9292
$docHtml = $matches[1];
9393

94+
// restore any encoded directives
95+
$docHtml = preg_replace_callback(
96+
'/=\"(%7B%7B[^"]*%7D%7D)\"/m',
97+
function ($matches) {
98+
return urldecode($matches[0]);
99+
},
100+
$docHtml
101+
);
102+
94103
if (isset($uniqueNodeNameToDecodedOuterHtmlMap)) {
95104
foreach ($uniqueNodeNameToDecodedOuterHtmlMap as $uniqueNodeName => $decodedOuterHtml) {
96105
$docHtml = str_replace(

app/code/Magento/PageBuilder/Plugin/Filter/TemplatePlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class TemplatePlugin
1414
{
15-
const BACKGROUND_IMAGE_PATTERN = '/data-background-images/si';
15+
const BACKGROUND_IMAGE_PATTERN = '/data-background-images=\"{[^"]+}\"/si';
1616

1717
const HTML_CONTENT_TYPE_PATTERN = '/data-content-type="html"/si';
1818

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/products/mass-converter/carousel-widget-directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class WidgetDirective extends BaseWidgetDirective {
5858
} as { [key: string]: any; };
5959

6060
if (data.sort_order) {
61-
attributes.sort_order = data.sort_order
61+
attributes.sort_order = data.sort_order;
6262
}
6363

6464
if (typeof data[data.condition_option] === "string") {

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/products/mass-converter/widget-directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export default class WidgetDirective extends BaseWidgetDirective {
5454
condition_option: data.condition_option,
5555
condition_option_value: "",
5656
type_name: "Catalog Products List",
57-
conditions_encoded: this.encodeWysiwygCharacters(data.conditions_encoded || "")
57+
conditions_encoded: this.encodeWysiwygCharacters(data.conditions_encoded || ""),
5858
} as { [key: string]: any; };
5959

6060
if (data.sort_order) {
61-
attributes.sort_order = data.sort_order
61+
attributes.sort_order = data.sort_order;
6262
}
6363

6464
if (typeof data[data.condition_option] === "string") {

0 commit comments

Comments
 (0)