From b8264306fc751fa67e7fb55a4b86c9d5950ffbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Tue, 11 Dec 2007 10:52:01 +0000 Subject: #176282 by Desbeers: forum taxonomy was required for non-forum node types, when enabled for forum inclusion --- modules/system/system.install | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/system/system.install') diff --git a/modules/system/system.install b/modules/system/system.install index c89294220..c25268c61 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -2713,6 +2713,20 @@ function system_update_6040() { return $ret; } +/** + * Change forum vocabulary not to be required by default and set the weight of the forum.module 1 higher than the taxonomy.module. + */ +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; +} + /** * @} End of "defgroup updates-5.x-to-6.x" * The next series of updates should start at 7000. -- cgit v1.2.3