From b99485c352a152dbbe8306ee11dc1eca93acd035 Mon Sep 17 00:00:00 2001
From: M Miller <miller.2676@osu.edu>
Date: Wed, 30 May 2018 17:31:58 -0700
Subject: [PATCH] add a few shortcut variables

---
 src/Form/ModuleConfigurationForm.php | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Form/ModuleConfigurationForm.php b/src/Form/ModuleConfigurationForm.php
index 8fe6f3d..a590abe 100644
--- a/src/Form/ModuleConfigurationForm.php
+++ b/src/Form/ModuleConfigurationForm.php
@@ -31,6 +31,9 @@ class ModuleConfigurationForm extends ConfigFormBase {
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('wcm8_siteinfo.settings');
+    $site_config = $this->config('system.site');
+    $site_name = $site_config->get('name');
+    $site_mail = $site_config->get('mail');
     
     $form['siteinfo'] = array(
       '#type' => 'vertical_tabs',
@@ -59,7 +62,7 @@ class ModuleConfigurationForm extends ConfigFormBase {
       '#description' => $this->t('Main name for the site - it should be your college, department or organization name.'),
       '#size' => '60',
       '#maxlength' => '75',
-      '#default_value' => $this->config('system.site')->get('name'),
+      '#default_value' => $site_name,
     );
     
     // Contact Information tab
@@ -119,7 +122,7 @@ class ModuleConfigurationForm extends ConfigFormBase {
       '#type' => 'email',
       '#title' => $this->t('Email'),
       '#description' => $this->t('Main contact email for your site.'),
-      '#default_value' => $config->get('email'),
+      '#default_value' => $site_mail,
     );
     
     // Social Networking tab
-- 
GitLab