Skip to content

Commit 938156a

Browse files
author
Yu Tang
committed
Merge remote-tracking branch 'mainline/develop' into FearlessKiwis-MAGETWO-MAGETWO-45024-Shipping-Amount-Incorrect-Currency
2 parents e907083 + 869f987 commit 938156a

File tree

11 files changed

+98
-11
lines changed

11 files changed

+98
-11
lines changed

app/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public function execute()
2626
}
2727
$this->_validateTypes($types);
2828
foreach ($types as $code) {
29+
$this->_cacheTypeList->cleanType($code);
2930
if ($this->_cacheState->isEnabled($code)) {
3031
$this->_cacheState->setEnabled($code, false);
3132
$updatedTypes++;
3233
}
33-
$this->_cacheTypeList->cleanType($code);
3434
}
3535
if ($updatedTypes > 0) {
3636
$this->_cacheState->persist();

app/code/Magento/Backend/Controller/Adminhtml/Cache/MassRefresh.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public function execute()
2727
$this->_validateTypes($types);
2828
foreach ($types as $type) {
2929
$this->_cacheTypeList->cleanType($type);
30-
$this->_eventManager->dispatch('adminhtml_cache_refresh_type', ['type' => $type]);
3130
$updatedTypes++;
3231
}
3332
if ($updatedTypes > 0) {

app/code/Magento/PageCache/Model/Cache/Type.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,33 @@ class Type extends \Magento\Framework\Cache\Frontend\Decorator\TagScope
1919
*/
2020
const CACHE_TAG = 'FPC';
2121

22+
/**
23+
* @var \Magento\Framework\Event\ManagerInterface
24+
*/
25+
private $eventManager;
26+
2227
/**
2328
* @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool
29+
* @param \Magento\Framework\Event\ManagerInterface $eventManager
2430
*/
25-
public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool)
26-
{
31+
public function __construct(
32+
\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool,
33+
\Magento\Framework\Event\ManagerInterface $eventManager
34+
) {
2735
parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG);
36+
$this->eventManager = $eventManager;
37+
}
38+
39+
/**
40+
* {@inheritdoc}
41+
*
42+
* @param string $mode
43+
* @param array $tags
44+
* @return bool
45+
*/
46+
public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, array $tags = [])
47+
{
48+
$this->eventManager->dispatch('adminhtml_cache_refresh_type');
49+
return parent::clean($mode, $tags);
2850
}
2951
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\PageCache\Test\Unit\Model\Cache;
7+
8+
class TypeTest extends \PHPUnit_Framework_TestCase
9+
{
10+
/** @var \Magento\PageCache\Model\Cache\Type */
11+
protected $model;
12+
13+
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Event\ManagerInterface */
14+
protected $eventManagerMock;
15+
16+
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\Cache\Type\FrontendPool */
17+
protected $cacheFrontendPoolMock;
18+
19+
public function setUp()
20+
{
21+
$this->eventManagerMock = $this->getMockBuilder('Magento\Framework\Event\ManagerInterface')
22+
->disableOriginalConstructor()
23+
->getMock();
24+
$this->cacheFrontendPoolMock = $this->getMockBuilder('Magento\Framework\App\Cache\Type\FrontendPool')
25+
->disableOriginalConstructor()
26+
->getMock();
27+
$cacheFrontend = $this->getMockBuilder('Magento\Framework\Cache\FrontendInterface')
28+
->disableOriginalConstructor()
29+
->getMock();
30+
$this->cacheFrontendPoolMock->expects($this->once())
31+
->method('get')
32+
->willReturn($cacheFrontend);
33+
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
34+
$this->model = $objectManager->getObject(
35+
'Magento\PageCache\Model\Cache\Type',
36+
[
37+
'eventManager' => $this->eventManagerMock,
38+
'cacheFrontendPool' => $this->cacheFrontendPoolMock,
39+
]
40+
);
41+
}
42+
43+
public function testClean()
44+
{
45+
$this->eventManagerMock->expects($this->once())
46+
->method('dispatch')
47+
->with('adminhtml_cache_refresh_type');
48+
49+
$this->model->clean();
50+
}
51+
}

