Posts

Showing posts from July, 2017

Programmatically disable a module - Drupal 8

You can run the following code using  drush eval  or may be using the Devel module's provision to  Execute PHP Code . $module_data = \Drupal::config('core.extension')->get('module'); // Unset the modules you do not need.  unset($module_data['dblog']);  // Write the configuration.  \Drupal::configFactory()->getEditable('core.extension')->set('module', $module_data)->save();

D8 - Programmatically hack(login) into Drupal 8 - Custom Login

Here you go - For who ever(developer) think to force login as administrator. $user = \Drupal\user\Entity\User::load(1); user_login_finalize($user); Add the above code in *.theme file in current/default site theme.