You are here

function flag_enable in Flag 5

Same name and namespace in other branches
  1. 6.2 flag.install \flag_enable()
  2. 7.2 flag.install \flag_enable()

Implementation of hook_enable().

We uninstall ourselves if the "Flag content" module is installed.

File

./flag.install, line 218
Flag module install/update hooks.

Code

function flag_enable() {
  if (_flag_flag_content_installed()) {
    drupal_set_message(_flag_flag_content_message(), 'error');

    // Do some bookkeeping:
    module_disable(array(
      'flag',
    ));

    // Now, we need to uninstall ourselves, because we want our hook_install()
    // to run next time. However, we don't use drupal_uninstall_module(),
    // because then flag_uninstall() will run and complain about non-existing
    // tables.
    drupal_set_installed_schema_version('flag', SCHEMA_UNINSTALLED);
  }
}