Skip to content
Snippets Groups Projects
Commit 6e01d8a3 authored by Melissa Miller's avatar Melissa Miller
Browse files

Merge branch 'feature/sitename' into develop

it works.
parents fb25e074 42ed451a
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ class ModuleConfigurationForm extends ConfigFormBase {
protected function getEditableConfigNames() {
return [
'wcm8_siteinfo.settings',
'system.site',
];
}
......@@ -58,11 +59,10 @@ class ModuleConfigurationForm extends ConfigFormBase {
$form['basic']['site_name'] = array(
'#type' => 'textfield',
'#title' => $this->t('Site Name'),
'#description' => $this->t('READ ONLY for now until this app is done. Main name for the site - it should be your college, department or organization name.'),
'#description' => $this->t('Main name for the site - it should be your college, department or organization name.'),
'#size' => '60',
'#maxlength' => '75',
'#default_value' => $site_name,
'#attributes' => array('readonly' => 'readonly'),
);
$form['basic']['admin_link'] = array(
......@@ -220,6 +220,8 @@ class ModuleConfigurationForm extends ConfigFormBase {
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state->getValues();
//set config values unique to this module
$this->config('wcm8_siteinfo.settings')
->set('prefix', $values['prefix'])
->set('admin_link', $values['admin_link'])
......@@ -240,8 +242,12 @@ class ModuleConfigurationForm extends ConfigFormBase {
->set('instagram', $values['instagram'])
->set('photos', $values['photos'])
->save();
//set site name value back to system.site
$this->configFactory->getEditable('system.site')
->set('name', $values['site_name'])
->save();
parent::submitForm($form, $form_state);
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment