From 3869435443c27b024e2ba70298836ba4880f0a90 Mon Sep 17 00:00:00 2001 From: Felix Henninger Date: Mon, 6 Apr 2020 08:24:38 +0200 Subject: [PATCH] Handle PHP backend databases without full datasets better Many thanks to Andreas Voss for uncovering this issue! --- readme.md | 1 + utilities/SQLite import app/server.r | 5 +++++ utilities/SQLite import.Rmd | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/readme.md b/readme.md index df1c535ab..6faee92f7 100644 --- a/readme.md +++ b/readme.md @@ -113,6 +113,7 @@ Dilek Akkus · [Nikoletta Symeonidou](https://www.sowi.uni-mannheim.de/en/erdfelder/team/academic-staff-members/symeonidou-nikoletta/) · [Hendrik Singmann](http://singmann.org) · [Kevin Tiede](https://www.spds.uni-konstanz.de/kevin-tiede) · +[Andreas Voss](https://www.psychologie.uni-heidelberg.de/ae/meth/) · [Andrew White](https://github.com/shiroandy) · [Malte Zimdahl](http://psycho3.uni-mannheim.de/Personen/Malte%20Zimdahl,%20M.Sc./) diff --git a/utilities/SQLite import app/server.r b/utilities/SQLite import app/server.r index 8d460786c..4273f358a 100644 --- a/utilities/SQLite import app/server.r +++ b/utilities/SQLite import app/server.r @@ -110,6 +110,11 @@ processData <- function(database) { ) %>% ungroup() %>% select(-id) -> d.full + } else { + # If there are no full datasets, start from an entirely empty df + # in order to avoid introducing unwanted columns into the following + # merge steps. + d.full <- tibble() } d %>% diff --git a/utilities/SQLite import.Rmd b/utilities/SQLite import.Rmd index f0a34da3a..f96ba50ed 100644 --- a/utilities/SQLite import.Rmd +++ b/utilities/SQLite import.Rmd @@ -127,6 +127,11 @@ if (nrow(d.full) > 0) { ) %>% ungroup() %>% select(-id) -> d.full +} else { + # If there are no full datasets, start from an entirely empty df + # in order to avoid introducing unwanted columns into the following + # merge steps. + d.full <- tibble() } ```