diff -Nuar a/vendor/magento/module-catalog-staging/Observer/Category/Controller/Save/UnsetCustomDesignDates.php b/vendor/magento/module-catalog-staging/Observer/Category/Controller/Save/UnsetCustomDesignDates.php new file mode 100644 index 00000000000..c623550c177 --- /dev/null +++ b/vendor/magento/module-catalog-staging/Observer/Category/Controller/Save/UnsetCustomDesignDates.php @@ -0,0 +1,37 @@ +getData('request'); + $postValues = $request->getPostValue(); + foreach (self::FIELDS_TO_UNSET as $field) { + unset($postValues[$field]); + } + $request->setPostValue($postValues); + } +} diff -Nuar a/vendor/magento/module-catalog-staging/Plugin/Model/Category.php b/vendor/magento/module-catalog-staging/Plugin/Model/Category.php new file mode 100644 index 00000000000..b67ecd5f4eb --- /dev/null +++ b/vendor/magento/module-catalog-staging/Plugin/Model/Category.php @@ -0,0 +1,53 @@ +timezone = $timezone; + } + + /** + * Convert design dates to current time zone + * + * @param CategoryModel $category + * @param array $result + * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterGetCustomDesignDate(CategoryModel $category, array $result): array + { + if (!empty($result['from'])) { + $result['from'] = $this->timezone->scopeDate(null, $result['from'], true) + ->format(DateTime::DATETIME_PHP_FORMAT); + } + if (!empty($result['to'])) { + $result['to'] = $this->timezone->scopeDate(null, $result['from'], true) + ->format(DateTime::DATETIME_PHP_FORMAT); + } + + return $result; + } +} diff -Nuar a/vendor/magento/module-catalog-staging/etc/adminhtml/events.xml b/vendor/magento/module-catalog-staging/etc/adminhtml/events.xml new file mode 100644 index 00000000000..9c8485022ce --- /dev/null +++ b/vendor/magento/module-catalog-staging/etc/adminhtml/events.xml @@ -0,0 +1,12 @@ + + + + + + + diff -Nuar a/vendor/magento/module-catalog-staging/etc/di.xml b/vendor/magento/module-catalog-staging/etc/di.xml index 1d2cc0f2128..388ef94a38b 100644 --- a/vendor/magento/module-catalog-staging/etc/di.xml +++ b/vendor/magento/module-catalog-staging/etc/di.xml @@ -379,4 +379,7 @@ Magento\Staging\Model\VersionManager\Proxy + + +