fixed ajax register modal form

This commit is contained in:
2022-02-22 09:46:45 +01:00
parent bd594ac9f0
commit 618893dda2
8 changed files with 69 additions and 77 deletions

View File

@@ -55,9 +55,12 @@ function materio_user_form_user_modal_form_alter(&$form, FormStateInterface $for
"title" => $form['account']['mail']['#description']
);
// https://drupal.stackexchange.com/a/217112
// ? https://drupal.stackexchange.com/a/217112
// Get default process function array:
$element_info = element_info('password_confirm');
// $element_info = element_info('password_confirm');
// ? https://api.drupal.org/api/drupal/core%21includes%21common.inc/function/element_info/8.2.x
$element_info = \Drupal::service('element_info')->getInfo('password_confirm');
$process = $element_info['#process'];
// Add our process function to the array:
$process[] = '_materio_user_process_password_confirm';
@@ -81,7 +84,6 @@ function materio_user_form_user_modal_form_alter(&$form, FormStateInterface $for
}
function _materio_user_process_password_confirm($element){
// ksm($element);
$element['pass1']['#description'] = t('Password must contains height lowercase, uppercase, digits and special characters.');
$element['pass1']['#attributes'] += array(
"v-model" => "pass1",

View File

@@ -38,7 +38,7 @@ export default {
// vuejs attributes a inserted by form alter in same module
MA.get(`/materio_user/register_form`)
.then(({data}) => {
// console.log("getRegisterForm data", data)
// console.log("getRegisterForm data", data.rendered)
this.form = Vue.compile(data.rendered)
this.$options.staticRenderFns = [];
this._staticTrees = [];