system_update_6041

Definition

system_update_6041()
modules/system/system.install, line 2475

Description

Change forum vocabulary not to be required by default and set the weight of the forum.module 1 higher than the taxonomy.module.

Code

<?php
function system_update_6041() {
  $weight = intval((db_result(db_query("SELECT weight FROM {system} WHERE name = 'taxonomy'"))) + 1);
  $ret = array();
  $vid = intval(variable_get('forum_nav_vocabulary', ''));
  if (db_table_exists('vocabulary') && $vid) {
    $ret[] = update_sql("UPDATE {vocabulary} SET required = 0 WHERE vid = " . $vid);
    $ret[] = update_sql("UPDATE {system} SET weight = " . $weight . " WHERE name = 'forum'");
  }
  return $ret;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.