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

#676 - fixed update of missing attributes

parent 822fcb1a
No related branches found
No related tags found
No related merge requests found
...@@ -127,7 +127,9 @@ public class AccountService implements Resettable, AccessAllEntities<Account>, A ...@@ -127,7 +127,9 @@ public class AccountService implements Resettable, AccessAllEntities<Account>, A
if(accountRepository.findAll().isEmpty()) if(accountRepository.findAll().isEmpty())
{ {
Account placeholder = new Account("Placeholder", AccountType.ALL); Account placeholder = new Account("Placeholder", AccountType.ALL);
placeholder.updateIcon(iconService, null, PLACEHOLDER_ICON, null, this); final Icon newIcon = iconService.createIconReference(null, PLACEHOLDER_ICON, null);
iconService.getRepository().save(newIcon);
placeholder.setIconReference(newIcon);
accountRepository.save(placeholder); accountRepository.save(placeholder);
LOGGER.debug("Created placeholder account"); LOGGER.debug("Created placeholder account");
...@@ -158,7 +160,14 @@ public class AccountService implements Resettable, AccessAllEntities<Account>, A ...@@ -158,7 +160,14 @@ public class AccountService implements Resettable, AccessAllEntities<Account>, A
final Account placeholderAccount = accountRepository.findAllByType(AccountType.ALL).get(0); final Account placeholderAccount = accountRepository.findAllByType(AccountType.ALL).get(0);
final Icon icon = placeholderAccount.getIconReference(); final Icon icon = placeholderAccount.getIconReference();
if(icon.getBuiltinIdentifier() == null) if(icon == null)
{
final Icon newIcon = iconService.createIconReference(null, PLACEHOLDER_ICON, null);
iconService.getRepository().save(newIcon);
placeholderAccount.setIconReference(newIcon);
LOGGER.debug(MessageFormat.format("Updated placeholder account: Created missing icon instance and set icon to \"{0}\"", PLACEHOLDER_ICON));
}
else if(icon.getBuiltinIdentifier() == null)
{ {
placeholderAccount.updateIcon(iconService, null, PLACEHOLDER_ICON, null, this); placeholderAccount.updateIcon(iconService, null, PLACEHOLDER_ICON, null, this);
LOGGER.debug(MessageFormat.format("Updated placeholder account: Set missing icon to \"{0}\"", PLACEHOLDER_ICON)); LOGGER.debug(MessageFormat.format("Updated placeholder account: Set missing icon to \"{0}\"", PLACEHOLDER_ICON));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment