diff --git a/composer.json b/composer.json
index 61fc678..d0aabb1 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "magento/magento-cloud-patches",
"description": "Provides critical fixes for Magento 2 Enterprise Edition",
"type": "magento2-component",
- "version": "1.0.1",
+ "version": "1.0.3",
"license": "OSL-3.0",
"require": {
"php": "^7.0",
@@ -10,7 +10,7 @@
"composer/composer": "@stable",
"composer/semver": "^1.5",
"symfony/config": "^3.3||^4.4",
- "symfony/console": "^2.8||^4.0",
+ "symfony/console": "^2.6||^4.0",
"symfony/dependency-injection": "^3.3||^4.3",
"symfony/process": "^2.1||^4.1"
},
diff --git a/patches.json b/patches.json
index 1c802f7..d888025 100644
--- a/patches.json
+++ b/patches.json
@@ -228,7 +228,8 @@
"2.2.4": "MAGETWO-92926__fix_for_multi-site_configuration_issue__2.2.4.patch"
},
"FPC is getting disabled during deployments": {
- ">=2.3.2 <2.4.0": "MAGECLOUD-5069__fpc_is_getting_disabled_during_deployments__2.3.2.patch"
+ ">=2.3.2 <2.3.5": "MAGECLOUD-5069__fpc_is_getting_disabled_during_deployments__2.3.2.patch",
+ ">=2.3.5 <2.4.0": "MAGECLOUD-5069__fpc_is_getting_disabled_during_deployments__2.3.5.patch"
}
},
"magento/module-paypal": {
diff --git a/patches/MAGECLOUD-5069__fpc_is_getting_disabled_during_deployments__2.3.5.patch b/patches/MAGECLOUD-5069__fpc_is_getting_disabled_during_deployments__2.3.5.patch
new file mode 100644
index 0000000..41566c5
--- /dev/null
+++ b/patches/MAGECLOUD-5069__fpc_is_getting_disabled_during_deployments__2.3.5.patch
@@ -0,0 +1,427 @@
+diff --Nuar a/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php b/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php
+--- a/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php
++++ b/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php
+@@ -7,6 +7,7 @@ declare(strict_types=1);
+
+ namespace Magento\PageCache\Model\Layout;
+
++use Magento\Framework\App\MaintenanceMode;
+ use Magento\Framework\App\ResponseInterface;
+ use Magento\Framework\DataObject\IdentityInterface;
+ use Magento\Framework\View\Layout;
+@@ -27,16 +28,24 @@ class LayoutPlugin
+ */
+ private $response;
+
++ /**
++ * @var MaintenanceMode
++ */
++ private $maintenanceMode;
++
+ /**
+ * @param ResponseInterface $response
+ * @param Config $config
++ * @param MaintenanceMode $maintenanceMode
+ */
+ public function __construct(
+ ResponseInterface $response,
+- Config $config
++ Config $config,
++ MaintenanceMode $maintenanceMode
+ ) {
+ $this->response = $response;
+ $this->config = $config;
++ $this->maintenanceMode = $maintenanceMode;
+ }
+
+ /**
+@@ -49,7 +58,7 @@ class LayoutPlugin
+ */
+ public function afterGenerateElements(Layout $subject)
+ {
+- if ($subject->isCacheable() && $this->config->isEnabled()) {
++ if ($subject->isCacheable() && !$this->maintenanceMode->isOn() && $this->config->isEnabled()) {
+ $this->response->setPublicHeaders($this->config->getTtl());
+ }
+ }
+diff --Nuar a/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance.php b/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance.php
+deleted file mode 100644
+--- a/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance.php
++++ /dev/null
+@@ -1,108 +0,0 @@
+-cacheManager = $cacheManager;
+- $this->pageCacheStateStorage = $pageCacheStateStorage;
+- }
+-
+- /**
+- * Switches Full Page Cache.
+- *
+- * Depending on enabling or disabling Maintenance Mode it turns off or restores Full Page Cache state.
+- *
+- * @param Observer $observer
+- * @return void
+- */
+- public function execute(Observer $observer): void
+- {
+- if ($observer->getData('isOn')) {
+- $this->pageCacheStateStorage->save($this->isFullPageCacheEnabled());
+- $this->turnOffFullPageCache();
+- } else {
+- $this->restoreFullPageCacheState();
+- }
+- }
+-
+- /**
+- * Turns off Full Page Cache.
+- *
+- * @return void
+- */
+- private function turnOffFullPageCache(): void
+- {
+- if (!$this->isFullPageCacheEnabled()) {
+- return;
+- }
+-
+- $this->cacheManager->clean([PageCacheType::TYPE_IDENTIFIER]);
+- $this->cacheManager->setEnabled([PageCacheType::TYPE_IDENTIFIER], false);
+- }
+-
+- /**
+- * Full Page Cache state.
+- *
+- * @return bool
+- */
+- private function isFullPageCacheEnabled(): bool
+- {
+- $cacheStatus = $this->cacheManager->getStatus();
+-
+- if (!array_key_exists(PageCacheType::TYPE_IDENTIFIER, $cacheStatus)) {
+- return false;
+- }
+-
+- return (bool)$cacheStatus[PageCacheType::TYPE_IDENTIFIER];
+- }
+-
+- /**
+- * Restores Full Page Cache state.
+- *
+- * Returns FPC to previous state that was before maintenance mode turning on.
+- *
+- * @return void
+- */
+- private function restoreFullPageCacheState(): void
+- {
+- $storedPageCacheState = $this->pageCacheStateStorage->isEnabled();
+- $this->pageCacheStateStorage->flush();
+-
+- if ($storedPageCacheState) {
+- $this->cacheManager->setEnabled([PageCacheType::TYPE_IDENTIFIER], true);
+- }
+- }
+-}
+diff --Nuar a/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php b/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php
+--- a/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php
++++ b/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php
+@@ -14,6 +14,8 @@ use Magento\Framework\App\Filesystem\DirectoryList;
+
+ /**
+ * Page Cache state.
++ *
++ * @deprecated Originally used by now removed observer SwitchPageCacheOnMaintenance
+ */
+ class PageCacheState
+ {
+diff --Nuar a/vendor/magento/module-page-cache/Test/Unit/Model/Layout/LayoutPluginTest.php b/vendor/magento/module-page-cache/Test/Unit/Model/Layout/LayoutPluginTest.php
+--- a/vendor/magento/module-page-cache/Test/Unit/Model/Layout/LayoutPluginTest.php
++++ b/vendor/magento/module-page-cache/Test/Unit/Model/Layout/LayoutPluginTest.php
+@@ -8,6 +8,7 @@ declare(strict_types=1);
+ namespace Magento\PageCache\Test\Unit\Model\Layout;
+
+ use Magento\Framework\App\Config\ScopeConfigInterface;
++use Magento\Framework\App\MaintenanceMode;
+ use Magento\Framework\App\Response\Http;
+ use Magento\Framework\App\ResponseInterface;
+ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
+@@ -43,6 +44,11 @@ class LayoutPluginTest extends TestCase
+ */
+ private $configMock;
+
++ /**
++ * @var MaintenanceMode|PHPUnit_Framework_MockObject_MockObject
++ */
++ private $maintenanceModeMock;
++
+ /**
+ * @inheritdoc
+ */
+@@ -51,12 +57,14 @@ class LayoutPluginTest extends TestCase
+ $this->layoutMock = $this->createPartialMock(Layout::class, ['isCacheable', 'getAllBlocks']);
+ $this->responseMock = $this->createMock(Http::class);
+ $this->configMock = $this->createMock(Config::class);
++ $this->maintenanceModeMock = $this->createMock(MaintenanceMode::class);
+
+ $this->model = (new ObjectManagerHelper($this))->getObject(
+ LayoutPlugin::class,
+ [
+ 'response' => $this->responseMock,
+ 'config' => $this->configMock,
++ 'maintenanceMode' => $this->maintenanceModeMock
+ ]
+ );
+ }
+@@ -64,17 +72,19 @@ class LayoutPluginTest extends TestCase
+ /**
+ * @param $cacheState
+ * @param $layoutIsCacheable
++ * @param $maintenanceModeIsEnabled
+ * @return void
+ * @dataProvider afterGenerateXmlDataProvider
+ */
+- public function testAfterGenerateElements($cacheState, $layoutIsCacheable): void
++ public function testAfterGenerateElements($cacheState, $layoutIsCacheable, $maintenanceModeIsEnabled): void
+ {
+ $maxAge = 180;
+
+ $this->layoutMock->expects($this->once())->method('isCacheable')->will($this->returnValue($layoutIsCacheable));
+ $this->configMock->expects($this->any())->method('isEnabled')->will($this->returnValue($cacheState));
++ $this->maintenanceModeMock->expects($this->any())->method('isOn')->will($this->returnValue($maintenanceModeIsEnabled));
+
+- if ($layoutIsCacheable && $cacheState) {
++ if ($layoutIsCacheable && $cacheState && !$maintenanceModeIsEnabled) {
+ $this->configMock->expects($this->once())->method('getTtl')->will($this->returnValue($maxAge));
+ $this->responseMock->expects($this->once())->method('setPublicHeaders')->with($maxAge);
+ } else {
+@@ -90,10 +100,11 @@ class LayoutPluginTest extends TestCase
+ public function afterGenerateXmlDataProvider(): array
+ {
+ return [
+- 'Full_cache state is true, Layout is cache-able' => [true, true],
+- 'Full_cache state is true, Layout is not cache-able' => [true, false],
+- 'Full_cache state is false, Layout is not cache-able' => [false, false],
+- 'Full_cache state is false, Layout is cache-able' => [false, true],
++ 'Full_cache state is true, Layout is cache-able' => [true, true, false],
++ 'Full_cache state is true, Layout is not cache-able' => [true, false, false],
++ 'Full_cache state is false, Layout is not cache-able' => [false, false, false],
++ 'Full_cache state is false, Layout is cache-able' => [false, true, false],
++ 'Full_cache state is true, Layout is cache-able, Maintenance mode is enabled' => [true, true, true],
+ ];
+ }
+
+diff --Nuar a/vendor/magento/module-page-cache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php b/vendor/magento/module-page-cache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php
+deleted file mode 100644
+--- a/vendor/magento/module-page-cache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php
++++ /dev/null
+@@ -1,164 +0,0 @@
+-cacheManager = $this->createMock(Manager::class);
+- $this->pageCacheStateStorage = $this->createMock(PageCacheState::class);
+- $this->observer = $this->createMock(Observer::class);
+-
+- $this->model = $objectManager->getObject(SwitchPageCacheOnMaintenance::class, [
+- 'cacheManager' => $this->cacheManager,
+- 'pageCacheStateStorage' => $this->pageCacheStateStorage,
+- ]);
+- }
+-
+- /**
+- * Tests execute when setting maintenance mode to on.
+- *
+- * @param array $cacheStatus
+- * @param bool $cacheState
+- * @param int $flushCacheCalls
+- * @return void
+- * @dataProvider enablingPageCacheStateProvider
+- */
+- public function testExecuteWhileMaintenanceEnabling(
+- array $cacheStatus,
+- bool $cacheState,
+- int $flushCacheCalls
+- ): void {
+- $this->observer->method('getData')
+- ->with('isOn')
+- ->willReturn(true);
+- $this->cacheManager->method('getStatus')
+- ->willReturn($cacheStatus);
+-
+- // Page Cache state will be stored.
+- $this->pageCacheStateStorage->expects($this->once())
+- ->method('save')
+- ->with($cacheState);
+-
+- // Page Cache will be cleaned and disabled
+- $this->cacheManager->expects($this->exactly($flushCacheCalls))
+- ->method('clean')
+- ->with([PageCacheType::TYPE_IDENTIFIER]);
+- $this->cacheManager->expects($this->exactly($flushCacheCalls))
+- ->method('setEnabled')
+- ->with([PageCacheType::TYPE_IDENTIFIER], false);
+-
+- $this->model->execute($this->observer);
+- }
+-
+- /**
+- * Tests execute when setting Maintenance Mode to off.
+- *
+- * @param bool $storedCacheState
+- * @param int $enableCacheCalls
+- * @return void
+- * @dataProvider disablingPageCacheStateProvider
+- */
+- public function testExecuteWhileMaintenanceDisabling(bool $storedCacheState, int $enableCacheCalls): void
+- {
+- $this->observer->method('getData')
+- ->with('isOn')
+- ->willReturn(false);
+-
+- $this->pageCacheStateStorage->method('isEnabled')
+- ->willReturn($storedCacheState);
+-
+- // Nullify Page Cache state.
+- $this->pageCacheStateStorage->expects($this->once())
+- ->method('flush');
+-
+- // Page Cache will be enabled.
+- $this->cacheManager->expects($this->exactly($enableCacheCalls))
+- ->method('setEnabled')
+- ->with([PageCacheType::TYPE_IDENTIFIER]);
+-
+- $this->model->execute($this->observer);
+- }
+-
+- /**
+- * Page Cache state data provider.
+- *
+- * @return array
+- */
+- public function enablingPageCacheStateProvider(): array
+- {
+- return [
+- 'page_cache_is_enable' => [
+- 'cache_status' => [PageCacheType::TYPE_IDENTIFIER => 1],
+- 'cache_state' => true,
+- 'flush_cache_calls' => 1,
+- ],
+- 'page_cache_is_missing_in_system' => [
+- 'cache_status' => [],
+- 'cache_state' => false,
+- 'flush_cache_calls' => 0,
+- ],
+- 'page_cache_is_disable' => [
+- 'cache_status' => [PageCacheType::TYPE_IDENTIFIER => 0],
+- 'cache_state' => false,
+- 'flush_cache_calls' => 0,
+- ],
+- ];
+- }
+-
+- /**
+- * Page Cache state data provider.
+- *
+- * @return array
+- */
+- public function disablingPageCacheStateProvider(): array
+- {
+- return [
+- ['stored_cache_state' => true, 'enable_cache_calls' => 1],
+- ['stored_cache_state' => false, 'enable_cache_calls' => 0],
+- ];
+- }
+-}
+diff --Nuar a/vendor/magento/module-page-cache/etc/events.xml b/vendor/magento/module-page-cache/etc/events.xml
+--- a/vendor/magento/module-page-cache/etc/events.xml
++++ b/vendor/magento/module-page-cache/etc/events.xml
+@@ -57,7 +57,4 @@
+
+
+
+-
+-
+-
+
diff --git a/patches/MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.1.patch b/patches/MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.1.patch
index feebf9d..194df61 100644
--- a/patches/MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.1.patch
+++ b/patches/MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.1.patch
@@ -234,7 +234,7 @@ diff -Nuar a/vendor/magento/module-amqp/composer.json b/vendor/magento/module-am
"php": "~7.1.3||~7.2.0"
},
+ "suggest": {
-+ "magento/module-asynchronous-operations": "*",
++ "magento/module-asynchronous-operations": "*"
+ },
"type": "magento2-module",
"license": [
diff --git a/patches/MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.2.patch b/patches/MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.2.patch
index 99257df..1cc4a23 100644
--- a/patches/MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.2.patch
+++ b/patches/MAGETWO-99902__pass_store_view_scope_in_async_web_api__2.3.2.patch
@@ -234,7 +234,7 @@ diff -Nuar a/vendor/magento/module-amqp/composer.json b/vendor/magento/module-am
"php": "~7.1.3||~7.2.0"
},
+ "suggest": {
-+ "magento/module-asynchronous-operations": "*",
++ "magento/module-asynchronous-operations": "*"
+ },
"type": "magento2-module",
"license": [