All pastes #554628 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-10 06:23 UTC
rendered paste body
? .DS_Store
? consistant_comments.patch
? grammar.patch
? select_star.patch
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.205
diff -u -p -r1.205 form.inc
--- includes/form.inc	8 Jun 2007 12:51:58 -0000	1.205
+++ includes/form.inc	10 Jun 2007 06:22:22 -0000
@@ -545,7 +545,7 @@ function _form_validate($elements, &$for
 
       // Verify that the value is not longer than #maxlength.
       if (isset($elements['#maxlength']) && drupal_strlen($elements['#value']) > $elements['#maxlength']) {
-        form_error($elements, t('!name cannot be longer than %max characters but is currently %length characters long.', array('!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title'], '%max' => $elements['#maxlength'], '%length' => drupal_strlen($elements['#value']))));
+        form_error($elements, t('!name cannot be longer than %max characters, but is currently %length characters long.', array('!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title'], '%max' => $elements['#maxlength'], '%length' => drupal_strlen($elements['#value']))));
       }
 
        // Add legal choice check if element has #options. Can be skipped, but
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.177
diff -u -p -r1.177 menu.inc
--- includes/menu.inc	6 Jun 2007 06:26:15 -0000	1.177
+++ includes/menu.inc	10 Jun 2007 06:22:22 -0000
@@ -926,7 +926,7 @@ function menu_local_tasks($level = 0) {
       return array();
     }
     // Get all tabs
-    $result = db_query("SELECT * FROM {menu_router} WHERE tab_root = '%s' AND tab_parent != '' ORDER BY weight, title", $router_item['tab_root']);
+    $result = db_query("SELECT tab_parent, path FROM {menu_router} WHERE tab_root = '%s' AND tab_parent != '' ORDER BY weight, title", $router_item['tab_root']);
     $map = arg();
     $children = array();
     $tab_parent = array();
