fixed ajax register modal form

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

View File

@ -1,8 +0,0 @@
adding:
dependencies:
module:
- webprofiler
permissions:
3: 'access webprofiler'
20: 'view webprofiler toolbar'
removing: { }

View File

@ -1,8 +0,0 @@
adding:
dependencies:
module:
- webprofiler
permissions:
3: 'access webprofiler'
27: 'view webprofiler toolbar'
removing: { }

View File

@ -10,7 +10,6 @@ dependencies:
- field.field.user.user.field_memo - field.field.user.user.field_memo
- field.field.user.user.field_showroom - field.field.user.user.field_showroom
module: module:
- path
- user - user
id: user.user.modal id: user.user.modal
targetEntityType: user targetEntityType: user
@ -22,12 +21,6 @@ content:
region: content region: content
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
path:
type: path
weight: 7
region: content
settings: { }
third_party_settings: { }
hidden: hidden:
commerce_remote_id: true commerce_remote_id: true
contact: true contact: true
@ -37,8 +30,11 @@ hidden:
field_member_type: true field_member_type: true
field_memo: true field_memo: true
field_showroom: true field_showroom: true
google_analytics: true
langcode: true langcode: true
language: true language: true
matomo: true matomo: true
member_profiles: true member_profiles: true
path: true
simplenews: true simplenews: true
timezone: true

View File

@ -34,7 +34,7 @@ content:
third_party_settings: { } third_party_settings: { }
field_member_type: field_member_type:
type: options_select type: options_select
weight: 4 weight: 5
region: content region: content
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
@ -56,24 +56,34 @@ content:
size: 60 size: 60
placeholder: '' placeholder: ''
third_party_settings: { } third_party_settings: { }
google_analytics:
weight: 4
region: content
settings: { }
third_party_settings: { }
language: language:
weight: 6 weight: 7
region: content region: content
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
matomo: matomo:
weight: 7 weight: 10
region: content region: content
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
path: path:
type: path type: path
weight: 7 weight: 9
region: content region: content
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
simplenews: simplenews:
weight: 5 weight: 6
region: content
settings: { }
third_party_settings: { }
timezone:
weight: 8
region: content region: content
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }

View File

@ -25,22 +25,22 @@ label: 'Anonymous user'
weight: -9 weight: -9
is_admin: false is_admin: false
permissions: permissions:
0: 'access checkout' - 'access checkout'
1: 'access content' - 'access content'
2: 'access synonyms entity autocomplete' - 'access synonyms entity autocomplete'
4: 'create migration workflow_transition' - 'create migration workflow_transition'
5: 'create workflow workflow_transition' - 'create workflow workflow_transition'
6: 'display eu cookie compliance popup' - 'display eu cookie compliance popup'
7: 'execute materio arbitrary graphql requests' - 'execute materio arbitrary graphql requests'
8: 'execute materio persisted graphql requests' - 'execute materio persisted graphql requests'
9: 'restful post user_registration' - 'restful post user_registration'
10: 'subscribe to newsletters' - 'subscribe to newsletters'
11: 'use text format wysiwyg' - 'use text format wysiwyg'
12: 'view body' - 'view body'
13: 'view commerce_product' - 'view commerce_product'
14: 'view field_materiau_images' - 'view field_materiau_images'
15: 'view field_short_description' - 'view field_short_description'
16: 'view field_showroom_files' - 'view field_showroom_files'
17: 'view materio_product_type commerce_product' - 'view materio_product_type commerce_product'
18: 'view privacy_policy config page entity' - 'view privacy_policy config page entity'
19: 'view terms_of_services config page entity' - 'view terms_of_services config page entity'

View File

@ -31,29 +31,29 @@ label: 'Authenticated user'
weight: -8 weight: -8
is_admin: false is_admin: false
permissions: permissions:
0: 'access checkout' - 'access checkout'
1: 'access content' - 'access content'
2: 'access synonyms entity autocomplete' - 'access synonyms entity autocomplete'
4: 'create workflow workflow_transition' - 'create workflow workflow_transition'
5: 'display eu cookie compliance popup' - 'display eu cookie compliance popup'
6: 'execute materio arbitrary graphql requests' - 'execute materio arbitrary graphql requests'
7: 'execute materio persisted graphql requests' - 'execute materio persisted graphql requests'
8: 'manage own commerce_payment_method' - 'manage own commerce_payment_method'
9: 'materio_jsonapi ownroles' - 'materio_jsonapi ownroles'
10: 'opt-in or out of google analytics tracking' - 'opt-in or out of google analytics tracking'
11: 'opt-in or out of matomo tracking' - 'opt-in or out of matomo tracking'
12: 'restful post user_registration' - 'restful post user_registration'
13: 'subscribe to newsletters' - 'subscribe to newsletters'
14: 'update own customer profile' - 'update own customer profile'
15: 'use text format wysiwyg' - 'use text format wysiwyg'
16: 'view body' - 'view body'
17: 'view commerce_product' - 'view commerce_product'
18: 'view field_materiau_images' - 'view field_materiau_images'
19: 'view field_short_description' - 'view field_short_description'
20: 'view field_showroom_files' - 'view field_showroom_files'
21: 'view materio_product_type commerce_product' - 'view materio_product_type commerce_product'
22: 'view own commerce_order' - 'view own commerce_order'
23: 'view own customer profile' - 'view own customer profile'
24: 'view own profile' - 'view own profile'
25: 'view privacy_policy config page entity' - 'view privacy_policy config page entity'
26: 'view terms_of_services config page entity' - 'view terms_of_services config page entity'

View File

@ -55,9 +55,12 @@ function materio_user_form_user_modal_form_alter(&$form, FormStateInterface $for
"title" => $form['account']['mail']['#description'] "title" => $form['account']['mail']['#description']
); );
// https://drupal.stackexchange.com/a/217112 // ? https://drupal.stackexchange.com/a/217112
// Get default process function array: // 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']; $process = $element_info['#process'];
// Add our process function to the array: // Add our process function to the array:
$process[] = '_materio_user_process_password_confirm'; $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){ 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']['#description'] = t('Password must contains height lowercase, uppercase, digits and special characters.');
$element['pass1']['#attributes'] += array( $element['pass1']['#attributes'] += array(
"v-model" => "pass1", "v-model" => "pass1",

View File

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