You are here

function opigno_lms_update_8005 in Opigno LMS 8.2

Remove unnecessary media type 'file'.

File

./opigno_lms.install, line 184
Install, update and uninstall functions for the "opigno_lms" installation profile.

Code

function opigno_lms_update_8005() {
  try {
    $media_type = MediaType::load('file');
    if ($media_type) {
      $media_type
        ->delete();
    }
  } catch (Exception $e) {
    $message = t("Error removing media type 'file': ");
    \Drupal::logger('opigno_lms')
      ->error($message . $e
      ->getMessage());
    $messenger = \Drupal::messenger();
    $messenger
      ->addError($message . $e
      ->getMessage());
  }
}