Skip to content

Commit e373ea7

Browse files
author
Oleksii Korshenko
committed
Merge pull request #89 from magento-api/pull-request
[API] P1 Bugs
2 parents 151726a + 55421d9 commit e373ea7

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

app/code/Magento/Cms/view/adminhtml/templates/browser/content.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<div class="title"><?php /* @escapeNotVerified */ echo $block->getHeaderText() ?></div>
2121
</div>
2222
</div>
23+
<div id="error-message" data-action="show-error"></div>
2324
<div id="contents-uploader" class="contents-uploader"><?php echo $block->getChildHtml('wysiwyg_images.uploader') ?></div>
2425
<div id="contents"></div>
2526
</div>

app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,16 @@ require([
6969
},
7070
done: function (e, data) {
7171
var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar';
72+
var tempErrorMessage = document.createElement("div");
7273
$(progressSelector).css('width', '100%');
74+
$('[data-action="show-error"]').children(".message").remove();
7375
if (data.result && !data.result.hasOwnProperty('errorcode')) {
7476
$(progressSelector).removeClass('upload-progress').addClass('upload-success');
7577
} else {
78+
tempErrorMessage.className = "message message-warning warning";
79+
tempErrorMessage.innerHTML = data.result.error;
80+
81+
$('[data-action="show-error"]').append(tempErrorMessage);
7682
$(progressSelector).removeClass('upload-progress').addClass('upload-failure');
7783
}
7884
},

app/code/Magento/Webapi/Controller/Soap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)
134134
$this->_setResponseBody($responseBody);
135135
} else if ($this->_isWsdlListRequest()) {
136136
$servicesList = [];
137-
foreach (array_keys($this->_wsdlGenerator->getListOfServices()) as $serviceName) {
137+
foreach ($this->_wsdlGenerator->getListOfServices() as $serviceName) {
138138
$servicesList[$serviceName]['wsdl_endpoint'] = $this->_soapServer->getEndpointUri()
139139
. '?' . \Magento\Webapi\Model\Soap\Server::REQUEST_PARAM_WSDL . '&services=' . $serviceName;
140140
}

lib/internal/Magento/Framework/View/Template/Html/Minifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function minify($file)
131131
'#(?<!:|\\\\|\'|")//(?!\s*\<\!\[)(?!\s*]]\>)[^\n\r]*#',
132132
'',
133133
preg_replace(
134-
'#(?<!:)//[^\n\r]*(\s\?\>)#',
134+
'#(?<!:|\'|")//[^\n\r]*(\s\?\>)#',
135135
'$1',
136136
preg_replace(
137137
'#(?<!:)//[^\n\r]*(\<\?php)[^\n\r]*(\s\?\>)[^\n\r]*#',

lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ public function testMinify()
124124
<head>
125125
<title>Test title</title>
126126
</head>
127+
<link rel="stylesheet" href='https://www.example.com/2' type="text/css" />
128+
<link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/1" type="text/css" />
127129
<body>
128130
<a href="http://somelink.com/text.html">Text Link</a>
129131
<img src="test.png" alt="some text" />
@@ -149,14 +151,16 @@ public function testMinify()
149151
//]]>
150152
</script>
151153
<?php echo "http://some.link.com/" ?>
154+
<?php echo "//some.link.com/" ?>
155+
<?php echo '//some.link.com/' ?>
152156
<em>inline text</em>
153157
<a href="http://www.<?php echo 'hi' ?>"></a>
154158
</body>
155159
</html>
156160
TEXT;
157161

158162
$expectedContent = <<<TEXT
159-
<?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ ?> <?php ?> <html><head><title>Test title</title></head><body><a href="http://somelink.com/text.html">Text Link</a> <img src="test.png" alt="some text" /><?php echo \$block->someMethod(); ?> <div style="width: 800px" class="<?php echo \$block->getClass() ?>" /><script>
163+
<?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ ?> <?php ?> <html><head><title>Test title</title></head><link rel="stylesheet" href='https://www.example.com/2' type="text/css" /><link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/1" type="text/css" /><body><a href="http://somelink.com/text.html">Text Link</a> <img src="test.png" alt="some text" /><?php echo \$block->someMethod(); ?> <div style="width: 800px" class="<?php echo \$block->getClass() ?>" /><script>
160164
var i = 1;
161165
var j = 1;
162166
@@ -174,7 +178,7 @@ public function testMinify()
174178
}
175179
});
176180
//]]>
177-
</script><?php echo "http://some.link.com/" ?> <em>inline text</em> <a href="http://www.<?php echo 'hi' ?>"></a></body></html>
181+
</script><?php echo "http://some.link.com/" ?> <?php echo "//some.link.com/" ?> <?php echo '//some.link.com/' ?> <em>inline text</em> <a href="http://www.<?php echo 'hi' ?>"></a></body></html>
178182
TEXT;
179183

180184
$this->appDirectoryMock->expects($this->once())

0 commit comments

Comments
 (0)