Skip to content

Commit 993d62f

Browse files
author
Roman Ganin
committed
Merge branch 'develop' of https://github.corp.magento.com/magento2/magento2ce into bugfix_s47
2 parents b88caeb + d391b29 commit 993d62f

File tree

138 files changed

+3267
-2128
lines changed

Some content is hidden

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

138 files changed

+3267
-2128
lines changed

app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@ protected function setUp()
8888

8989
$this->deploymentConfig = $this->getMockBuilder('Magento\Framework\App\DeploymentConfig')
9090
->disableOriginalConstructor()->getMock();
91+
9192
$this->objectManagerHelper = new ObjectManagerHelper($this);
9293

93-
$this->productMetadata = $this->getMock('Magento\Framework\App\ProductMetadata');
94+
$this->productMetadata = $this->getMockBuilder('Magento\Framework\App\ProductMetadata')
95+
->disableOriginalConstructor()->getMock();
96+
9497
$this->urlBuilder = $this->getMock('Magento\Framework\UrlInterface');
9598

9699
$this->feed = $this->objectManagerHelper->getObject(

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,7 @@ public function getChartUrl($directUrl = true)
200200
$this->setAxisLabels($axis, $this->getRowsData($attr, true));
201201
}
202202

203-
$timezoneLocal = $this->_scopeConfig->getValue(
204-
$this->_localeDate->getDefaultTimezonePath(),
205-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
206-
);
203+
$timezoneLocal = $this->_localeDate->getConfigTimezone();
207204

208205
/** @var \DateTime $dateStart */
209206
/** @var \DateTime $dateEnd */
@@ -214,10 +211,14 @@ public function getChartUrl($directUrl = true)
214211
true
215212
);
216213

214+
$dateStart->setTimezone(new \DateTimeZone($timezoneLocal));
215+
$dateEnd->setTimezone(new \DateTimeZone($timezoneLocal));
216+
217217
if ($this->getDataHelper()->getParam('period') == '24h') {
218-
$dateStart->setTimezone(new \DateTimeZone($timezoneLocal));
219-
$dateEnd->setTimezone(new \DateTimeZone($timezoneLocal));
220218
$dateEnd->modify('-1 hour');
219+
} else {
220+
$dateEnd->setTime(23, 59, 59);
221+
$dateStart->setTime(0, 0, 0);
221222
}
222223

223224
$dates = [];

app/code/Magento/Backend/Block/Page/Footer.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,40 @@ class Footer extends \Magento\Backend\Block\Template
1717
*/
1818
protected $_template = 'page/footer.phtml';
1919

20+
/**
21+
* @var \Magento\Framework\App\ProductMetadataInterface
22+
*/
23+
protected $productMetadata;
24+
25+
/**
26+
* @param \Magento\Backend\Block\Template\Context $context
27+
* @param \Magento\Framework\App\ProductMetadataInterface $productMetadata
28+
* @param array $data
29+
*/
30+
public function __construct(
31+
\Magento\Backend\Block\Template\Context $context,
32+
\Magento\Framework\App\ProductMetadataInterface $productMetadata,
33+
array $data = []
34+
) {
35+
$this->productMetadata = $productMetadata;
36+
parent::__construct($context, $data);
37+
}
38+
2039
/**
2140
* @return void
2241
*/
2342
protected function _construct()
2443
{
2544
$this->setShowProfiler(true);
2645
}
46+
47+
/**
48+
* Get product version
49+
*
50+
* @return string
51+
*/
52+
public function getMagentoVersion()
53+
{
54+
return $this->productMetadata->getVersion();
55+
}
2756
}

app/code/Magento/Backend/view/adminhtml/templates/page/footer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
?>
1010
<p class="magento-version">
1111
<strong><?php /* @escapeNotVerified */ echo __('Magento'); ?></strong>
12-
<?php /* @escapeNotVerified */ echo __('ver. %1', \Magento\Framework\AppInterface::VERSION) ?>
12+
<?php /* @escapeNotVerified */ echo __('ver. %1', $block->getMagentoVersion()) ?>
1313
</p>

app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ class Suffix extends \Magento\Framework\App\Config\Value
3535
/** @var \Magento\Framework\DB\Adapter\AdapterInterface */
3636
protected $connection;
3737

38+
/**
39+
* @var \Magento\Framework\App\ResourceConnection
40+
*/
41+
protected $resource;
42+
3843
/**
3944
* @param \Magento\Framework\Model\Context $context
4045
* @param \Magento\Framework\Registry $registry
@@ -67,6 +72,7 @@ public function __construct(
6772
$this->connection = $appResource->getConnection();
6873
$this->urlFinder = $urlFinder;
6974
$this->storeManager = $storeManager;
75+
$this->resource = $appResource;
7076
}
7177

7278
/**
@@ -118,7 +124,7 @@ protected function updateSuffixForUrlRewrites()
118124
? [UrlRewrite::REQUEST_PATH => preg_replace($oldSuffixPattern, $suffix, $urlRewrite->getRequestPath())]
119125
: [UrlRewrite::TARGET_PATH => preg_replace($oldSuffixPattern, $suffix, $urlRewrite->getTargetPath())];
120126
$this->connection->update(
121-
DbStorage::TABLE_NAME,
127+
$this->resource->getTableName(DbStorage::TABLE_NAME),
122128
$bind,
123129
$this->connection->quoteIdentifier(UrlRewrite::URL_REWRITE_ID) . ' = ' . $urlRewrite->getUrlRewriteId()
124130
);

app/code/Magento/Cms/Block/Adminhtml/Block/Edit.php

Lines changed: 0 additions & 84 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Cms\Block\Adminhtml\Block\Edit;
7+
8+
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
9+
10+
/**
11+
* Class BackButton
12+
*/
13+
class BackButton extends GenericButton implements ButtonProviderInterface
14+
{
15+
/**
16+
* @return array
17+
*/
18+
public function getButtonData()
19+
{
20+
return [
21+
'label' => __('Back'),
22+
'on_click' => sprintf("location.href = '%s';", $this->getBackUrl()),
23+
'class' => 'back',
24+
'sort_order' => 10
25+
];
26+
}
27+
28+
/**
29+
* Get URL for back (reset) button
30+
*
31+
* @return string
32+
*/
33+
public function getBackUrl()
34+
{
35+
return $this->getUrl('*/*/');
36+
}
37+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Cms\Block\Adminhtml\Block\Edit;
7+
8+
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
9+
10+
/**
11+
* Class DeleteButton
12+
*/
13+
class DeleteButton extends GenericButton implements ButtonProviderInterface
14+
{
15+
16+
/**
17+
* @return array
18+
*/
19+
public function getButtonData()
20+
{
21+
$data = [];
22+
if ($this->getPageId()) {
23+
$data = [
24+
'label' => __('Delete Block'),
25+
'class' => 'delete',
26+
'on_click' => 'deleteConfirm(\'' . __(
27+
'Are you sure you want to do this?'
28+
) . '\', \'' . $this->getDeleteUrl() . '\')',
29+
'sort_order' => 20,
30+
];
31+
}
32+
return $data;
33+
}
34+
35+
/**
36+
* @return string
37+
*/
38+
public function getDeleteUrl()
39+
{
40+
return $this->getUrl('*/*/delete', ['block_id' => $this->getPageId()]);
41+
}
42+
}

0 commit comments

Comments
 (0)