From 45910939fc87bbd48e01d3b2783cf5de32027a57 Mon Sep 17 00:00:00 2001 From: Clay Birkett Date: Wed, 20 May 2026 16:51:14 -0400 Subject: [PATCH 1/2] fix upload accession using list --- .../legacy/CXGN/BreedersToolbox/Accessions.js | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/js/source/legacy/CXGN/BreedersToolbox/Accessions.js b/js/source/legacy/CXGN/BreedersToolbox/Accessions.js index c606eeac19..5991e15190 100644 --- a/js/source/legacy/CXGN/BreedersToolbox/Accessions.js +++ b/js/source/legacy/CXGN/BreedersToolbox/Accessions.js @@ -527,11 +527,11 @@ jQuery(document).ready(function ($) { alert('ERROR! Try again later.'); } ); + } else { + add_accessions(infoToAdd, speciesNames, emailAddress, email_option_enabled); + $('#review_absent_dialog').modal("hide"); } - add_accessions(infoToAdd, speciesNames, emailAddress, email_option_enabled); - $('#review_absent_dialog').modal("hide"); - //window.location.href='/breeders/accessions'; }); @@ -581,7 +581,7 @@ jQuery(document).ready(function ($) { } else if (response.success) { fullParsedData = response.full_data; - doFuzzySearch = jQuery('#fuzzy_check_upload_accessions').prop('checked');; + doFuzzySearch = jQuery('#fuzzy_check_upload_accessions').prop('checked'); review_verification_results(doFuzzySearch, response, response.list_id); } else { @@ -593,15 +593,15 @@ jQuery(document).ready(function ($) { $('[name="add_accessions_link"]').click(function () { var list = new CXGN.List(); - accessionList; - accession_list_id; - validSpecies; - fuzzyResponse; - fullParsedData; - infoToAdd; - accessionListFound; - speciesNames; - doFuzzySearch; + accessionList = []; + accession_list_id = undefined; + validSpecies = undefined; + fuzzyResponse = undefined; + fullParsedData = undefined; + infoToAdd = []; + accessionListFound = {}; + speciesNames = []; + doFuzzySearch = undefined; $('#add_accessions_dialog').modal("show"); $('#review_found_matches_dialog').modal("hide"); $('#review_fuzzy_matches_dialog').modal("hide"); @@ -645,7 +645,7 @@ function openWindowWithPost(fuzzyResponse) { } function verify_accession_list(accession_list_id) { - accession_list = JSON.stringify(list.getList(accession_list_id)); + accessionList = JSON.stringify(list.getList(accession_list_id)); doFuzzySearch = jQuery('#fuzzy_check').prop('checked'); jQuery.ajax({ @@ -655,7 +655,7 @@ function verify_accession_list(accession_list_id) { //async: false, dataType: "json", data: { - 'accession_list': accession_list, + 'accession_list': accessionList, 'do_fuzzy_search': doFuzzySearch, }, beforeSend: function(){ @@ -712,7 +712,7 @@ function review_verification_results(doFuzzySearch, verifyResponse, accession_li if (verifyResponse.fuzzy.length > 0 && doFuzzySearch) { fuzzyResponse = verifyResponse.fuzzy; - var fuzzy_html = ''; + var fuzzy_html = '
Name in Your ListExisting Name(s) in DatabaseOptions     Use Same Option for All
'; for( i=0; i < verifyResponse.fuzzy.length; i++) { fuzzy_html = fuzzy_html + ''; fuzzy_html = fuzzy_html + '
Name in Your ListExisting Name(s) in DatabaseOptions     Use Same Option for All
'+ verifyResponse.fuzzy[i].name + '