From ddb1eea3d3db5664578bb85c739373b292226ad6 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Thu, 25 Aug 2016 14:54:41 +0300 Subject: [PATCH 1/4] MAGETWO-55757: Magento 2 does not work on Apache php-fpm environment --- .htaccess | 24 ++++++++++++++++++++++++ pub/.htaccess | 26 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/.htaccess b/.htaccess index f3dbe217081ac..af9470488c632 100644 --- a/.htaccess +++ b/.htaccess @@ -32,6 +32,7 @@ DirectoryIndex index.php + ############################################ ## adjust memory limit @@ -53,7 +54,30 @@ ## disable user agent verification to not break multiple image upload php_flag suhosin.session.cryptua off + + +############################################ +## adjust memory limit + + php_value memory_limit 768M + php_value max_execution_time 18000 + +############################################ +## disable automatic session start +## before autoload was initialized + + php_flag session.auto_start off + +############################################ +## enable resulting html compression + + #php_flag zlib.output_compression on +########################################### +## disable user agent verification to not break multiple image upload + + php_flag suhosin.session.cryptua off + ########################################### ## disable POST processing to not break multiple image upload diff --git a/pub/.htaccess b/pub/.htaccess index a8fc2ccf222db..ecdaf1758a92a 100644 --- a/pub/.htaccess +++ b/pub/.htaccess @@ -32,6 +32,7 @@ DirectoryIndex index.php + ############################################ ## Adjust memory limit @@ -53,6 +54,31 @@ # Disable user agent verification to not break multiple image upload php_flag suhosin.session.cryptua off + + +############################################ +## Adjust memory limit + + php_value memory_limit 768M + php_value max_execution_time 18000 + +############################################ +## Disable automatic session start +## before autoload was initialized + + php_flag session.auto_start off + +############################################ +## Enable resulting html compression + + #php_flag zlib.output_compression on + +########################################### +# Disable user agent verification to not break multiple image upload + + php_flag suhosin.session.cryptua off + + ########################################### From df47e15f3655ef3b1ecc250f3698017813ce9d21 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Mon, 29 Aug 2016 13:48:35 +0300 Subject: [PATCH 2/4] MAGETWO-56092: Pagination is absent on Order Status grid --- .../Sales/view/adminhtml/layout/sales_order_status_index.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml index f3c7408bb6c2b..6929c7ad9963d 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_index.xml @@ -15,7 +15,7 @@ Magento\Sales\Model\ResourceModel\Status\Collection state desc - 0 + 1 From be08f1a08d368c07701591d0f5d8e0df27f97275 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Tue, 30 Aug 2016 12:58:44 +0300 Subject: [PATCH 3/4] MAGETWO-55757: Magento 2 does not work on Apache php-fpm environment --- .user.ini | 4 ++++ pub/.user.ini | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 .user.ini create mode 100644 pub/.user.ini diff --git a/.user.ini b/.user.ini new file mode 100644 index 0000000000000..8c0b765e0551c --- /dev/null +++ b/.user.ini @@ -0,0 +1,4 @@ +memory_limit = 768M +max_execution_time = 18000 +session.auto_start = off +suhosin.session.cryptua = off \ No newline at end of file diff --git a/pub/.user.ini b/pub/.user.ini new file mode 100644 index 0000000000000..8c0b765e0551c --- /dev/null +++ b/pub/.user.ini @@ -0,0 +1,4 @@ +memory_limit = 768M +max_execution_time = 18000 +session.auto_start = off +suhosin.session.cryptua = off \ No newline at end of file From 2db5aa15722307fb6ad703627933224f5f74bbe3 Mon Sep 17 00:00:00 2001 From: Andrii Dimov Date: Thu, 25 Aug 2016 14:51:08 +0300 Subject: [PATCH 4/4] MAGETWO-54718: [GitHub] Exception thrown where no Product Image file found #5184 #5497 #5871 --- .../Product/Helper/Form/Gallery/Content.php | 29 ++------------ .../Helper/Form/Gallery/ContentTest.php | 39 ++++--------------- 2 files changed, 11 insertions(+), 57 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php index 262ba8cccc27e..fa863176952b1 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php @@ -40,11 +40,6 @@ class Content extends \Magento\Backend\Block\Widget */ private $imageHelper; - /** - * @var \Magento\Framework\View\Asset\Repository - */ - private $assetRepo; - /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder @@ -139,7 +134,7 @@ public function getImagesJson() is_array($value['images']) && count($value['images']) ) { - $mediaDir = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA); + $mediaDir = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA); $images = $this->sortImagesByPosition($value['images']); foreach ($images as &$image) { $image['url'] = $this->_mediaConfig->getMediaUrl($image['file']); @@ -147,12 +142,8 @@ public function getImagesJson() $fileHandler = $mediaDir->stat($this->_mediaConfig->getMediaPath($image['file'])); $image['size'] = $fileHandler['size']; } catch (FileSystemException $e) { - $staticDir = $this->_filesystem->getDirectoryRead(DirectoryList::STATIC_VIEW); - $image['url'] = $this->getImageHelper()->getDefaultPlaceholderUrl('thumbnail'); - $fileHandler = $staticDir->stat( - $this->getAssetRepo()->createAsset($this->getImageHelper()->getPlaceholder('thumbnail'))->getPath() - ); - $image['size'] = $fileHandler['size']; + $image['url'] = $this->getImageHelper()->getDefaultPlaceholderUrl('small_image'); + $image['size'] = 0; $this->_logger->warning($e); } } @@ -261,18 +252,4 @@ private function getImageHelper() } return $this->imageHelper; } - - /** - * @return \Magento\Framework\View\Asset\Repository - * @deprecated - */ - private function getAssetRepo() - { - if ($this->assetRepo === null) { - $this->assetRepo = \Magento\Framework\App\ObjectManager::getInstance() - ->get('\Magento\Framework\View\Asset\Repository'); - } - - return $this->assetRepo; - } } diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php index 33faf5963c910..0ec8e53357523 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/Gallery/ContentTest.php @@ -46,11 +46,6 @@ class ContentTest extends \PHPUnit_Framework_TestCase */ protected $imageHelper; - /** - * @var \Magento\Framework\View\Asset\Repository|\PHPUnit_Framework_MockObject_MockObject - */ - protected $assetRepo; - /** * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ @@ -171,30 +166,17 @@ public function testGetImagesJsonWithException() { $this->imageHelper = $this->getMockBuilder('Magento\Catalog\Helper\Image') ->disableOriginalConstructor() - ->setMethods(['getDefaultPlaceholderUrl', 'getPlaceholder']) - ->getMock(); - - $this->assetRepo = $this->getMockBuilder('Magento\Framework\View\Asset\Repository') - ->disableOriginalConstructor() - ->setMethods(['createAsset', 'getPath']) + ->setMethods(['getDefaultPlaceholderUrl']) ->getMock(); $this->objectManager->setBackwardCompatibleProperty( $this->content, 'imageHelper', - $this->imageHelper - ); - - $this->objectManager->setBackwardCompatibleProperty( - $this->content, - 'assetRepo', - $this->assetRepo + $this->imageHelper ); $placeholderUrl = 'url_to_the_placeholder/placeholder.jpg'; - $sizePlaceholder = ['size' => 399659]; - $imagesResult = [ [ 'value_id' => '2', @@ -202,7 +184,7 @@ public function testGetImagesJsonWithException() 'media_type' => 'image', 'position' => '0', 'url' => 'url_to_the_placeholder/placeholder.jpg', - 'size' => 399659 + 'size' => 0 ], [ 'value_id' => '1', @@ -210,7 +192,7 @@ public function testGetImagesJsonWithException() 'media_type' => 'image', 'position' => '1', 'url' => 'url_to_the_placeholder/placeholder.jpg', - 'size' => 399659 + 'size' => 0 ] ]; @@ -238,20 +220,15 @@ public function testGetImagesJsonWithException() $this->mediaConfigMock->expects($this->any())->method('getMediaPath'); $this->readMock->expects($this->any())->method('stat')->willReturnOnConsecutiveCalls( $this->throwException( - new \Magento\Framework\Exception\FileSystemException(new \Magento\Framework\Phrase('test')) + new \Magento\Framework\Exception\FileSystemException(new Phrase('test')) ), - $sizePlaceholder, $this->throwException( - new \Magento\Framework\Exception\FileSystemException(new \Magento\Framework\Phrase('test')) - ), - $sizePlaceholder + new \Magento\Framework\Exception\FileSystemException(new Phrase('test')) + ) ); $this->imageHelper->expects($this->any())->method('getDefaultPlaceholderUrl')->willReturn($placeholderUrl); - $this->imageHelper->expects($this->any())->method('getPlaceholder'); - $this->assetRepo->expects($this->any())->method('createAsset')->willReturnSelf(); - $this->assetRepo->expects($this->any())->method('getPath'); $this->jsonEncoderMock->expects($this->once())->method('encode')->willReturnCallback('json_encode'); $this->assertSame(json_encode($imagesResult), $this->content->getImagesJson()); - } + } }