-
Notifications
You must be signed in to change notification settings - Fork 51
Set default terms for field properties when chado mapping is missing. #1940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That must have been a pain to add all those! But looks good.
Described test adding as a Chado Integer Field Type field worked as advertised.
Then I thought to try adding as a Chado Type Reference. When I go to create the project I see
The website encountered an unexpected error. Try again later.
TypeError: Drupal\tripal\TripalStorage\TripalStorageBase::addTypes(): Argument #2 ($types) must be of type array, null given, called in /var/www/drupal/web/modules/contrib/tripal/tripal/src/Entity/TripalEntity.php on line 425 in Drupal\tripal\TripalStorage\TripalStorageBase->addTypes() (line 115 of modules/contrib/tripal/tripal/src/TripalStorage/TripalStorageBase.php).
We are not getting anything from this in tripal/src/Entity/TripalEntity.php
// Get the empty property values for this field item and the
// property type objects.
$prop_values = $item->tripalValuesTemplate($item->getFieldDefinition());
$prop_types = get_class($item)::tripalTypes($item->getFieldDefinition());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bug I found is now issue #1941
So there is nothing wrong with this PR
|
Thank you for the review @dsenalik! ❤️ Yes, it was tedious adding all of those 🤪 but the chado mapping UI helped to look them all up in the right format so it was better then it could have been! |
| $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'] ?: ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not have been changed and will be reverted by PR #1942
This change causes a warning that array key does not exist in some cases.
Bug Fix
Issue #1939
Tripal Version: 4
Description
Many field properties do not have defaults set for when chado mapping is not present. This causes field addition to fail whenever the column doesn't exist in the chado mapping. Instead this PR add a default for all properties and then if chado mapping provides a more specific term, we use it.
Testing?
drush cr