Skip to content

Commit

Permalink
Merge pull request tripal#1942 from tripal/tv4g1-issue1941-additional…
Browse files Browse the repository at this point in the history
…-type-field

ChadoAdditionalTypeTypeDefault can be manually added
  • Loading branch information
laceysanderson authored Aug 23, 2024
2 parents 2d7d298 + 5fcdccf commit 7ef42b4
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public static function tripalTypes($field_definition) {
$base_table = $storage_settings['base_table'];
$type_table = $storage_settings['type_table'] ?? '';
$type_column = $storage_settings['type_column'] ?? '';
// Type table and column can also be stored as the select element
$type_fkey = $storage_settings['type_fkey'] ?? '';
if ($type_fkey) {
list($type_table, $type_column) = explode(self::$table_column_delimiter, $type_fkey);
}

// If we don't have a base table then we're not ready to specify the
// properties for this field.
Expand Down Expand Up @@ -216,9 +221,9 @@ public function storageSettingsForm(array &$form, FormStateInterface $form_state
// If this is an existing field, retrieve its storage settings.
$storage_settings = $this->getSetting('storage_plugin_settings');

$type_table = $storage_settings['type_table'] ?: '';
$type_column = $storage_settings['type_column'] ?: '';
$type_fkey = $storage_settings['type_fkey'] ?: '';
$type_table = $storage_settings['type_table'] ?? '';
$type_column = $storage_settings['type_column'] ?? '';
$type_fkey = $storage_settings['type_fkey'] ?? '';

// In the form, table and column will be selected together as a single unit
$type_select = $type_fkey;
Expand Down

0 comments on commit 7ef42b4

Please sign in to comment.