Skip to content

Commit 82a65f4

Browse files
authored
Merge pull request #354 from magento/magento-mpi-MC-29462
[Support] MC-29462: Uploaded Image in CMS block using PageBuilder does not show…
2 parents bb26b84 + 9d9350e commit 82a65f4

File tree

2 files changed

+51
-2
lines changed
  • app/code/Magento/PageBuilder/Model/Stage
  • dev/tests/integration/testsuite/Magento/PageBuilder/Model/Stage

2 files changed

+51
-2
lines changed

app/code/Magento/PageBuilder/Model/Stage/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\UrlInterface;
1212

1313
/**
14-
* Class Config
14+
* Provide config for page builder
1515
*
1616
* @api
1717
*/
@@ -134,7 +134,7 @@ public function getConfig()
134134
'menu_sections' => $this->getMenuSections(),
135135
'content_types' => $this->getContentTypes(),
136136
'stage_config' => $this->data,
137-
'media_url' => $this->urlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]),
137+
'media_url' => $this->frontendUrlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]),
138138
'preview_url' => $this->urlBuilder->getUrl('pagebuilder/stage/preview'),
139139
'render_url' => $this->urlBuilder->getUrl('pagebuilder/stage/render'),
140140
'column_grid_default' => $this->scopeConfig->getValue(self::XML_PATH_COLUMN_GRID_DEFAULT),
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\PageBuilder\Model\Stage;
10+
11+
use Magento\TestFramework\Helper\Bootstrap;
12+
use PHPUnit\Framework\TestCase;
13+
14+
/**
15+
* Test config for page builder
16+
*/
17+
class ConfigTest extends TestCase
18+
{
19+
/**
20+
* @var Config
21+
*/
22+
private $model;
23+
24+
/**
25+
* @inheritDoc
26+
*/
27+
protected function setUp()
28+
{
29+
$objectManager = Bootstrap::getObjectManager();
30+
$this->model = $objectManager->get(Config::class);
31+
}
32+
33+
/**
34+
* Test that "media_url" should be the same as storefront media URL
35+
*
36+
* @magentoConfigFixture admin/url/use_custom 1
37+
* @magentoConfigFixture admin/url/custom https://backend.magento.test/
38+
* @magentoConfigFixture admin_store web/secure/base_url https://backend.magento.test/
39+
* @magentoConfigFixture admin_store web/unsecure/base_url https://backend.magento.test/
40+
* @magentoConfigFixture admin/url/use_custom_path 1
41+
* @magentoConfigFixture admin/url/custom_path secret
42+
* @magentoAppIsolation enabled
43+
* @magentoAppArea adminhtml
44+
*/
45+
public function testMediaUrlShouldBeTheSameAsStorefrontMediaURL()
46+
{
47+
$this->assertEquals('http://localhost/pub/media/', $this->model->getConfig()['media_url']);
48+
}
49+
}

0 commit comments

Comments
 (0)