summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-08-20 18:18:15 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-08-20 18:18:15 +0000
commitced08bf27a5c5dec209e2818b162bcf6ed80848b (patch)
tree8f9a01c59ee573f25bbd6356b1c8db5fb636b5e6 /modules
parent85509811e1be9e8695f07f83af64c4ed8d4e9e36 (diff)
downloadbrdo-ced08bf27a5c5dec209e2818b162bcf6ed80848b.tar.gz
brdo-ced08bf27a5c5dec209e2818b162bcf6ed80848b.tar.bz2
#166586 by hswong3i: move literal values out of menu module queries (for better db compatibility, ie. easier query rewriting)
Diffstat (limited to 'modules')
-rw-r--r--modules/menu/menu.install6
-rw-r--r--modules/menu/menu.module4
2 files changed, 5 insertions, 5 deletions
diff --git a/modules/menu/menu.install b/modules/menu/menu.install
index be397cdfe..9ef6e1548 100644
--- a/modules/menu/menu.install
+++ b/modules/menu/menu.install
@@ -7,9 +7,9 @@
function menu_install() {
// Create tables.
drupal_install_schema('menu');
- db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('navigation', 'Navigation', 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.')");
- db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('primary-links', 'Primary links', 'Primary links are often used at the theme layer to show the major sections of a site. A typical representation for primary links would be tabs along the top.')");
- db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('secondary-links', 'Secondary links', 'Secondary links are often used for pages like legal notices, contact details, and other secondary navigation items that play a lesser role than primary links')");
+ db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'navigation', 'Navigation', 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.');
+ db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'primary-links', 'Primary links', 'Primary links are often used at the theme layer to show the major sections of a site. A typical representation for primary links would be tabs along the top.');
+ db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'secondary-links', 'Secondary links', 'Secondary links are often used for pages like legal notices, contact details, and other secondary navigation items that play a lesser role than primary links');
}
/**
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 385732482..8a5f59e10 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -131,7 +131,7 @@ function menu_enable() {
menu_rebuild();
$result = db_query("SELECT * FROM {menu_custom}");
$link['module'] = 'menu';
- $link['plid'] = db_result(db_query("SELECT mlid from {menu_links} WHERE menu_name = 'navigation' AND link_path = 'admin/build/menu'"));
+ $link['plid'] = db_result(db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND link_path = '%s'", 'navigation', 'admin/build/menu'));
$link['router_path'] = 'admin/build/menu-customize/%';
while ($menu = db_fetch_array($result)) {
@@ -582,7 +582,7 @@ function menu_edit_menu_submit($form, &$form_state) {
$link['link_path'] = $path . $menu['menu_name'];
$link['router_path'] = $path .'%';
$link['module'] = 'menu';
- $link['plid'] = db_result(db_query("SELECT mlid from {menu_links} WHERE menu_name = 'navigation' AND link_path = 'admin/build/menu'"));
+ $link['plid'] = db_result(db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND link_path = '%s'", 'navigation', 'admin/build/menu'));
menu_link_save($link);
db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", $menu['menu_name'], $menu['title'], $menu['description']);
}