diff --git a/app/code/Magento/Customer/view/frontend/templates/account/dashboard/info.phtml b/app/code/Magento/Customer/view/frontend/templates/account/dashboard/info.phtml index 7881b7e857fd9..ac8e1298b29b9 100644 --- a/app/code/Magento/Customer/view/frontend/templates/account/dashboard/info.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/account/dashboard/info.phtml @@ -20,6 +20,7 @@ escapeHtml($block->getName()) ?>
escapeHtml($block->getCustomer()->getEmail()) ?>

+ getChildHtml('customer.account.dashboard.info.extra'); ?>
@@ -43,8 +44,6 @@ escapeHtml(__('You aren\'t subscribed to our newsletter.')) ?>

- - getChildHtml('customer.account.dashboard.info.extra') ?>
escapeHtml(__('Edit')) ?> diff --git a/app/code/Magento/Deploy/Console/Command/App/ApplicationDumpCommand.php b/app/code/Magento/Deploy/Console/Command/App/ApplicationDumpCommand.php index 9d13c97790fa4..4eb965b21d53a 100644 --- a/app/code/Magento/Deploy/Console/Command/App/ApplicationDumpCommand.php +++ b/app/code/Magento/Deploy/Console/Command/App/ApplicationDumpCommand.php @@ -12,6 +12,7 @@ use Magento\Framework\Config\File\ConfigFilePool; use Magento\Framework\Console\Cli; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -20,6 +21,8 @@ */ class ApplicationDumpCommand extends Command { + const INPUT_CONFIG_TYPES = 'config-types'; + /** * @var Writer */ @@ -47,10 +50,10 @@ public function __construct( array $sources, Hash $configHash = null ) { - parent::__construct(); $this->writer = $writer; $this->sources = $sources; $this->configHash = $configHash ?: ObjectManager::getInstance()->get(Hash::class); + parent::__construct(); } /** @@ -60,6 +63,13 @@ protected function configure() { $this->setName('app:config:dump'); $this->setDescription('Create dump of application'); + + $configTypes = array_unique(array_column($this->sources, 'namespace')); + $this->addArgument( + self::INPUT_CONFIG_TYPES, + InputArgument::OPTIONAL | InputArgument::IS_ARRAY, + sprintf('Space-separated list of config types or omit to dump all [%s]', implode(', ', $configTypes)) + ); parent::configure(); } @@ -74,11 +84,14 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { $this->groupSourcesByPool(); - + $dumpedTypes = []; foreach ($this->sources as $pool => $sources) { $dump = []; $comments = []; foreach ($sources as $sourceData) { + if ($this->skipDump($input, $sourceData)) { + continue; + } /** @var ConfigSourceInterface $source */ $source = $sourceData['source']; $namespace = $sourceData['namespace']; @@ -95,15 +108,21 @@ protected function execute(InputInterface $input, OutputInterface $output) null, $comments ); + $dumpedTypes = array_unique($dumpedTypes + array_keys($dump)); if (!empty($comments)) { $output->writeln($comments); } } + if (!$dumpedTypes) { + $output->writeln('Nothing dumped. Check the config types specified and try again'); + return Cli::RETURN_FAILURE; + } + // Generate and save new hash of deployment configuration. $this->configHash->regenerate(); - $output->writeln('Done.'); + $output->writeln(sprintf('Done. Config types dumped: %s', implode(', ', $dumpedTypes))); return Cli::RETURN_SUCCESS; } @@ -127,4 +146,20 @@ private function groupSourcesByPool() $this->sources = $sources; } + + /** + * Check whether the dump source should be skipped + * + * @param InputInterface $input + * @param array $sourceData + * @return bool + */ + private function skipDump(InputInterface $input, array $sourceData): bool + { + $allowedTypes = $input->getArgument(self::INPUT_CONFIG_TYPES); + if ($allowedTypes && !in_array($sourceData['namespace'], $allowedTypes)) { + return true; + } + return false; + } } diff --git a/app/code/Magento/Deploy/Test/Unit/Console/Command/ApplicationDumpCommandTest.php b/app/code/Magento/Deploy/Test/Unit/Console/Command/ApplicationDumpCommandTest.php index 67c3796e7c6b9..85cae275932fa 100644 --- a/app/code/Magento/Deploy/Test/Unit/Console/Command/ApplicationDumpCommandTest.php +++ b/app/code/Magento/Deploy/Test/Unit/Console/Command/ApplicationDumpCommandTest.php @@ -130,7 +130,7 @@ public function testExport() ->method('writeln') ->withConsecutive( [['system' => 'Some comment message']], - ['Done.'] + ['Done. Config types dumped: system'] ); $method = new \ReflectionMethod(ApplicationDumpCommand::class, 'execute'); diff --git a/app/code/Magento/Sitemap/Model/Observer.php b/app/code/Magento/Sitemap/Model/Observer.php index 840a6a1858fae..a536ec998b827 100644 --- a/app/code/Magento/Sitemap/Model/Observer.php +++ b/app/code/Magento/Sitemap/Model/Observer.php @@ -19,6 +19,8 @@ class Observer /** * Cronjob expression configuration + * + * @deprecated Use \Magento\Cron\Model\Config\Backend\Sitemap::CRON_STRING_PATH instead. */ const XML_PATH_CRON_EXPR = 'crontab/default/jobs/generate_sitemaps/schedule/cron_expr'; diff --git a/app/code/Magento/Sitemap/etc/config.xml b/app/code/Magento/Sitemap/etc/config.xml index 73468baadcb90..6f14ff728ac4f 100644 --- a/app/code/Magento/Sitemap/etc/config.xml +++ b/app/code/Magento/Sitemap/etc/config.xml @@ -42,5 +42,16 @@ + + + + + + 0 0 * * * + + + + + diff --git a/app/code/Magento/User/Model/User.php b/app/code/Magento/User/Model/User.php index a5dd6ac2e7813..29618c981a2b9 100644 --- a/app/code/Magento/User/Model/User.php +++ b/app/code/Magento/User/Model/User.php @@ -48,6 +48,8 @@ class User extends AbstractModel implements StorageInterface, UserInterface /** @deprecated */ const XML_PATH_RESET_PASSWORD_TEMPLATE = 'admin/emails/reset_password_template'; + const MESSAGE_ID_PASSWORD_EXPIRED = 'magento_user_password_expired'; + /** * Model event prefix * diff --git a/app/code/Magento/User/Observer/Backend/AuthObserver.php b/app/code/Magento/User/Observer/Backend/AuthObserver.php index 6021302a5aeb7..06b15a477d84d 100644 --- a/app/code/Magento/User/Observer/Backend/AuthObserver.php +++ b/app/code/Magento/User/Observer/Backend/AuthObserver.php @@ -152,7 +152,7 @@ public function execute(EventObserver $observer) /** * Update locking information for the user * - * @param \Magento\User\Model\User $user + * @param User $user * @return void */ private function _updateLockingInformation($user) @@ -198,10 +198,16 @@ private function _checkExpiredPassword($latestPassword) $myAccountUrl = $this->url->getUrl('adminhtml/system_account/'); $message = __('It\'s time to change your password.', $myAccountUrl); } + + $messages = $this->messageManager->getMessages(); + + // Remove existing messages with same ID to avoid duplication + $messages->deleteMessageByIdentifier(User::MESSAGE_ID_PASSWORD_EXPIRED); + $this->messageManager->addNoticeMessage($message); - $message = $this->messageManager->getMessages()->getLastAddedMessage(); + $message = $messages->getLastAddedMessage(); if ($message) { - $message->setIdentifier('magento_user_password_expired')->setIsSticky(true); + $message->setIdentifier(User::MESSAGE_ID_PASSWORD_EXPIRED)->setIsSticky(true); $this->authSession->setPciAdminUserIsPasswordExpired(true); } } diff --git a/app/code/Magento/User/Observer/Backend/TrackAdminNewPasswordObserver.php b/app/code/Magento/User/Observer/Backend/TrackAdminNewPasswordObserver.php index 09605372df181..059879ab9613f 100644 --- a/app/code/Magento/User/Observer/Backend/TrackAdminNewPasswordObserver.php +++ b/app/code/Magento/User/Observer/Backend/TrackAdminNewPasswordObserver.php @@ -8,6 +8,7 @@ use Magento\Framework\Event\Observer as EventObserver; use Magento\Framework\Event\ObserverInterface; +use Magento\User\Model\User; /** * User backend observer model for passwords @@ -74,7 +75,7 @@ public function execute(EventObserver $observer) $passwordHash = $user->getPassword(); if ($passwordHash && !$user->getForceNewPassword()) { $this->userResource->trackPassword($user, $passwordHash); - $this->messageManager->getMessages()->deleteMessageByIdentifier('magento_user_password_expired'); + $this->messageManager->getMessages()->deleteMessageByIdentifier(User::MESSAGE_ID_PASSWORD_EXPIRED); $this->authSession->unsPciAdminUserIsPasswordExpired(); } } diff --git a/dev/tests/integration/testsuite/Magento/Deploy/Console/Command/App/ApplicationDumpCommandTest.php b/dev/tests/integration/testsuite/Magento/Deploy/Console/Command/App/ApplicationDumpCommandTest.php index cb40b110f5fc6..c4551ac49d156 100644 --- a/dev/tests/integration/testsuite/Magento/Deploy/Console/Command/App/ApplicationDumpCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Deploy/Console/Command/App/ApplicationDumpCommandTest.php @@ -176,7 +176,7 @@ public function testExecute() ->with(['system' => $comment]); $outputMock->expects($this->at(1)) ->method('writeln') - ->with('Done.'); + ->with($this->matchesRegularExpression('/Done. Config types dumped: [a-z0-9,\s]+<\/info>/')); /** @var ApplicationDumpCommand command */ $command = $this->objectManager->create(ApplicationDumpCommand::class);