浏览代码

fixed ajax register modal form

bach 2 年之前
父节点
当前提交
618893dda2

+ 0 - 8
config/devel/config_split.patch.user.role.anonymous.yml

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

+ 0 - 8
config/devel/config_split.patch.user.role.authenticated.yml

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

+ 3 - 7
config/sync/core.entity_form_display.user.user.modal.yml

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

+ 15 - 5
config/sync/core.entity_form_display.user.user.register.yml

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

+ 19 - 19
config/sync/user.role.anonymous.yml

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

+ 26 - 26
config/sync/user.role.authenticated.yml

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

+ 5 - 3
web/modules/custom/materio_user/materio_user.module

@@ -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",

+ 1 - 1
web/themes/custom/materiotheme/vuejs/components/Form/RegisterForm.vue

@@ -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 = [];