Skip to content

Commit 11cedb4

Browse files
ENGCOM-4712: Fix for Issue #7227: 'x_forwarded_for' value is always empty in Order object #21787
- Merge Pull Request #21787 from cmuench/magento2:x-forwarded-for-in-order - Merged commits: 1. 6ce9ee7 2. 056b526 3. c4e4cbd
2 parents 02dc377 + c4e4cbd commit 11cedb4

File tree

537 files changed

+17748
-5346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

537 files changed

+17748
-5346
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4136,7 +4136,7 @@ Tests:
41364136
* Moved Multishipping functionality to newly created module Multishipping
41374137
* Extracted Product duplication behavior from Product model to Product\Copier model
41384138
* Replaced event "catalog_model_product_duplicate" with composite Product\Copier model
4139-
* Replaced event "catalog_product_prepare_save" with controller product initialization helper that can be customozed via plugins
4139+
* Replaced event "catalog_product_prepare_save" with controller product initialization helper that can be customized via plugins
41404140
* Consolidated Authorize.Net functionality in single module Authorizenet
41414141
* Eliminated dependency of Sales module on Shipping and Usa modules
41424142
* Eliminated dependency of Shipping module on Customer module

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
77

88
## Magento System Requirements
9-
[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html).
9+
[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements.html).
1010

1111
## Install Magento
1212

@@ -45,7 +45,7 @@ Please review the [Code Contributions guide](https://devdocs.magento.com/guides/
4545

4646
## Reporting Security Issues
4747

48-
To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account [there](https://bugcrowd.com/magento) to submit and follow-up your issue. Learn more about reporting security issues [here](https://magento.com/security/reporting-magento-security-issue).
48+
To report security vulnerabilities or learn more about reporting security issues in Magento software or web sites visit the [Magento Bug Bounty Program](https://hackerone.com/magento) on hackerone. Please create a hackerone account [there](https://hackerone.com/magento) to submit and follow-up your issue.
4949

5050
Stay up-to-date on the latest security news and patches for Magento by signing up for [Security Alert Notifications](https://magento.com/security/sign-up).
5151

app/bootstrap.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
* Environment initialization
99
*/
1010
error_reporting(E_ALL);
11-
stream_wrapper_unregister('phar');
11+
if (in_array('phar', \stream_get_wrappers())) {
12+
stream_wrapper_unregister('phar');
13+
}
1214
#ini_set('display_errors', 1);
1315

1416
/* PHP version validation */
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="AdminMenuSystem">
12+
<data key="pageTitle">System</data>
13+
<data key="title">Notifications</data>
14+
<data key="dataUiId">magento-backend-system</data>
15+
</entity>
16+
<entity name="AdminMenuSystemOtherSettingsNotifications">
17+
<data key="pageTitle">Notifications</data>
18+
<data key="title">Notifications</data>
19+
<data key="dataUiId">magento-adminnotification-system-adminnotification</data>
20+
</entity>
21+
</entities>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminSystemNotificationNavigateMenuTest">
12+
<annotations>
13+
<features value="AdminNotification"/>
14+
<stories value="Menu Navigation"/>
15+
<title value="Admin system notification navigate menu test"/>
16+
<description value="Admin should be able to navigate to System > Notifications"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-14125"/>
19+
<group value="menu"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="logout" stepKey="logout"/>
27+
</after>
28+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSystemNotificationPage">
29+
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
30+
<argument name="submenuUiId" value="{{AdminMenuSystemOtherSettingsNotifications.dataUiId}}"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitle">
33+
<argument name="title" value="{{AdminMenuSystemOtherSettingsNotifications.pageTitle}}"/>
34+
</actionGroup>
35+
</test>
36+
</tests>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="AdminMenuReports">
12+
<data key="pageTitle">Reports</data>
13+
<data key="title">Reports</data>
14+
<data key="dataUiId">magento-reports-report</data>
15+
</entity>
16+
<entity name="AdminMenuReportsBusinessIntelligenceAdvancedReporting">
17+
<data key="pageTitle">AdvancedReporting</data>
18+
<data key="title">AdvancedReporting</data>
19+
<data key="dataUiId">magento-analytics-advanced-reporting</data>
20+
</entity>
21+
</entities>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminAdvancedReportingNavigateMenuTest">
12+
<annotations>
13+
<features value="Analytics"/>
14+
<stories value="Menu Navigation"/>
15+
<title value="Admin advanced reporting navigate menu test"/>
16+
<description value="Admin should be able to navigate through advanced reporting admin menu to BI reports page"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-14152"/>
19+
<group value="menu"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="logout" stepKey="logout"/>
27+
</after>
28+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateAdvancedReportingPage">
29+
<argument name="menuUiId" value="{{AdminMenuReports.dataUiId}}"/>
30+
<argument name="submenuUiId" value="{{AdminMenuReportsBusinessIntelligenceAdvancedReporting.dataUiId}}"/>
31+
</actionGroup>
32+
<switchToNextTab stepKey="switchToNewTab"/>
33+
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
34+
</test>
35+
</tests>

app/code/Magento/Backend/Block/Dashboard/Graph.php

Lines changed: 66 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Backend\Block\Dashboard;
79

810
/**
@@ -15,7 +17,7 @@ class Graph extends \Magento\Backend\Block\Dashboard\AbstractDashboard
1517
/**
1618
* Api URL
1719
*/
18-
const API_URL = 'http://chart.apis.google.com/chart';
20+
const API_URL = 'https://image-charts.com/chart';
1921

2022
/**
2123
* All series
@@ -76,6 +78,7 @@ class Graph extends \Magento\Backend\Block\Dashboard\AbstractDashboard
7678
/**
7779
* Google chart api data encoding
7880
*
81+
* @deprecated since the Google Image Charts API not accessible from March 14, 2019
7982
* @var string
8083
*/
8184
protected $_encoding = 'e';
@@ -187,11 +190,12 @@ public function getChartUrl($directUrl = true)
187190
{
188191
$params = [
189192
'cht' => 'lc',
190-
'chf' => 'bg,s,ffffff',
191-
'chco' => 'ef672f',
192193
'chls' => '7',
193-
'chxs' => '0,676056,15,0,l,676056|1,676056,15,0,l,676056',
194-
'chm' => 'h,f2ebde,0,0:1:.1,1,-1',
194+
'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0',
195+
'chm' => 'B,f4d4b2,0,0,0',
196+
'chco' => 'db4814',
197+
'chxs' => '0,0,11|1,0,11',
198+
'chma' => '15,15,15,15'
195199
];
196200

197201
$this->_allSeries = $this->getRowsData($this->_dataRows);
@@ -279,20 +283,11 @@ public function getChartUrl($directUrl = true)
279283
$this->_axisLabels['x'] = $dates;
280284
$this->_allSeries = $datas;
281285

282-
//Google encoding values
283-
if ($this->_encoding == "s") {
284-
// simple encoding
285-
$params['chd'] = "s:";
286-
$dataDelimiter = "";
287-
$dataSetdelimiter = ",";
288-
$dataMissing = "_";
289-
} else {
290-
// extended encoding
291-
$params['chd'] = "e:";
292-
$dataDelimiter = "";
293-
$dataSetdelimiter = ",";
294-
$dataMissing = "__";
295-
}
286+
// Image-Charts Awesome data format values
287+
$params['chd'] = "a:";
288+
$dataDelimiter = ",";
289+
$dataSetdelimiter = "|";
290+
$dataMissing = "_";
296291

297292
// process each string in the array, and find the max length
298293
$localmaxvalue = [0];
@@ -306,7 +301,6 @@ public function getChartUrl($directUrl = true)
306301
$minvalue = min($localminvalue);
307302

308303
// default values
309-
$yrange = 0;
310304
$yLabels = [];
311305
$miny = 0;
312306
$maxy = 0;
@@ -321,52 +315,21 @@ public function getChartUrl($directUrl = true)
321315
$maxy = ceil($maxvalue + 1);
322316
$yLabels = range($miny, $maxy, 1);
323317
}
324-
$yrange = $maxy;
325318
$yorigin = 0;
326319
}
327320

328321
$chartdata = [];
329322

330323
foreach ($this->getAllSeries() as $index => $serie) {
331324
$thisdataarray = $serie;
332-
if ($this->_encoding == "s") {
333-
// SIMPLE ENCODING
334-
for ($j = 0; $j < sizeof($thisdataarray); $j++) {
335-
$currentvalue = $thisdataarray[$j];
336-
if (is_numeric($currentvalue)) {
337-
$ylocation = round(
338-
(strlen($this->_simpleEncoding) - 1) * ($yorigin + $currentvalue) / $yrange
339-
);
340-
$chartdata[] = substr($this->_simpleEncoding, $ylocation, 1) . $dataDelimiter;
341-
} else {
342-
$chartdata[] = $dataMissing . $dataDelimiter;
343-
}
344-
}
345-
} else {
346-
// EXTENDED ENCODING
347-
for ($j = 0; $j < sizeof($thisdataarray); $j++) {
348-
$currentvalue = $thisdataarray[$j];
349-
if (is_numeric($currentvalue)) {
350-
if ($yrange) {
351-
$ylocation = 4095 * ($yorigin + $currentvalue) / $yrange;
352-
} else {
353-
$ylocation = 0;
354-
}
355-
$firstchar = floor($ylocation / 64);
356-
$secondchar = $ylocation % 64;
357-
$mappedchar = substr(
358-
$this->_extendedEncoding,
359-
$firstchar,
360-
1
361-
) . substr(
362-
$this->_extendedEncoding,
363-
$secondchar,
364-
1
365-
);
366-
$chartdata[] = $mappedchar . $dataDelimiter;
367-
} else {
368-
$chartdata[] = $dataMissing . $dataDelimiter;
369-
}
325+
$count = count($thisdataarray);
326+
for ($j = 0; $j < $count; $j++) {
327+
$currentvalue = $thisdataarray[$j];
328+
if (is_numeric($currentvalue)) {
329+
$ylocation = $yorigin + $currentvalue;
330+
$chartdata[] = $ylocation . $dataDelimiter;
331+
} else {
332+
$chartdata[] = $dataMissing . $dataDelimiter;
370333
}
371334
}
372335
$chartdata[] = $dataSetdelimiter;
@@ -381,45 +344,13 @@ public function getChartUrl($directUrl = true)
381344

382345
$valueBuffer = [];
383346

384-
if (sizeof($this->_axisLabels) > 0) {
347+
if (count($this->_axisLabels) > 0) {
385348
$params['chxt'] = implode(',', array_keys($this->_axisLabels));
386349
$indexid = 0;
387350
foreach ($this->_axisLabels as $idx => $labels) {
388351
if ($idx == 'x') {
389-
/**
390-
* Format date
391-
*/
392-
foreach ($this->_axisLabels[$idx] as $_index => $_label) {
393-
if ($_label != '') {
394-
$period = new \DateTime($_label, new \DateTimeZone($timezoneLocal));
395-
switch ($this->getDataHelper()->getParam('period')) {
396-
case '24h':
397-
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
398-
$period->setTime($period->format('H'), 0, 0),
399-
\IntlDateFormatter::NONE,
400-
\IntlDateFormatter::SHORT
401-
);
402-
break;
403-
case '7d':
404-
case '1m':
405-
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
406-
$period,
407-
\IntlDateFormatter::SHORT,
408-
\IntlDateFormatter::NONE
409-
);
410-
break;
411-
case '1y':
412-
case '2y':
413-
$this->_axisLabels[$idx][$_index] = date('m/Y', strtotime($_label));
414-
break;
415-
}
416-
} else {
417-
$this->_axisLabels[$idx][$_index] = '';
418-
}
419-
}
420-
352+
$this->formatAxisLabelDate($idx, $timezoneLocal);
421353
$tmpstring = implode('|', $this->_axisLabels[$idx]);
422-
423354
$valueBuffer[] = $indexid . ":|" . $tmpstring;
424355
} elseif ($idx == 'y') {
425356
$valueBuffer[] = $indexid . ":|" . implode('|', $yLabels);
@@ -447,6 +378,46 @@ public function getChartUrl($directUrl = true)
447378
}
448379
}
449380

381+
/**
382+
* Format dates for axis labels
383+
*
384+
* @param string $idx
385+
* @param string $timezoneLocal
386+
*
387+
* @return void
388+
*/
389+
private function formatAxisLabelDate($idx, $timezoneLocal)
390+
{
391+
foreach ($this->_axisLabels[$idx] as $_index => $_label) {
392+
if ($_label != '') {
393+
$period = new \DateTime($_label, new \DateTimeZone($timezoneLocal));
394+
switch ($this->getDataHelper()->getParam('period')) {
395+
case '24h':
396+
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
397+
$period->setTime($period->format('H'), 0, 0),
398+
\IntlDateFormatter::NONE,
399+
\IntlDateFormatter::SHORT
400+
);
401+
break;
402+
case '7d':
403+
case '1m':
404+
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
405+
$period,
406+
\IntlDateFormatter::SHORT,
407+
\IntlDateFormatter::NONE
408+
);
409+
break;
410+
case '1y':
411+
case '2y':
412+
$this->_axisLabels[$idx][$_index] = date('m/Y', strtotime($_label));
413+
break;
414+
}
415+
} else {
416+
$this->_axisLabels[$idx][$_index] = '';
417+
}
418+
}
419+
}
420+
450421
/**
451422
* Get rows data
452423
*
@@ -540,6 +511,8 @@ protected function getHeight()
540511
}
541512

542513
/**
514+
* Sets data helper
515+
*
543516
* @param \Magento\Backend\Helper\Dashboard\AbstractDashboard $dataHelper
544517
* @return void
545518
*/

0 commit comments

Comments
 (0)