Loading sparql_entity_storage.module +19 −12 Original line number Diff line number Diff line Loading @@ -284,35 +284,42 @@ function sparql_entity_storage_form_alter(&$form, FormStateInterface $form_state if ($field_name === $id_key) { continue; } $columns = $base_field->getColumns(); foreach ($columns as $column_name => $column) { $title = $base_field->getLabel(); if (count($columns) > 1) { $title .= ' (' . $column_name . ')'; } $title = $base_field->getLabel(); $form['sparql_entity_storage']['base_fields_mapping'][$field_name] = [ '#type' => 'details', '#title' => $title, '#description' => $base_field->getDescription(), ]; $columns = $base_field->getColumns(); foreach ($columns as $column_name => $column) { $column_title = $base_field->getLabel(); if (count($columns) > 1) { $column_title = $title . ' (' . $column_name . ')'; } $has_mapping = $mapping && $mapping->getMapping($field_name, $column_name); $form['sparql_entity_storage']['base_fields_mapping'][$field_name][$column_name]['predicate'] = [ '#type' => 'url', '#title' => t('Mapping'), '#title' => t(':field_title mapping', [ ':field_title' => $column_title, ]), '#description' => t('The RDF predicate.'), '#weight' => 150, '#default_value' => $mapping ? $mapping->getMapping($field_name, $column_name)['predicate'] : NULL, '#default_value' => $has_mapping ? $mapping->getMapping($field_name, $column_name)['predicate'] : NULL, ]; $form['sparql_entity_storage']['base_fields_mapping'][$field_name][$column_name]['format'] = [ '#type' => 'select', '#title' => t('Value format'), '#title' => t(':field_title value format', [ ':field_title' => $column_title, ]), '#description' => t('The RDF format. Required if format is filled.'), '#options' => SparqlEntityStorageFieldHandler::getSupportedDataTypes(), '#empty_value' => '', '#weight' => 151, '#default_value' => $mapping ? $mapping->getMapping($field_name, $column_name)['format'] : NULL, '#default_value' => $has_mapping ? $mapping->getMapping($field_name, $column_name)['format'] : NULL, ]; } } Loading Loading
sparql_entity_storage.module +19 −12 Original line number Diff line number Diff line Loading @@ -284,35 +284,42 @@ function sparql_entity_storage_form_alter(&$form, FormStateInterface $form_state if ($field_name === $id_key) { continue; } $columns = $base_field->getColumns(); foreach ($columns as $column_name => $column) { $title = $base_field->getLabel(); if (count($columns) > 1) { $title .= ' (' . $column_name . ')'; } $title = $base_field->getLabel(); $form['sparql_entity_storage']['base_fields_mapping'][$field_name] = [ '#type' => 'details', '#title' => $title, '#description' => $base_field->getDescription(), ]; $columns = $base_field->getColumns(); foreach ($columns as $column_name => $column) { $column_title = $base_field->getLabel(); if (count($columns) > 1) { $column_title = $title . ' (' . $column_name . ')'; } $has_mapping = $mapping && $mapping->getMapping($field_name, $column_name); $form['sparql_entity_storage']['base_fields_mapping'][$field_name][$column_name]['predicate'] = [ '#type' => 'url', '#title' => t('Mapping'), '#title' => t(':field_title mapping', [ ':field_title' => $column_title, ]), '#description' => t('The RDF predicate.'), '#weight' => 150, '#default_value' => $mapping ? $mapping->getMapping($field_name, $column_name)['predicate'] : NULL, '#default_value' => $has_mapping ? $mapping->getMapping($field_name, $column_name)['predicate'] : NULL, ]; $form['sparql_entity_storage']['base_fields_mapping'][$field_name][$column_name]['format'] = [ '#type' => 'select', '#title' => t('Value format'), '#title' => t(':field_title value format', [ ':field_title' => $column_title, ]), '#description' => t('The RDF format. Required if format is filled.'), '#options' => SparqlEntityStorageFieldHandler::getSupportedDataTypes(), '#empty_value' => '', '#weight' => 151, '#default_value' => $mapping ? $mapping->getMapping($field_name, $column_name)['format'] : NULL, '#default_value' => $has_mapping ? $mapping->getMapping($field_name, $column_name)['format'] : NULL, ]; } } Loading