Remove theme data on theme deletion (#4529)
Credit to @DanHarrin. Fixes #1292.
This commit is contained in:
parent
967fd02d8c
commit
4434808549
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ class ThemeManager
|
|||
throw new ApplicationException(trans('cms::lang.theme.delete_active_theme_failed'));
|
||||
}
|
||||
|
||||
$theme->removeCustomData();
|
||||
|
||||
/*
|
||||
* Delete from file system
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue