Steps to reproduce:
1) Navigate to Administration > PhenoTips > Studies
2) Either "Group assignment" or do not select any "Study submission preference"
3) Create a new study and save it. Save it and .
4) Navigate to Administration > PhenoTips > Work groups, create a group and place current user in it
5) Subscribe the group to the newly created study
6) Navigate back to Administration > PhenoTips > Studies and delete the study
7) From the PhenoTips dashboard, create a new patient. Notice that you are prompted to select the recently deleted study.