Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
symfony_mailer
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
symfony_mailer
Commits
e18a2c2a
Commit
e18a2c2a
authored
1 year ago
by
Adam Shepherd
Committed by
Adam Shepherd
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3392446
by vlad.dancer, AdamPS: Override settings may be wrong after upgrade from 1.2.x
parent
3e55c937
No related branches found
Branches containing commit
Tags
1.4.0-beta2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
symfony_mailer.install
+19
-4
19 additions, 4 deletions
symfony_mailer.install
with
19 additions
and
4 deletions
symfony_mailer.install
+
19
−
4
View file @
e18a2c2a
...
...
@@ -185,12 +185,27 @@ function symfony_mailer_update_10007() {
*/
function
symfony_mailer_update_10008
()
{
$key_value
=
\Drupal
::
keyValue
(
'mailer'
);
$settings
=
[];
foreach
(
$key_value
->
get
(
'import'
,
[])
as
$id
=>
$state
)
{
// Map IMPORT_COMPLETE (1) to STATE_IMPORTED (1) and everything else to
// STATE_ENABLED (2).
$settings
[
$id
]
=
(
$state
==
1
)
?
1
:
2
;
}
// Entries will be missing from the list if they were ignored (never imported
// or skipped). We can't know if other modules provided them, but that's
// probably unlikely. We can know for the overrides in symfony_mailer_bc.
if
(
\Drupal
::
service
(
'module_handler'
)
->
moduleExists
(
'symfony_mailer_bc'
))
{
$previously_available
=
[
'contact'
,
'contact_form'
,
'simplenews_newsletter'
,
'simplenews'
,
'update'
,
'user'
,
'user_registrationpassword'
];
$current_overrides
=
array_keys
(
\Drupal
::
service
(
'symfony_mailer.override_manager'
)
->
getInfo
());
foreach
(
array_intersect
(
$previously_available
,
$current_overrides
)
as
$id
)
{
// Was enabled.
if
(
!
array_key_exists
(
$id
,
$settings
))
{
$settings
[
$id
]
=
2
;
}
}
}
if
(
isset
(
$settings
))
{
\Drupal
::
configFactory
()
->
getEditable
(
'symfony_mailer.settings'
)
->
set
(
'override'
,
$settings
)
...
...
@@ -203,9 +218,9 @@ function symfony_mailer_update_10008() {
* Disable the obsolete module symfony_mailer_bc.
*/
function
symfony_mailer_update_10009
()
{
$
service_
module_installer
=
\Drupal
::
service
(
'module_installer'
);
$
service_
module_handler
=
\Drupal
::
service
(
'module_handler'
);
if
(
$
service_
module_handler
->
moduleExists
(
'symfony_mailer_bc'
))
{
$
service_
module_installer
->
uninstall
([
'symfony_mailer_bc'
],
FALSE
);
$module_installer
=
\Drupal
::
service
(
'module_installer'
);
$module_handler
=
\Drupal
::
service
(
'module_handler'
);
if
(
$module_handler
->
moduleExists
(
'symfony_mailer_bc'
))
{
$module_installer
->
uninstall
([
'symfony_mailer_bc'
],
FALSE
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment