Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aws
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
aws
Commits
8189f4bf
Commit
8189f4bf
authored
8 months ago
by
davisben
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3472357
: Error when Encrypt module is enabled
parent
be61670b
No related branches found
No related tags found
1 merge request
!14
Issue #3472357: Error when Encrypt module is enabled
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aws.post_update.php
+19
-0
19 additions, 0 deletions
aws.post_update.php
src/Entity/Form/ProfileForm.php
+12
-11
12 additions, 11 deletions
src/Entity/Form/ProfileForm.php
src/Entity/Profile.php
+1
-1
1 addition, 1 deletion
src/Entity/Profile.php
with
32 additions
and
12 deletions
aws.post_update.php
0 → 100644
+
19
−
0
View file @
8189f4bf
<?php
/**
* Ensure all AWS profiles have a default encryption profile set.
*/
function
aws_post_update_encryption_profile_default
()
{
/** @var \Drupal\aws\Entity\ProfileInterface[] $profiles */
$profiles
=
\Drupal
::
entityTypeManager
()
->
getStorage
(
'aws_profile'
)
->
loadMultiple
();
foreach
(
$profiles
as
$profile
)
{
if
(
!
$profile
->
getEncryptionProfile
())
{
$profile
->
setEncryptionProfile
(
'_none'
)
->
save
();
}
}
}
This diff is collapsed.
Click to expand it.
src/Entity/Form/ProfileForm.php
+
12
−
11
View file @
8189f4bf
...
...
@@ -147,23 +147,24 @@ class ProfileForm extends EntityForm {
'#default_value'
=>
$this
->
entity
->
getRegion
(),
];
if
(
$this
->
encryptionProfileManager
)
{
$options
=
[
'_none'
=>
$this
->
t
(
'- None -'
)];
$encryption_options
=
[
'_none'
=>
$this
->
t
(
'- None -'
)];
if
(
$this
->
encryptionProfileManager
)
{
$encryption_profiles
=
$this
->
encryptionProfileManager
->
getAllEncryptionProfiles
();
foreach
(
$encryption_profiles
as
$id
=>
$profile
)
{
$options
[
$id
]
=
$profile
->
label
();
$
encryption_
options
[
$id
]
=
$profile
->
label
();
}
$form
[
'encryption_profile'
]
=
[
'#type'
=>
'select'
,
'#title'
=>
$this
->
t
(
'Encryption Profile'
),
'#description'
=>
$this
->
t
(
'The encryption profile to use to encrypt the secret key.'
),
'#options'
=>
$options
,
'#default_value'
=>
$this
->
entity
->
getEncryptionProfile
(),
];
}
$form
[
'encryption_profile'
]
=
[
'#type'
=>
'select'
,
'#title'
=>
$this
->
t
(
'Encryption Profile'
),
'#description'
=>
$this
->
t
(
'The encryption profile to use to encrypt the secret key.'
),
'#options'
=>
$encryption_options
,
'#default_value'
=>
$this
->
entity
->
getEncryptionProfile
(),
'#access'
=>
$this
->
encryptionProfileManager
,
];
return
$form
;
}
...
...
This diff is collapsed.
Click to expand it.
src/Entity/Profile.php
+
1
−
1
View file @
8189f4bf
...
...
@@ -245,7 +245,7 @@ class Profile extends ConfigEntityBase implements ProfileInterface {
* {@inheritdoc}
*/
public
function
getEncryptionProfile
()
{
return
$this
->
encryption_profile
;
return
$this
->
encryption_profile
??
'_none'
;
}
/**
...
...
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