diff --git a/ehr/resources/reports/schemas/study/Pedigree/Pedigree.r b/ehr/resources/reports/schemas/study/Pedigree/Pedigree.r index 913dee95d..6a3532be7 100644 --- a/ehr/resources/reports/schemas/study/Pedigree/Pedigree.r +++ b/ehr/resources/reports/schemas/study/Pedigree/Pedigree.r @@ -300,7 +300,19 @@ if ((nrow(labkey.data) == 0) | (all(is.na(labkey.data$dam)) & all(is.na(labkey.d png(filename="${imgout:png_pedigree}", width = plotWidth, height=plotHeight); par(xpd=TRUE); - plot(ptemp, align=T, width=15, symbolsize=symSize, cex=cexSize, col=fixedPed$colors, mar=c(4.1,3.5,4.1,3.8)) + # kinship2's QP-based alignment (align=TRUE) can fail with "constraints are inconsistent, + # no solution!" on deep/looped pedigrees. Fall back to the unaligned layout in that case so + # the report still renders rather than aborting. + tryCatch( + plot(ptemp, align=TRUE, width=15, symbolsize=symSize, cex=cexSize, col=fixedPed$colors, mar=c(4.1,3.5,4.1,3.8)), + error = function(e) { + # Only the QP alignment failure is recoverable by dropping alignment; re-raise anything else. + if (!grepl("constraints are inconsistent", conditionMessage(e), fixed = TRUE)) + stop(e) + message("Pedigree alignment failed (", conditionMessage(e), "); retrying with align=FALSE.") + plot(ptemp, align=FALSE, width=15, symbolsize=symSize, cex=cexSize, col=fixedPed$colors, mar=c(4.1,3.5,4.1,3.8)) + } + ) mtext("Unknown animals are marked with xxs ## or xxd ## where ## is a randomly generated unique number. This identifier is used only in this plot and is re-generated each time the plot is rendered.", side = 1, font = 3, cex = 0.95) leg.txt <- c("Male", "Female", "Deceased") diff --git a/ehr/resources/web/ehr/DataEntryUtils.js b/ehr/resources/web/ehr/DataEntryUtils.js index d0f0f01af..b8caee443 100644 --- a/ehr/resources/web/ehr/DataEntryUtils.js +++ b/ehr/resources/web/ehr/DataEntryUtils.js @@ -801,7 +801,17 @@ EHR.DataEntryUtils = new function(){ schemaName: 'ehr', queryName: 'observation_types', columns: 'value,editorconfig', - autoLoad: true + autoLoad: true, + listeners: { + // unlike EHR.data.DataEntryClientStore, LABKEY.ext4.data.Store has no hasLoaded(); + // consumers need to distinguish a pending initial load from one that returned no rows + load: { + single: true, + fn: function(store){ + store.hasLoadedOnce = true; + } + } + } }); return EHR._observationTypesStore; diff --git a/ehr/resources/web/ehr/ehr_ext4_dataEntry.lib.xml b/ehr/resources/web/ehr/ehr_ext4_dataEntry.lib.xml index 60557b71e..edaa925ac 100644 --- a/ehr/resources/web/ehr/ehr_ext4_dataEntry.lib.xml +++ b/ehr/resources/web/ehr/ehr_ext4_dataEntry.lib.xml @@ -21,6 +21,7 @@