Skip to content
Snippets Groups Projects

Issue #3408314: Allow configuration of which vocabularies to export

2 files
+ 7
4
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -95,10 +95,14 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$vocabulary_list[$vocabulary->id()] = $vocabulary->label();
}
// This will return NULL if no data has been saved yet. So we default to an
// empty array, so that we can use it in '#default_value' below.
$taxonomies = $this->config('structure_sync.data')->get('taxonomies') ?: [];
$form['export']['export_voc_list'] = [
'#type' => 'checkboxes',
'#options' => $vocabulary_list,
'#default_value' => array_keys($vocabulary_list),
'#default_value' => array_keys($taxonomies),
'#title' => $this->t('Select the vocabularies you would like to export'),
];
@@ -109,8 +113,6 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#open' => TRUE,
];
$taxonomies = $this->config('structure_sync.data')->get('taxonomies');
if (empty($taxonomies)) {
$form['import']['import_no_data'] = [
'#type' => 'markup',
Loading