You are here

function termstatus_enable in Taxonomy Term Status 7

Implemets hook_enable().

Disable term status per default in order to protect people from having all their terms disappear when enabling the module. Do not disable the module when installing into a pristine system - i.e. when there are no terms.

12 string references to 'termstatus_enable'
TermstatusAccessTestCase::setUp in ./termstatus.test
Return info about test case.
TermstatusAdminTestCase::setUp in ./termstatus.test
Return info about test case.
TermstatusQueryTagTestCase::setUp in ./termstatus.test
Sets up a Drupal site for running functional and integration tests.
TermstatusSafeguardTestCase::testFirstUseSafeguard in ./termstatus.test
Tests the first-use-safeguard mechanism.
TermstatusSafeguardTestCase::testFirstUseSafeguardNoTerms in ./termstatus.test
Tests the first-use-safeguard mechanism when no terms are present.

... See full list

File

./termstatus.install, line 15
Install, update and uninstall functions for the termstatus module.

Code

function termstatus_enable() {
  $any_tid = db_query('SELECT tid FROM {taxonomy_term_data} LIMIT 1')
    ->fetchField();
  variable_set('termstatus_enable', empty($any_tid));
}