diff --git a/NEWS.md b/NEWS.md index ee333040..f600589d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # redcapAPI (development version) * `exportDags`, `exportFieldNames`, `exportProjectInformation`, `exportReportsTyped`, `importDags`, `writeDataForImport`, and `exportRecordsTYped` now have a `csv_delimiter` parameter to control delimiter utilized. +* `importMetaData` bug fix when given duplicate names to exit and warn user properly. ## DEPRECATION NOTICES diff --git a/R/importMetaData.R b/R/importMetaData.R index cf2608e2..b74ee216 100644 --- a/R/importMetaData.R +++ b/R/importMetaData.R @@ -55,7 +55,7 @@ importMetaData.redcapApiConnection <- function(rcon, duplicate_field_name <- data$field_name[duplicated(data$field_name)] - if (any(duplicate_field_name)){ + if (length(duplicate_field_name) > 0L){ coll$push(sprintf("The following have duplicate field names: {%s}", duplicate_field_name)) }