From b029b3516355a2c032d7c2ce315e092bec69e220 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 28 Mar 2020 07:35:42 +0100 Subject: [PATCH 01/19] update dependencies :balloon: (#4185) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- composer.lock | 56 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/composer.lock b/composer.lock index 3a0a741f30..9e64772cd4 100644 --- a/composer.lock +++ b/composer.lock @@ -5961,16 +5961,16 @@ }, { "name": "symfony/symfony", - "version": "v5.0.5", + "version": "v5.0.6", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "28a7546601e16bb40384c8f4c8fcbdda6b5ee24a" + "reference": "358bbaec07b61f4413f6fe6147b7e460a8fe682e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/28a7546601e16bb40384c8f4c8fcbdda6b5ee24a", - "reference": "28a7546601e16bb40384c8f4c8fcbdda6b5ee24a", + "url": "https://api.github.com/repos/symfony/symfony/zipball/358bbaec07b61f4413f6fe6147b7e460a8fe682e", + "reference": "358bbaec07b61f4413f6fe6147b7e460a8fe682e", "shasum": "" }, "require": { @@ -6132,7 +6132,21 @@ "keywords": [ "framework" ], - "time": "2020-02-29T10:41:46+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-03-27T16:20:34+00:00" }, { "name": "thomaspark/bootswatch", @@ -7226,12 +7240,12 @@ "source": { "type": "git", "url": "https://github.com/zikula/Wizard.git", - "reference": "d9e4e4e463d728437c3d203853ed9d9bedb762bf" + "reference": "d93e647cf05b0c3d28723f65e2349ebecf486f9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zikula/Wizard/zipball/d9e4e4e463d728437c3d203853ed9d9bedb762bf", - "reference": "d9e4e4e463d728437c3d203853ed9d9bedb762bf", + "url": "https://api.github.com/repos/zikula/Wizard/zipball/d93e647cf05b0c3d28723f65e2349ebecf486f9d", + "reference": "d93e647cf05b0c3d28723f65e2349ebecf486f9d", "shasum": "" }, "require": { @@ -7263,22 +7277,22 @@ "step", "wizard" ], - "time": "2020-03-27T06:15:39+00:00" + "time": "2020-03-27T12:07:57+00:00" } ], "packages-dev": [ { "name": "symfony/phpunit-bridge", - "version": "v5.0.5", + "version": "v5.0.6", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "b8fee53045a55ccbb9209e453bf6fdcf74381959" + "reference": "cb3f0f5bf8776bccaf8d61e4c91a573db58a19b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/b8fee53045a55ccbb9209e453bf6fdcf74381959", - "reference": "b8fee53045a55ccbb9209e453bf6fdcf74381959", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/cb3f0f5bf8776bccaf8d61e4c91a573db58a19b6", + "reference": "cb3f0f5bf8776bccaf8d61e4c91a573db58a19b6", "shasum": "" }, "require": { @@ -7330,7 +7344,21 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2020-02-24T15:05:31+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-03-15T14:33:06+00:00" } ], "aliases": [], From a5d80d69353d3670a9b37c18620c49bb5e74b86f Mon Sep 17 00:00:00 2001 From: Guite Date: Sat, 28 Mar 2020 07:38:52 +0100 Subject: [PATCH 02/19] vendor update --- CHANGELOG-3.0.md | 4 +- composer.lock | 193 ++--------------------------------------------- 2 files changed, 7 insertions(+), 190 deletions(-) diff --git a/CHANGELOG-3.0.md b/CHANGELOG-3.0.md index 234318a7c1..df278f0220 100644 --- a/CHANGELOG-3.0.md +++ b/CHANGELOG-3.0.md @@ -286,7 +286,7 @@ - symfony/contracts installed in 2.0.1 - symfony/maker-bundle installed in 1.14.6 - symfony/monolog-bundle updated from 3.2.0 to 3.5.0 - - symfony/phpunit-bridge updated from 3.4.14 to 5.0.5 + - symfony/phpunit-bridge updated from 3.4.14 to 5.0.6 - symfony/polyfill-ctype updated from 1.12.0 to 1.15.0 - symfony/polyfill-iconv installed in 1.15.0 - symfony/polyfill-intl-grapheme installed in 1.15.0 @@ -299,7 +299,7 @@ - symfony/polyfill-php73 installed in 1.15.0 - symfony/profiler-pack installed in 1.0.4 - symfony/swiftmailer-bundle updated from 2.4.3 to 3.4.0 - - symfony/symfony updated from 3.4.35 to 5.0.5 + - symfony/symfony updated from 3.4.35 to 5.0.6 - thomaspark/bootswatch installed in 4.4.1 - tijsverkoyen/css-to-inline-styles installed in 2.2.2 - twig/extra-bundle installed in 3.0.3 diff --git a/composer.lock b/composer.lock index 9e64772cd4..6285df7a67 100644 --- a/composer.lock +++ b/composer.lock @@ -2957,20 +2957,6 @@ "md", "parser" ], - "funding": [ - { - "url": "https://github.com/colinodell", - "type": "github" - }, - { - "url": "https://www.patreon.com/colinodell", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league%2fcommonmark", - "type": "tidelift" - } - ], "time": "2020-03-25T19:55:28+00:00" }, { @@ -5139,20 +5125,6 @@ "polyfill", "portable" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-02-27T09:26:54+00:00" }, { @@ -5212,20 +5184,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-09T19:04:49+00:00" }, { @@ -5286,20 +5244,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-09T19:04:49+00:00" }, { @@ -5358,20 +5302,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-02-27T09:26:54+00:00" }, { @@ -5434,20 +5364,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-09T19:04:49+00:00" }, { @@ -5511,20 +5427,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-02-27T09:26:54+00:00" }, { @@ -5588,20 +5490,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-02-27T09:26:54+00:00" }, { @@ -5661,20 +5549,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-09T19:04:49+00:00" }, { @@ -5730,20 +5604,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-02-27T09:26:54+00:00" }, { @@ -5802,20 +5662,6 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-02-27T09:26:54+00:00" }, { @@ -6132,20 +5978,6 @@ "keywords": [ "framework" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-27T16:20:34+00:00" }, { @@ -7240,12 +7072,12 @@ "source": { "type": "git", "url": "https://github.com/zikula/Wizard.git", - "reference": "d93e647cf05b0c3d28723f65e2349ebecf486f9d" + "reference": "a3157fac078858227d8b7549279a6cbf209ac013" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zikula/Wizard/zipball/d93e647cf05b0c3d28723f65e2349ebecf486f9d", - "reference": "d93e647cf05b0c3d28723f65e2349ebecf486f9d", + "url": "https://api.github.com/repos/zikula/Wizard/zipball/a3157fac078858227d8b7549279a6cbf209ac013", + "reference": "a3157fac078858227d8b7549279a6cbf209ac013", "shasum": "" }, "require": { @@ -7277,7 +7109,7 @@ "step", "wizard" ], - "time": "2020-03-27T12:07:57+00:00" + "time": "2020-03-28T06:34:25+00:00" } ], "packages-dev": [ @@ -7344,20 +7176,6 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-15T14:33:06+00:00" } ], @@ -7404,6 +7222,5 @@ "platform-dev": [], "platform-overrides": { "php": "7.2.5" - }, - "plugin-api-version": "1.1.0" + } } From 6b665c0019ce699952d543acebc3591caac769f9 Mon Sep 17 00:00:00 2001 From: Craig Heydenburg Date: Fri, 27 Mar 2020 09:25:22 -0400 Subject: [PATCH 03/19] add a tiny space to topnav menu --- .../BootstrapTheme/Resources/views/Include/topNav.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/BootstrapTheme/Resources/views/Include/topNav.html.twig b/src/system/BootstrapTheme/Resources/views/Include/topNav.html.twig index cf45ab7d03..65f40cbe80 100644 --- a/src/system/BootstrapTheme/Resources/views/Include/topNav.html.twig +++ b/src/system/BootstrapTheme/Resources/views/Include/topNav.html.twig @@ -8,7 +8,7 @@ From b5bf91b0435335d5bd99934bba8ea4814e6c9daa Mon Sep 17 00:00:00 2001 From: Craig Heydenburg Date: Sun, 29 Mar 2020 11:09:36 -0400 Subject: [PATCH 13/19] ci --- src/system/MailerModule/Controller/ConfigController.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/system/MailerModule/Controller/ConfigController.php b/src/system/MailerModule/Controller/ConfigController.php index 492c04b891..32f63d9b8f 100644 --- a/src/system/MailerModule/Controller/ConfigController.php +++ b/src/system/MailerModule/Controller/ConfigController.php @@ -14,7 +14,6 @@ namespace Zikula\MailerModule\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Symfony\Component\Filesystem\Exception\IOExceptionInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Mailer\Exception\TransportExceptionInterface; use Symfony\Component\Mailer\MailerInterface; @@ -22,8 +21,6 @@ use Symfony\Component\Mime\Email; use Symfony\Component\Routing\Annotation\Route; use Zikula\Bundle\CoreBundle\Controller\AbstractController; -use Zikula\Bundle\CoreBundle\Helper\LocalDotEnvHelper; -use Zikula\Bundle\CoreBundle\HttpKernel\ZikulaHttpKernelInterface; use Zikula\ExtensionsModule\Api\ApiInterface\VariableApiInterface; use Zikula\MailerModule\Form\Type\MailTransportConfigType; use Zikula\MailerModule\Form\Type\TestType; From 128a7564bd74d27443a59f707cf729f80a449775 Mon Sep 17 00:00:00 2001 From: Craig Heydenburg Date: Sun, 29 Mar 2020 11:41:19 -0400 Subject: [PATCH 14/19] more improvements --- .../Resources/views/Install/mailer.html.twig | 4 ++++ .../Resources/views/installHeader.html.twig | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Zikula/CoreInstallerBundle/Resources/views/Install/mailer.html.twig b/src/Zikula/CoreInstallerBundle/Resources/views/Install/mailer.html.twig index d6aa80547e..4b91beedfd 100644 --- a/src/Zikula/CoreInstallerBundle/Resources/views/Install/mailer.html.twig +++ b/src/Zikula/CoreInstallerBundle/Resources/views/Install/mailer.html.twig @@ -1,4 +1,8 @@ {% extends '@ZikulaCoreInstaller/theme.html.twig' %} +{% block childjavascripts %} + +{% endblock %} + {% block title 'Zikula Core Installer :: Enter mailer transport information' %} {% block content %} diff --git a/src/Zikula/CoreInstallerBundle/Resources/views/installHeader.html.twig b/src/Zikula/CoreInstallerBundle/Resources/views/installHeader.html.twig index a48b6cd69b..0c13cbae9b 100644 --- a/src/Zikula/CoreInstallerBundle/Resources/views/installHeader.html.twig +++ b/src/Zikula/CoreInstallerBundle/Resources/views/installHeader.html.twig @@ -3,7 +3,7 @@

{% trans %}Installer script{% endtrans %}

    - {% trans %}Language{% endtrans %} + {% trans %}Language{% endtrans %} {% trans %}Requirements{% endtrans %} @@ -17,6 +17,9 @@ {% trans %}Create admin{% endtrans %} + + {% trans %}Install{% endtrans %} +

{% set doc_link = '%text%'|replace({'%url%': 'https://docs.ziku.la/Setup/installation.html', '%text%': 'installation guide'|trans }) %} From 51d7a595e83a438c10ae4b6f994120b452b5d8fa Mon Sep 17 00:00:00 2001 From: Craig Heydenburg Date: Sun, 29 Mar 2020 12:01:26 -0400 Subject: [PATCH 15/19] add settings to command --- .../Command/AbstractCoreInstallerCommand.php | 31 ++++++++++++++++++- .../Helper/MailTransportHelper.php | 12 ++++--- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/Zikula/CoreInstallerBundle/Command/AbstractCoreInstallerCommand.php b/src/Zikula/CoreInstallerBundle/Command/AbstractCoreInstallerCommand.php index bceb2079ec..ff49db7e6b 100644 --- a/src/Zikula/CoreInstallerBundle/Command/AbstractCoreInstallerCommand.php +++ b/src/Zikula/CoreInstallerBundle/Command/AbstractCoreInstallerCommand.php @@ -91,7 +91,36 @@ abstract class AbstractCoreInstallerCommand extends Command 'locale' => [ 'description' => 'The locale to use.', 'default' => 'en' - ] + ], + /* mailer settings */ + 'transport' => [ + 'description' => 'The mailer transport to use.', + 'default' => 'test' + ], + 'mailer_id' => [ + 'description' => 'The ACCESS_KEY, USERNAME, ID or apikey for the selected transport.', + 'default' => null + ], + 'mailer_key' => [ + 'description' => 'The SECRET_KEY, PASSWORD, ID or KEY for the selected transport.', + 'default' => null + ], + 'host' => [ + 'description' => 'SMTP host server', + 'default' => null + ], + 'port' => [ + 'description' => 'SMTP port', + 'default' => null + ], + 'customParameters' => [ + 'description' => 'Use query parameters syntax, for example: ?param1=value1&param2=value2.', + 'default' => null + ], + 'enableLogging' => [ + 'description' => 'Enable logging of sent mail.', + 'default' => false + ], ]; public function __construct( diff --git a/src/system/MailerModule/Helper/MailTransportHelper.php b/src/system/MailerModule/Helper/MailTransportHelper.php index 3e23fb94ad..70bf29d50c 100644 --- a/src/system/MailerModule/Helper/MailTransportHelper.php +++ b/src/system/MailerModule/Helper/MailTransportHelper.php @@ -52,11 +52,13 @@ public function handleFormData($formData): bool if (!empty($formData['customParameters'])) { $dsn .= $formData['customParameters']; } - $vars = [ - 'MAILER_ID' => $formData['mailer_id'], - 'MAILER_KEY' => $formData['mailer_key'], - 'MAILER_DSN' => '!' . $dsn - ]; + $vars = ['MAILER_DSN' => '!' . $dsn]; + if (!empty($formData['mailer_id'])) { + $vars['MAILER_ID'] = $formData['mailer_id']; + } + if (!empty($formData['mailer_key'])) { + $vars['MAILER_KEY'] = $formData['mailer_key']; + } $helper = new LocalDotEnvHelper($this->projectDir); $helper->writeLocalEnvVars($vars); From bb0863710dcb7b2caba81ca780882b1c72a5f9f4 Mon Sep 17 00:00:00 2001 From: Craig Heydenburg Date: Sun, 29 Mar 2020 12:23:41 -0400 Subject: [PATCH 16/19] improve start command --- .../Command/Install/StartCommand.php | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/Zikula/CoreInstallerBundle/Command/Install/StartCommand.php b/src/Zikula/CoreInstallerBundle/Command/Install/StartCommand.php index 51519c8284..7bf115a06a 100644 --- a/src/Zikula/CoreInstallerBundle/Command/Install/StartCommand.php +++ b/src/Zikula/CoreInstallerBundle/Command/Install/StartCommand.php @@ -16,6 +16,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\StyleInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Filesystem\Exception\IOExceptionInterface; use Symfony\Contracts\Translation\TranslatorInterface; @@ -119,15 +120,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int } // get the settings from user input - $settings = $this->doLocale($input, $output); - $settings = array_merge($settings, $this->doRequestContext($input, $output)); - if (!$this->doDBCreds($input, $output)) { - $io->error(sprintf('Cannot write database DSN to %s file.', '/.env.local')); + $settings = $this->doLocale($input, $output, $io); + $settings = array_merge($settings, $this->doRequestContext($input, $output, $io)); + if (!$this->doDBCreds($input, $output, $io)) { + $io->error($this->translator->trans('Cannot write database DSN to %file% file.', ['%file%' => '/.env.local'])); } - if (!$this->doMailer($input, $output)) { - $io->error(sprintf('Cannot write mailer DSN to %s file.', '/.env.local')); + if (!$this->doMailer($input, $output, $io)) { + $io->error($this->translator->trans('Cannot write mailer DSN to %file% file.', ['%file%' => '/.env.local'])); } - $settings = array_merge($settings, $this->doAdmin($input, $output)); + $settings = array_merge($settings, $this->doAdmin($input, $output, $io)); if ($input->isInteractive()) { $io->success($this->translator->trans('Configuration successful. Please verify your parameters below:')); @@ -155,16 +156,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - private function doLocale(InputInterface $input, OutputInterface $output): array + private function doLocale(InputInterface $input, OutputInterface $output, StyleInterface $io): array { + $io->newLine(); + $io->section($this->translator->trans('Locale')); + return $this->getHelper('form')->interactUsingForm(LocaleType::class, $input, $output, [ 'choices' => $this->localeApi->getSupportedLocaleNames(), 'choice_loader' => null ]); } - private function doRequestContext(InputInterface $input, OutputInterface $output): array + private function doRequestContext(InputInterface $input, OutputInterface $output, StyleInterface $io): array { + $io->newLine(); + $io->section($this->translator->trans('Request context')); $data = $this->getHelper('form')->interactUsingForm(RequestContextType::class, $input, $output); foreach ($data as $k => $v) { $newKey = str_replace(':', '.', $k); @@ -175,8 +181,11 @@ private function doRequestContext(InputInterface $input, OutputInterface $output return $data; } - private function doDBCreds(InputInterface $input, OutputInterface $output): bool + private function doDBCreds(InputInterface $input, OutputInterface $output, StyleInterface $io): bool { + $io->newLine(); + $io->section($this->translator->trans('Database information')); + $io->note($this->translator->trans('The database port can be left empty.')); $data = $this->getHelper('form')->interactUsingForm(DbCredsType::class, $input, $output); $dbCredsHelper = new DbCredsHelper(); $databaseUrl = $dbCredsHelper->buildDatabaseUrl($data); @@ -191,15 +200,20 @@ private function doDBCreds(InputInterface $input, OutputInterface $output): bool } } - private function doMailer(InputInterface $input, OutputInterface $output): bool + private function doMailer(InputInterface $input, OutputInterface $output, StyleInterface $io): bool { + $io->newLine(); + $io->section($this->translator->trans('Mailer transport')); + $io->note($this->translator->trans('Empty values are allowed for all except Mailer transport.')); $data = $this->getHelper('form')->interactUsingForm(MailTransportConfigType::class, $input, $output); return (new MailTransportHelper($this->kernel->getProjectDir()))->handleFormData($data); } - private function doAdmin(InputInterface $input, OutputInterface $output): array + private function doAdmin(InputInterface $input, OutputInterface $output, StyleInterface $io): array { + $io->newLine(); + $io->section($this->translator->trans('Create admin account')); $data = $this->getHelper('form')->interactUsingForm(CreateAdminType::class, $input, $output); foreach ($data as $k => $v) { $data[$k] = base64_encode($v); // encode so values are 'safe' for json From a5b1d9bd4343da773dee3fa2d2713219d27fc0ff Mon Sep 17 00:00:00 2001 From: Craig Heydenburg Date: Sun, 29 Mar 2020 12:28:31 -0400 Subject: [PATCH 17/19] trim mailermodule installer --- .../MailerModule/MailerModuleInstaller.php | 32 +++---------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/src/system/MailerModule/MailerModuleInstaller.php b/src/system/MailerModule/MailerModuleInstaller.php index 7a43674d70..bd5150c948 100644 --- a/src/system/MailerModule/MailerModuleInstaller.php +++ b/src/system/MailerModule/MailerModuleInstaller.php @@ -18,10 +18,8 @@ use Symfony\Contracts\Translation\TranslatorInterface; use Zikula\Bundle\CoreBundle\Doctrine\Helper\SchemaHelper; use Zikula\Bundle\CoreBundle\DynamicConfigDumper; -use Zikula\Bundle\CoreBundle\HttpKernel\ZikulaHttpKernelInterface; use Zikula\ExtensionsModule\AbstractExtension; use Zikula\ExtensionsModule\Api\ApiInterface\VariableApiInterface; -use Zikula\ExtensionsModule\Entity\ExtensionVarEntity; use Zikula\ExtensionsModule\Installer\AbstractExtensionInstaller; /** @@ -29,18 +27,12 @@ */ class MailerModuleInstaller extends AbstractExtensionInstaller { - /** - * @var ZikulaHttpKernelInterface - */ - private $kernel; - /** * @var DynamicConfigDumper */ private $configDumper; public function __construct( - ZikulaHttpKernelInterface $kernel, DynamicConfigDumper $configDumper, AbstractExtension $extension, ManagerRegistry $managerRegistry, @@ -49,7 +41,6 @@ public function __construct( TranslatorInterface $translator, VariableApiInterface $variableApi ) { - $this->kernel = $kernel; $this->configDumper = $configDumper; parent::__construct($extension, $managerRegistry, $schemaTool, $requestStack, $translator, $variableApi); } @@ -67,31 +58,20 @@ public function upgrade(string $oldVersion): bool // Upgrade dependent on old version number switch ($oldVersion) { case '1.3.1': - $this->setVar('smtpsecuremethod', 'ssl'); case '1.3.2': - // clear old modvars - // use manual method because getVars() is not available during system upgrade - $modVarEntities = $this->managerRegistry->getRepository(ExtensionVarEntity::class)->findBy(['modname' => $this->name]); - $modVars = []; - foreach ($modVarEntities as $var) { - $modVars[$var['name']] = $var['value']; - } - $this->delVars(); - $this->setVarWithDefault('charset', $modVars['charset']); - $this->setVarWithDefault('encoding', $modVars['encoding']); - $this->setVarWithDefault('html', $modVars['html']); - $this->setVarWithDefault('wordwrap', $modVars['wordwrap']); // new modvar for 1.4.0 $this->setVarWithDefault('enableLogging', false); - case '1.4.0': case '1.4.1': case '1.4.2': case '1.4.3': case '1.5.0': case '1.5.1': - // all swiftmailer config changes removed from previous version upgrades above + // all swiftmailer config changes and module-vars removed from previous version upgrades above $this->configDumper->delConfiguration('swiftmailer'); + $enableLogging = $this->getVar('enableLogging'); + $this->delVars(); + $this->setVar('enableLogging', $enableLogging); // future upgrade routines } @@ -114,10 +94,6 @@ public function uninstall(): bool private function getDefaults(): array { return [ - 'charset' => $this->kernel->getCharset(), - 'encoding' => '8bit', - 'html' => false, - 'wordwrap' => 50, 'enableLogging' => false ]; } From d3362f8c0dbcb6b3d479f8d257ebbaebec37134b Mon Sep 17 00:00:00 2001 From: Craig Heydenburg Date: Sun, 29 Mar 2020 12:31:07 -0400 Subject: [PATCH 18/19] do not persist most of mailer data --- src/system/MailerModule/Controller/ConfigController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/MailerModule/Controller/ConfigController.php b/src/system/MailerModule/Controller/ConfigController.php index 32f63d9b8f..4dd6cb1ebe 100644 --- a/src/system/MailerModule/Controller/ConfigController.php +++ b/src/system/MailerModule/Controller/ConfigController.php @@ -53,7 +53,7 @@ public function configAction( if ($form->isSubmitted() && $form->isValid()) { if ($form->get('save')->isClicked()) { $formData = $form->getData(); - $this->setVars($formData); + $this->setVar('enableLogging', $formData['enableLogging']); if (true === $mailTransportHelper->handleFormData($formData)) { $this->addFlash('status', 'Done! Configuration updated.'); } else { From 2ce359e969c88fa7ddc498ae86bc6b1a39353e8a Mon Sep 17 00:00:00 2001 From: Craig Heydenburg Date: Sun, 29 Mar 2020 13:46:52 -0400 Subject: [PATCH 19/19] remove copy/paste leftovers. --- .../Resources/views/Install/mailer.html.twig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Zikula/CoreInstallerBundle/Resources/views/Install/mailer.html.twig b/src/Zikula/CoreInstallerBundle/Resources/views/Install/mailer.html.twig index 4b91beedfd..80aedec59b 100644 --- a/src/Zikula/CoreInstallerBundle/Resources/views/Install/mailer.html.twig +++ b/src/Zikula/CoreInstallerBundle/Resources/views/Install/mailer.html.twig @@ -91,10 +91,6 @@ {% endblock %}