Remove theme data on theme deletion (#4529)

Credit to @DanHarrin. Fixes #1292.
This commit is contained in:
Dan Harrin 2019-08-15 04:41:03 +01:00 committed by Ben Thomson
parent 967fd02d8c
commit 4434808549
2 changed files with 15 additions and 0 deletions

View File

@ -524,6 +524,19 @@ class Theme
return ThemeData::forTheme($this);
}
/**
* Remove data specific to this theme
* @return bool
*/
public function removeCustomData()
{
if ($this->hasCustomData()) {
return $this->getCustomData()->delete();
}
return true;
}
/**
* Checks to see if the database layer has been enabled
*

View File

@ -107,6 +107,8 @@ class ThemeManager
throw new ApplicationException(trans('cms::lang.theme.delete_active_theme_failed'));
}
$theme->removeCustomData();
/*
* Delete from file system
*/