app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected function retrieveRemoteImage($fileUrl, $localFilePath)
128128
$image = $this->curl->read();
129129
if (empty($image)) {
130130
throw new \Magento\Framework\Exception\LocalizedException(
131-
__('Could not get video information. Please check your connection and try again.')
131+
__('Could not get preview image information. Please check your connection and try again.')
132132
);
133133
}
134134
$this->fileUtility->saveFile($localFilePath, $image);

app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ require([
303303
additionalParams += '&autoplay=1';
304304
}
305305

306-
src = 'http://player.vimeo.com/video/' +
306+
src = window.location.protocol + '//player.vimeo.com/video/' +
307307
this._code + '?api=1&player_id=vimeo' +
308308
this._code +
309309
timestamp +
@@ -483,7 +483,7 @@ require([
483483
}
484484
);
485485
} else if (type === 'vimeo') {
486-
$.getJSON('http://www.vimeo.com/api/v2/video/' + id + '.json?callback=?',
486+
$.getJSON(window.location.protocol + '//www.vimeo.com/api/v2/video/' + id + '.json?callback=?',
487487
{
488488
format: 'json'
489489
},

app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ define([
508508
$image.find('.magnify-lens').remove();
509509
$image.on('click', function () {
510510
if ($(this).hasClass('video-unplayed') && $(this).find('iframe').length === 0) {
511+
$('.fotorama__arr--next').hide();
512+
$('.fotorama__arr--prev').hide();
513+
511514
$(this).removeClass('video-unplayed');
512515
$(this).find('.' + PV).productVideoLoader();
513516

@@ -611,6 +614,8 @@ define([
611614
$(this).remove();
612615
$item.append(cloneVideoDiv);
613616
$item.addClass('video-unplayed');
617+
$('.fotorama__arr--next').show();
618+
$('.fotorama__arr--prev').show();
614619
self._hideCloseVideo();
615620

616621
});

app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ define(['jquery', 'jquery/ui'], function ($) {
327327
.attr('width', this._width)
328328
.attr('height', this._height)
329329
.attr('src', src)
330+
.attr('webkitallowfullscreen', '')
331+
.attr('mozallowfullscreen', '')
332+
.attr('allowfullscreen', '')
330333
);
331334
this._player = window.$f(this.element.children(':first')[0]);
332335

lib/web/fotorama/fotorama.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,6 +3506,13 @@ fotoramaVersion = '4.6.4';
35063506

35073507
that.requestFullScreen = function () {
35083508
if (o_allowFullScreen && !that.fullScreen) {
3509+
3510+
//check that this is not video
3511+
var isVideo = $((that.activeFrame || {}).$stageFrame || {}).hasClass('fotorama-video-container');
3512+
if(isVideo) {
3513+
return;
3514+
}
3515+
35093516
scrollTop = $WINDOW.scrollTop();
35103517
scrollLeft = $WINDOW.scrollLeft();
35113518

setup/src/Magento/Setup/Model/Installer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,8 +956,8 @@ public function uninstall()
956956
{
957957
$this->log->log('Starting Magento uninstallation:');
958958

959-
$this->cleanupDb();
960959
$this->cleanCaches();
960+
$this->cleanupDb();
961961

962962
$this->log->log('File system cleanup:');
963963
$messages = $this->cleanupFiles->clearAllFiles();

setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public function testUninstall()
390390
]));
391391
$this->logger->expects($this->at(0))->method('log')->with('Starting Magento uninstallation:');
392392
$this->logger
393-
->expects($this->at(1))
393+
->expects($this->at(2))
394394
->method('log')
395395
->with('No database connection defined - skipping database cleanup');
396396
$cacheManager = $this->getMock('Magento\Framework\App\Cache\Manager', [], [], '', false);
@@ -400,7 +400,7 @@ public function testUninstall()
400400
->method('get')
401401
->with('Magento\Framework\App\Cache\Manager')
402402
->willReturn($cacheManager);
403-
$this->logger->expects($this->at(2))->method('log')->with('Cache cleared successfully');
403+
$this->logger->expects($this->at(1))->method('log')->with('Cache cleared successfully');
404404
$this->logger->expects($this->at(3))->method('log')->with('File system cleanup:');
405405
$this->logger
406406
->expects($this->at(4))
@@ -494,7 +494,7 @@ private function prepareForUpdateModulesTests()
494494

495495
/**
496496
* Mocking autoload function
497-
*
497+
*
498498
* @returns array
499499
*/
500500
function spl_autoload_functions()

0 commit comments

Comments
 (0)