@@ -1245,10 +1245,10 @@ function _menu_navigation_links_rebuild(
  */
 function menu_link_delete($mlid, $path = NULL) {
   if (isset($mlid)) {
-    _menu_delete_item(db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE mlid = %d", $mlid)));
+    _menu_delete_item(db_fetch_array(db_query("SELECT plid, module, has_children, mlid FROM {menu_links} WHERE mlid = %d", $mlid)));
   }
   else {
-    $result = db_query("SELECT * FROM {menu_links} WHERE link_path = '%s'", $path);
+    $result = db_query("SELECT plid, module, has_children, mlid FROM {menu_links} WHERE link_path = '%s'", $path);
     while ($link = db_fetch_array($result)) {
       _menu_delete_item($link);
     }
@@ -1314,10 +1314,10 @@ function menu_link_save(&$item) {
   $menu_name = $item['menu_name'];
   $existing_item = FALSE;
   if (isset($item['mlid'])) {
-    $existing_item = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE mlid = %d", $item['mlid']));
+    $existing_item = db_fetch_array(db_query("SELECT mlid FROM {menu_links} WHERE mlid = %d", $item['mlid']));
   }
   else {
-    $existing_item = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE menu_name = '%s' AND link_path = '%s'", $menu_name, $item['link_path']));
+    $existing_item = db_fetch_array(db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND link_path = '%s'", $menu_name, $item['link_path']));
   }
 
   if ($existing_item) {
@@ -1326,13 +1326,13 @@ function menu_link_save(&$item) {
 
   // Find the parent - it must be in the same menu.
   if (isset($item['plid'])) {
-    $parent = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE menu_name = '%s' AND mlid = %d", $menu_name, $item['plid']));
+    $parent = db_fetch_array(db_query("SELECT mlid, hidden FROM {menu_links} WHERE menu_name = '%s' AND mlid = %d", $menu_name, $item['plid']));
   }
   else {
     $parent_path = $item['link_path'];
     do {
       $parent_path = substr($parent_path, 0, strrpos($parent_path, '/'));
-      $parent = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE menu_name = '%s' AND link_path = '%s'", $menu_name, $parent_path));
+      $parent = db_fetch_array(db_query("SELECT mild, hidden FROM {menu_links} WHERE menu_name = '%s' AND link_path = '%s'", $menu_name, $parent_path));
     } while ($parent === FALSE && $parent_path);
   }
   // Menu callbacks need to be in the links table for breadcrumbs, but can't
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.358
diff -u -p -r1.358 theme.inc
--- includes/theme.inc	8 Jun 2007 12:51:58 -0000	1.358
+++ includes/theme.inc	10 Jun 2007 06:22:22 -0000
@@ -352,7 +352,7 @@ function list_themes($refresh = FALSE) {
 
   if (empty($list)) {
     $list = array();
-    $result = db_query("SELECT * FROM {system} WHERE type = 'theme'");
+    $result = db_query("SELECT filename, info FROM {system} WHERE type = 'theme'");
     while ($theme = db_fetch_object($result)) {
       if (file_exists($theme->filename)) {
         $theme->info = unserialize($theme->info);
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.829
diff -u -p -r1.829 node.module
--- modules/node/node.module	7 Jun 2007 03:45:57 -0000	1.829
+++ modules/node/node.module	10 Jun 2007 06:22:22 -0000
@@ -343,7 +343,7 @@ function node_types_rebuild() {
 function node_type_save($info) {
   $is_existing = FALSE;
   $existing_type = !empty($info->old_type) ? $info->old_type : $info->type;
-  $is_existing = db_num_rows(db_query("SELECT * FROM {node_type} WHERE type = '%s'", $existing_type));
+  $is_existing = db_num_rows(db_query("SELECT type FROM {node_type} WHERE type = '%s'", $existing_type));
   if (!isset($info->help)) {
     $info->help = '';
   }
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.794
diff -u -p -r1.794 user.module
--- modules/user/user.module	8 Jun 2007 06:04:15 -0000	1.794
+++ modules/user/user.module	10 Jun 2007 06:22:23 -0000
@@ -1907,10 +1907,10 @@ function user_roles($membersonly = 0, $p
   $roles = array();
 
   if ($permission) {
-    $result = db_query("SELECT r.* FROM {role} r INNER JOIN {permission} p ON r.rid = p.rid WHERE p.perm LIKE '%%%s%%' ORDER BY r.name", $permission);
+    $result = db_query("SELECT r.rid, r.name FROM {role} r INNER JOIN {permission} p ON r.rid = p.rid WHERE p.perm LIKE '%%%s%%' ORDER BY r.name", $permission);
   }
   else {
-    $result = db_query('SELECT * FROM {role} ORDER BY name');
+    $result = db_query('SELECT role, name FROM {role} ORDER BY name');
   }
   while ($role = db_fetch_object($result)) {
     if (!$membersonly || ($membersonly && $role->rid != DRUPAL_ANONYMOUS_RID)) {
@@ -2015,7 +2015,7 @@ function theme_user_admin_perm($form) {
 
 function user_admin_perm_submit($form, &$form_state) {
   // Save permissions:
-  $result = db_query('SELECT * FROM {role}');
+  $result = db_query('SELECT rid FROM {role}');
   while ($role = db_fetch_object($result)) {
     if (isset($form_state['values'][$role->rid])) {
       // Delete, so if we clear every checkbox we reset that role;
@@ -2045,7 +2045,7 @@ function user_admin_role() {
       drupal_goto('admin/user/roles');
     }
     // Display the edit role form.
-    $role = db_fetch_object(db_query('SELECT * FROM {role} WHERE rid = %d', $id));
+    $role = db_fetch_object(db_query('SELECT name FROM {role} WHERE rid = %d', $id));
     $form['name'] = array(
       '#type' => 'textfield',
       '#title' => t('Role name'),