You are here

function better_watchdog_ui_update_7201 in Better Watchdog UI 7

Same name and namespace in other branches
  1. 8 better_watchdog_ui.install \better_watchdog_ui_update_7201()
  2. 7.3 better_watchdog_ui.install \better_watchdog_ui_update_7201()
  3. 7.2 better_watchdog_ui.install \better_watchdog_ui_update_7201()

Implements hook_update_N().

File

./better_watchdog_ui.install, line 81
Installation and update functions.

Code

function better_watchdog_ui_update_7201(&$sandbox) {

  // Enable entity submodule.
  module_enable(array(
    'better_watchdog_ui_entity',
  ));

  // Remove old view.
  $view = views_get_view('better_watchdog_ui_view');
  if ($view) {
    $view
      ->delete();
  }

  // Save new view.
  module_load_include('inc', 'better_watchdog_ui', 'views/better_watchdog_ui.views_default');
  $views = better_watchdog_ui_views_default_views();
  $wd_view = $views['better_watchdog_ui_view'];
  $wd_view
    ->save();
  views_invalidate_cache();
}