6d5eab1bc6022f0ed9c79637a98016d8e91d1516 angie Thu Jun 27 10:33:42 2019 -0700 Instead of adding special cases for CGIs that are surprised by empty cart vars for lost trash files, just leave the lost trash file paths in place because the CGIs already know how to deal with those. refs #22440 diff --git src/hg/hgSession/sessionData.c src/hg/hgSession/sessionData.c index 41cc38c..b14caaa 100644 --- src/hg/hgSession/sessionData.c +++ src/hg/hgSession/sessionData.c @@ -480,26 +480,26 @@ // replace with new file containing references to saved files and tables. char *oldTrackFile = cloneString(var->val); char *newTrackFile = saveTrackFile(cart, var->name, var->val, sessionDataDbPrefix, dbSuffix, sessionDir); if (newTrackFile && cartVarIsCustomComposite(var->name)) cartReplaceHubVars(cart, var->name, oldTrackFile, newTrackFile); freeMem(oldTrackFile); freeMem(newTrackFile); } else { // Regular cart var; save trash paths (possibly encoded) in value, if any are found. char *newVal = cloneString(var->val); saveTrashPaths(&newVal, sessionDir, FALSE); saveTrashPaths(&newVal, sessionDir, TRUE); - // Special case for lost hgPcr/blat result trash files: prevent errAbort in hgTracks - if ((startsWith("hgPcrResult_", var->name) || sameString("ss", var->name)) && - sameString(newVal, " ")) - cartRemove(cart, var->name); - else if (newVal != var->val && differentString(newVal, var->val)) + // If the variable would end up with an empty value, leave the old deleted trash file + // name in place because the CGIs know how to deal with that but may error out if the + // value is just empty. + if (newVal != var->val && isNotEmpty(skipLeadingSpaces(newVal)) && + differentString(newVal, var->val)) cartSetString(cart, var->name, newVal); freeMem(newVal); } } } }