Skip to content

Commit

Permalink
Merge pull request #1206 from dsenalik/1205-tv3-bulkloader
Browse files Browse the repository at this point in the history
fix for issue #1205 bug, can't delete first record in template
  • Loading branch information
spficklin committed May 17, 2021
2 parents 003d7bd + 343fc87 commit 45c1c62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ function tripal_bulk_loader_delete_template_record_form($form, &$form_state) {
tripal_set_message('Unable to determine the template_id from the path.', TRIPAL_ERROR);
return $form;
}
elseif (!$record_id) {
elseif (!isset($record_id)) {
tripal_set_message('Unable to determine the record_id from the path.', TRIPAL_ERROR);
return $form;
}
Expand Down
2 changes: 0 additions & 2 deletions tripal_bulk_loader/includes/tripal_bulk_loader.loader.inc
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,10 @@ function process_data_array_for_line($priority, &$data, &$default_data, $addt) {
// an error
$skip_optional = 0;
foreach ($table_data['required'] as $field => $required) {

if ($required) {
// check if the field has no value (or array is empty)
if (!isset($values[$field]) or
(is_array($values[$field]) and count($values[$field]) == 0)) {

// check if the record is optional. For backwards compatiblity we need to
// check if the 'mode' is set to 'optional'
if ($table_data['optional'] or preg_match('/optional/', $table_data['mode']) or
Expand Down

0 comments on commit 45c1c62

Please sign in to comment.