You are here

function text_noderef_install in Text or Nodereference 7

Same name and namespace in other branches
  1. 6 text_noderef.install \text_noderef_install()

Implementation of hook_install().

File

./text_noderef.install, line 10
Module installation/uninstallation hooks.

Code

function text_noderef_install() {

  // Make sure this module is loaded after text.module's fields.
  // See text_noderef_form_field_ui_field_edit_form_alter().
  $query = db_select('system', 's');
  $query
    ->addExpression('MAX(weight)', 'maxweight');
  $weight = $query
    ->condition('name', 'text')
    ->execute()
    ->fetchField();
  db_update('system')
    ->fields(array(
    'weight' => 1 + $weight,
  ))
    ->condition('name', 'text_noderef')
    ->execute();
}