Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal_cms
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
drupal_cms
Commits
02e52fc9
Commit
02e52fc9
authored
6 months ago
by
Adam G-H
Browse files
Options
Downloads
Patches
Plain Diff
Fix password bug
parent
78ca82f5
No related branches found
No related tags found
1 merge request
!262
Use key-value to store the password temporarily
Pipeline
#358384
failed
6 months ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
project_template/web/profiles/drupal_cms_installer/drupal_cms_installer.profile
+15
-2
15 additions, 2 deletions
...rofiles/drupal_cms_installer/drupal_cms_installer.profile
with
15 additions
and
2 deletions
project_template/web/profiles/drupal_cms_installer/drupal_cms_installer.profile
+
15
−
2
View file @
02e52fc9
...
...
@@ -4,11 +4,12 @@ declare(strict_types=1);
use
Composer\InstalledVersions
;
use
Drupal\Core\DependencyInjection\ContainerBuilder
;
use
Drupal\Core\Render\Element\Password
;
use
Drupal\Core\Extension\ModuleInstallerInterface
;
use
Drupal\Core\File\FileUrlGeneratorInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Messenger\MessengerInterface
;
use
Drupal\Core\Recipe\RecipeRunner
;
use
Drupal\drupal_cms_installer
\Form\AccountForm
;
use
Drupal\drupal_cms_installer
\Form\RecipesForm
;
use
Drupal\drupal_cms_installer
\Form\SiteNameForm
;
use
Drupal\drupal_cms_installer
\MessageInterceptor
;
...
...
@@ -133,7 +134,9 @@ function drupal_cms_installer_form_install_settings_form_alter(array &$form): vo
*
* @see \Drupal\Core\Installer\Form\SiteConfigureForm
*/
function
drupal_cms_installer_form_install_configure_form_alter
(
array
&
$form
):
void
{
function
drupal_cms_installer_form_install_configure_form_alter
(
array
&
$form
,
FormStateInterface
$form_state
):
void
{
global
$install_state
;
$form
[
'#title'
]
=
t
(
'Create your account'
);
$form
[
'step'
]
=
[
'#prefix'
=>
'<p class="cms-installer__step">'
,
...
...
@@ -184,6 +187,7 @@ function drupal_cms_installer_form_install_configure_form_alter(array &$form): v
'#required'
=>
TRUE
,
'#default_value'
=>
$install_state
[
'forms'
][
'install_configure_form'
][
'account'
][
'pass'
][
'pass1'
]
??
''
,
'#weight'
=>
20
,
'#value_callback'
=>
'_drupal_cms_installer_password_value'
,
];
// Hide parts of the form we don't care about.
...
...
@@ -193,6 +197,15 @@ function drupal_cms_installer_form_install_configure_form_alter(array &$form): v
$form
[
'actions'
][
'submit'
][
'#value'
]
=
t
(
'Finish'
);
}
function
_drupal_cms_installer_password_value
(
&
$element
,
$input
,
FormStateInterface
$form_state
)
:
mixed
{
// Work around this fact that Drush and `drupal install`, which submit this
// form programmatically, assume the password is a password_confirm element.
if
(
is_array
(
$input
)
&&
$form_state
->
isProgrammed
())
{
$input
=
$input
[
'pass1'
];
}
return
Password
::
valueCallback
(
$element
,
$input
,
$form_state
);
}
/**
* Runs a batch job that applies the template and add-on recipes.
*
...
...
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