Skip to content

Commit ba66124

Browse files
committed
MAGETWO-59690: [Backport] - [GitHub] Inserted image in product description got broken on front end #6138 - for 2.1
1 parent 75a7b9b commit ba66124

File tree

3 files changed

+12
-1
lines changed
  • app/code/Magento/Catalog
    • Block/Adminhtml/Helper/Form/Wysiwyg
    • Ui/DataProvider/Product/Form/Modifier
  • lib/web/mage/adminhtml/wysiwyg/tiny_mce

3 files changed

+12
-1
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
use Magento\Backend\Block\Widget\Form;
1515
use Magento\Backend\Block\Widget\Form\Generic;
1616

17+
/**
18+
* Class Content
19+
*
20+
* @deprecated
21+
* @see \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav
22+
*/
1723
class Content extends Generic
1824
{
1925
/**

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,10 @@ private function customizeWysiwyg(ProductAttributeInterface $attribute, array $m
745745
$meta['arguments']['data']['config']['wysiwyg'] = true;
746746
$meta['arguments']['data']['config']['wysiwygConfigData'] = [
747747
'add_variables' => false,
748-
'add_widgets' => false
748+
'add_widgets' => false,
749+
'add_directives' => true,
750+
'use_container' => true,
751+
'container_class' => 'hor-scroll',
749752
];
750753

751754
return $meta;

lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js

+2
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ define([
343343
// escape special chars in directives url to use it in regular expression
344344
var url = this.makeDirectiveUrl('%directive%').replace(/([$^.?*!+:=()\[\]{}|\\])/g, '\\$1');
345345
var reg = new RegExp(url.replace('%directive%', '([a-zA-Z0-9,_-]+)'));
346+
content = decodeURIComponent(content);
347+
346348
return content.gsub(reg, function(match) {
347349
return Base64.mageDecode(match[1]);
348350
}.bind(this));

0 commit comments

Comments
 (0)