You are here

function hierarchical_select_install in Hierarchical Select 5.2

Same name and namespace in other branches
  1. 5.3 hierarchical_select.install \hierarchical_select_install()
  2. 6.3 hierarchical_select.install \hierarchical_select_install()

Implementation of hook_install().

File

./hierarchical_select.install, line 6

Code

function hierarchical_select_install() {

  // Ensure the Hierarchical Select module runs after the Taxonomy and Content
  // Taxonomy modules! This should not be necessary to do, but apparently some
  // idiot module developer is changing the weight of the Taxonomy module...
  $weight = db_result(db_query("SELECT weight FROM {system} WHERE name = 'taxonomy'"));
  $weight = max($weight, db_result(db_query("SELECT weight FROM {system} WHERE name = 'content_taxonomy'")));

  // Also ensure the Hierarchical Select module runs after the i18ntaxonomy
  // module.
  $weight = max($weight, db_result(db_query("SELECT weight FROM {system} WHERE name = 'i18ntaxonomy'")));
  db_query("UPDATE {system} SET weight = %d WHERE name  = '%s'", $weight + 1, 'hierarchical_select');
}