Bad SQL for snippets_insert()

vmole - April 9, 2005 - 20:19
Project:Code Snippets
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

The number of data values doesn't match the column list, it's missing the fname value. Here's the diff, against snippets.module v 1.9:

--- snippets.module (revision 18)
+++ snippets.module (working copy)
@@ -92,7 +92,7 @@
* Implementation of the hook_insert()
*/
function snippets_insert($node) {
- db_query("INSERT INTO {snippets} (nid, snippet, fname, tip, code) VALUES (%d, '%s', '%s', '%s')", $node->nid, $node->snippet, $node->tip, $node->code);
+ db_query("INSERT INTO {snippets} (nid, snippet, fname, tip, code) VALUES (%d, '%s', '%s', '%s', '%s')", $node->nid, $node->snippet, strtolower($node->fname), $node->tip, $node->code);
}

 
 

Drupal is a registered trademark of Dries Buytaert.