Skip to content
Snippets Groups Projects
Commit ddcdb036 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#546 - handle templates without any template group

parent 2923f822
Branches
Tags
No related merge requests found
Pipeline #6011 failed
......@@ -174,6 +174,8 @@ public class BackupTemplate_v7 implements Upgradeable<BackupTemplate_v8>
@Override
public BackupTemplate_v8 upgrade(List<BackupInfo> backupInfoItems)
{
// need to set template group id to default template group here, but access to this informationen is not available at this point
// Instead ImportService will handle null values for template group id and fill in the correct default template group
return new BackupTemplate_v8(templateName, amount, isExpenditure, accountID, categoryID, name, description, iconReferenceID, tags, transferAccountID, null);
}
}
......@@ -494,7 +494,7 @@ public class ImportService
updateTagsForItem(template);
template.setID(null);
if(!importTemplateGroups)
if(!importTemplateGroups || template.getTemplateGroup() == null)
{
template.setTemplateGroup(templateGroupRepository.findFirstByType(TemplateGroupType.DEFAULT));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment