kixe Posted September 30, 2014 Posted September 30, 2014 Remove of field admin_theme didn't work after uninstall of last custom AdminTheme.I tried to call the uninstall() function of AdminTheme.php by adding a function in MyCustomAdminTheme.module. This function should remove the field from the templates and delete the field. But this didn't work. Whats wrong? public function ___uninstall() { parent::___uninstall(); } noticeMost of the existing third party AdminThemes don't call the uninstall routine.While Playing around with the themes I uninstalled default theme in Modules to get the basic default admin theme (wire/templates-admin)Couldn't see the content under Modules Tab. Worked after updating wire/templates-admin/scripts/main.js.
kongondo Posted September 30, 2014 Posted September 30, 2014 I am not sure I follow? Most existing third party AdminThemes are not modules (compared to the new ones)...so no uninstall method?
kixe Posted September 30, 2014 Author Posted September 30, 2014 @kongondoyou are right. I found only 2 Admin themes based on module. Something is buggy in the uninstall method. Made some changes. Works now ... //in: site/modules/AdminThemeCustom.module and: wire/modules/AdminTheme/AdminThemeDefault public static function getModuleInfo() { return array( //something else 'autoload' => 'template=admin', 'singular' => true ); } //in wire/core/AdminTheme.php public function ___uninstall() { //must be 2 not 1 because there are 2 themes before uninstallation if(self::$numAdminThemes > 2) return; //add this line which allows also to uninstall default Admin Theme, fallback to wire/template-admin/ if(!$this->wire('fields')->get('admin_theme')) return; ...... No need to call uninstall() from custom module.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now