I need to programmatically update my default theme and disable bartik on a live site. I know I need to update the config. In Drupal 7 I would have used theme_enable()
, but I am not sure how to do this in Drupal 8. Below my function sets ‘mycustomtheme’ by default but it does not enable the theme. Thanks in advance.
function mysite_deploy_update_8001() { Drupal::configFactory() ->getEditable('system.theme') ->set('default', 'mycustomtheme') ->save(); }