Skip to content

Commit 42428d5

Browse files
committed
Merge pull request #636 from magento-webdev/bugs
[WebDev] Bugfixes
2 parents 26064de + a34dda4 commit 42428d5

File tree

10 files changed

+109
-15
lines changed

10 files changed

+109
-15
lines changed

.htaccess

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
# Insert filter on all content
102102
###SetOutputFilter DEFLATE
103103
# Insert filter on selected content types only
104-
#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
104+
#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json image/svg+xml
105105

106106
# Netscape 4.x has some problems...
107107
#BrowserMatch ^Mozilla/4 gzip-only-text/html
@@ -190,6 +190,7 @@
190190

191191
AddDefaultCharset Off
192192
#AddDefaultCharset UTF-8
193+
AddType 'text/html; charset=UTF-8' html
193194

194195
<IfModule mod_expires.c>
195196

@@ -285,3 +286,38 @@
285286
## http://developer.yahoo.com/performance/rules.html#etags
286287

287288
#FileETag none
289+
290+
# ######################################################################
291+
# # INTERNET EXPLORER #
292+
# ######################################################################
293+
294+
# ----------------------------------------------------------------------
295+
# | Document modes |
296+
# ----------------------------------------------------------------------
297+
298+
# Force Internet Explorer 8/9/10 to render pages in the highest mode
299+
# available in the various cases when it may not.
300+
#
301+
# https://hsivonen.fi/doctype/#ie8
302+
#
303+
# (!) Starting with Internet Explorer 11, document modes are deprecated.
304+
# If your business still relies on older web apps and services that were
305+
# designed for older versions of Internet Explorer, you might want to
306+
# consider enabling `Enterprise Mode` throughout your company.
307+
#
308+
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
309+
# http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx
310+
311+
<IfModule mod_headers.c>
312+
313+
Header set X-UA-Compatible "IE=edge"
314+
315+
# `mod_headers` cannot match based on the content-type, however,
316+
# the `X-UA-Compatible` response header should be send only for
317+
# HTML documents and not for the other resources.
318+
319+
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
320+
Header unset X-UA-Compatible
321+
</FilesMatch>
322+
323+
</IfModule>

.htaccess.sample

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
# Insert filter on all content
101101
###SetOutputFilter DEFLATE
102102
# Insert filter on selected content types only
103-
#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
103+
#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json image/svg+xml
104104

105105
# Netscape 4.x has some problems...
106106
#BrowserMatch ^Mozilla/4 gzip-only-text/html
@@ -189,6 +189,7 @@
189189

190190
AddDefaultCharset Off
191191
#AddDefaultCharset UTF-8
192+
AddType 'text/html; charset=UTF-8' html
192193

193194
<IfModule mod_expires.c>
194195

@@ -284,3 +285,38 @@
284285
## http://developer.yahoo.com/performance/rules.html#etags
285286

286287
#FileETag none
288+
289+
# ######################################################################
290+
# # INTERNET EXPLORER #
291+
# ######################################################################
292+
293+
# ----------------------------------------------------------------------
294+
# | Document modes |
295+
# ----------------------------------------------------------------------
296+
297+
# Force Internet Explorer 8/9/10 to render pages in the highest mode
298+
# available in the various cases when it may not.
299+
#
300+
# https://hsivonen.fi/doctype/#ie8
301+
#
302+
# (!) Starting with Internet Explorer 11, document modes are deprecated.
303+
# If your business still relies on older web apps and services that were
304+
# designed for older versions of Internet Explorer, you might want to
305+
# consider enabling `Enterprise Mode` throughout your company.
306+
#
307+
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
308+
# http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx
309+
310+
<IfModule mod_headers.c>
311+
312+
Header set X-UA-Compatible "IE=edge"
313+
314+
# `mod_headers` cannot match based on the content-type, however,
315+
# the `X-UA-Compatible` response header should be send only for
316+
# HTML documents and not for the other resources.
317+
318+
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
319+
Header unset X-UA-Compatible
320+
</FilesMatch>
321+
322+
</IfModule>

app/code/Magento/Reports/view/adminhtml/templates/grid.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ $numColumns = sizeof($block->getColumns());
4848
<span id="<?php /* @escapeNotVerified */ echo $block->getSuffixId('period_date_to_advice')?>"></span>
4949
</span>
5050

51-
<span class="field-row">
51+
<span class="field-row admin__control-filter">
5252
<label for="<?php /* @escapeNotVerified */ echo $block->getSuffixId('report_period')?>"
5353
class="admin__control-support-text">
5454
<span><?php /* @escapeNotVerified */ echo __('Show By') ?>:</span>
5555
</label>
56-
<select name="report_period" id="<?php /* @escapeNotVerified */ echo $block->getSuffixId('report_period')?>" class="select">
56+
<select name="report_period" id="<?php /* @escapeNotVerified */ echo $block->getSuffixId('report_period')?>" class="admin__control-select">
5757
<?php foreach ($block->getPeriods() as $_value => $_label): ?>
5858
<option value="<?php /* @escapeNotVerified */ echo $_value ?>" <?php if ($block->getFilter('report_period') == $_value): ?> selected<?php endif; ?>><?php /* @escapeNotVerified */ echo $_label ?></option>
5959
<?php endforeach; ?>

app/code/Magento/Sales/view/adminhtml/templates/order/create/sidebar/items.phtml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,15 @@
7272
<?php if ($block->canRemoveItems()): ?>
7373
<td class="col-remove">
7474
<div class="admin__field-option">
75-
<input type="checkbox"
75+
<input id="sidebar-remove-<?php /* @escapeNotVerified */ echo $block->getSidebarStorageAction() ?>-<?php /* @escapeNotVerified */ echo $block->getItemId($_item) ?>"
76+
type="checkbox"
7677
class="admin__control-checkbox"
7778
name="sidebar[remove][<?php /* @escapeNotVerified */ echo $block->getItemId($_item) ?>]"
7879
value="<?php /* @escapeNotVerified */ echo $block->getDataId() ?>"
7980
title="<?php echo $block->escapeHtml(__('Remove')); ?>" />
80-
<label class="admin__field-label"></label>
81+
<label class="admin__field-label"
82+
for="sidebar-remove-<?php /* @escapeNotVerified */ echo $block->getSidebarStorageAction() ?>-<?php /* @escapeNotVerified */ echo $block->getItemId($_item) ?>">
83+
</label>
8184
</div>
8285
</td>
8386
<?php endif; ?>
@@ -99,12 +102,15 @@
99102
<span><?php /* @escapeNotVerified */ echo __('Configure and Add to Order') ?></span>
100103
</a>
101104
<?php else: ?>
102-
<input type="checkbox"
105+
<input id="sidebar-<?php /* @escapeNotVerified */ echo $block->getSidebarStorageAction() ?>-<?php /* @escapeNotVerified */ echo $block->getIdentifierId($_item) ?>"
106+
type="checkbox"
103107
class="admin__control-checkbox"
104108
name="sidebar[<?php /* @escapeNotVerified */ echo $block->getSidebarStorageAction() ?>][<?php /* @escapeNotVerified */ echo $block->getIdentifierId($_item) ?>]"
105109
value="<?php /* @escapeNotVerified */ echo $block->canDisplayItemQty() ? $_item->getQty()*1 : 1 ?>"
106110
title="<?php echo $block->escapeHtml(__('Add To Order')); ?>"/>
107-
<label class="admin__field-label"></label>
111+
<label class="admin__field-label"
112+
for="sidebar-<?php /* @escapeNotVerified */ echo $block->getSidebarStorageAction() ?>-<?php /* @escapeNotVerified */ echo $block->getIdentifierId($_item) ?>">
113+
</label>
108114
<?php endif; ?>
109115
</div>
110116
</td>

app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
-->
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<head>
10-
<meta name="x_ua_compatible" content="IE=edge,chrome=1"/>
1110
<meta name="viewport" content="width=device-width, initial-scale=1"/>
1211
<css src="mage/calendar.css"/>
1312
<script src="requirejs/require.js"/>

app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/data-grid/data-grid-header/_data-grid-filters.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173

174174
.admin__action-grid-select {
175175
.admin__control-select {
176-
margin: .5rem .5rem 0 0;
176+
margin: -.5rem .5rem 0 0;
177177
padding-bottom: .6rem;
178178
padding-top: .6rem;
179179
}

app/design/adminhtml/Magento/backend/web/css/source/forms/_temp.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,12 @@ label.mage-error {
495495
float: left;
496496
}
497497

498+
.admin__control-filter {
499+
.admin__control-select {
500+
margin-right: @action__outer-indent;
501+
}
502+
}
503+
498504
.admin__data-grid-export {
499505
float: right;
500506

lib/internal/Magento/Framework/View/Page/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public function setContentType($contentType)
245245
public function getContentType()
246246
{
247247
$this->build();
248-
if (empty($this->metadata['content_type'])) {
248+
if (strtolower($this->metadata['content_type']) === 'auto') {
249249
$this->metadata['content_type'] = $this->getMediaType() . '; charset=' . $this->getCharset();
250250
}
251251
return $this->metadata['content_type'];

lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,15 @@ public function testContentType()
148148
}
149149

150150
public function testContentTypeEmpty()
151+
{
152+
$expectedData = null;
153+
$this->assertEquals($expectedData, $this->model->getContentType());
154+
}
155+
156+
public function testContentTypeAuto()
151157
{
152158
$expectedData = 'default_media_type; charset=default_charset';
159+
$this->model->setContentType('auto');
153160
$this->scopeConfig->expects($this->at(0))->method('getValue')->with('design/head/default_media_type', 'store')
154161
->will($this->returnValue('default_media_type'));
155162
$this->scopeConfig->expects($this->at(1))->method('getValue')->with('design/head/default_charset', 'store')

nginx.conf.sample

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ root $MAGE_ROOT/pub;
2525

2626
index index.php;
2727
autoindex off;
28-
charset off;
28+
charset UTF-8;
29+
#add_header "X-UA-Compatible" "IE=Edge";
2930

3031
location ~* ^/setup($|/) {
3132
root $MAGE_ROOT;
@@ -83,12 +84,12 @@ location /static/ {
8384
if ($MAGE_MODE = "production") {
8485
expires max;
8586
}
86-
87+
8788
# Remove signature of the static files that is used to overcome the browser cache
8889
location ~ ^/static/version {
8990
rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
9091
}
91-
92+
9293
location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
9394
add_header Cache-Control "public";
9495
add_header X-Frame-Options "SAMEORIGIN";
@@ -168,6 +169,7 @@ gzip_disable "msie6";
168169

169170
gzip_comp_level 6;
170171
gzip_min_length 1100;
172+
gzip_buffers 16 8k;
171173
gzip_proxied any;
172174
gzip_types
173175
text/plain
@@ -179,7 +181,9 @@ gzip_types
179181
application/x-javascript
180182
application/json
181183
application/xml
182-
application/xml+rss;
184+
application/xml+rss
185+
image/svg+xml;
186+
gzip_vary on;
183187

184188
location ~ \.php$ {
185189
deny all;

0 commit comments

Comments
 (0)