diff --git a/config/install/islandora.settings.yml b/config/install/islandora.settings.yml new file mode 100644 index 00000000..8fb25fb8 --- /dev/null +++ b/config/install/islandora.settings.yml @@ -0,0 +1,4 @@ +broker_url: 'tcp://localhost:61613' +jwt_expiry: '+2 hour' +gemini_url: '' +gemini_pseudo_bundles: [] diff --git a/islandora.module b/islandora.module index 6a1f251c..8b0d52e1 100644 --- a/islandora.module +++ b/islandora.module @@ -356,7 +356,7 @@ function islandora_entity_extra_field_info() { $config_factory = \Drupal::service('config.factory')->get(IslandoraSettingsForm::CONFIG_NAME); $extra_field = []; - $pseudo_bundles = $config_factory->get(IslandoraSettingsForm::GEMINI_PSEUDO) ? $config_factory->get(IslandoraSettingsForm::GEMINI_PSEUDO) : []; + $pseudo_bundles = $config_factory->get(IslandoraSettingsForm::GEMINI_PSEUDO); foreach ($pseudo_bundles as $key) { list($bundle, $content_entity) = explode(":", $key); diff --git a/src/Form/IslandoraSettingsForm.php b/src/Form/IslandoraSettingsForm.php index 6ec80165..8079279d 100644 --- a/src/Form/IslandoraSettingsForm.php +++ b/src/Form/IslandoraSettingsForm.php @@ -80,22 +80,22 @@ class IslandoraSettingsForm extends ConfigFormBase { $form[self::BROKER_URL] = [ '#type' => 'textfield', '#title' => $this->t('Broker URL'), - '#default_value' => $config->get(self::BROKER_URL) ? $config->get(self::BROKER_URL) : 'tcp://localhost:61613', + '#default_value' => $config->get(self::BROKER_URL), ]; $form[self::JWT_EXPIRY] = [ '#type' => 'textfield', '#title' => $this->t('JWT Expiry'), - '#default_value' => $config->get(self::JWT_EXPIRY) ? $config->get(self::JWT_EXPIRY) : '+2 hour', + '#default_value' => $config->get(self::JWT_EXPIRY), ]; $form[self::GEMINI_URL] = [ '#type' => 'textfield', '#title' => $this->t('Gemini URL'), - '#default_value' => $config->get(self::GEMINI_URL) ? $config->get(self::GEMINI_URL) : '', + '#default_value' => $config->get(self::GEMINI_URL), ]; - $selected_bundles = $config->get(self::GEMINI_PSEUDO) ? $config->get(self::GEMINI_PSEUDO) : []; + $selected_bundles = $config->get(self::GEMINI_PSEUDO); $options = []; foreach (['node', 'media', 'taxonomy_term'] as $content_entity) {