[Vtigercrm-commits] [vtiger-commits] r4837 - in /vtigercrm/branches/4.2_postgresql_integration: data/CRMEntity.php install/5createTables.inc.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Apr 3 13:02:16 EDT 2006


Author: allanbush
Date: Mon Apr  3 11:02:13 2006
New Revision: 4837

Log:
Fixed FAQ comment creation by fetching next id value before inserting a new row.  Refs #17.

Modified:
    vtigercrm/branches/4.2_postgresql_integration/data/CRMEntity.php
    vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.php

Modified: vtigercrm/branches/4.2_postgresql_integration/data/CRMEntity.php
==============================================================================
--- vtigercrm/branches/4.2_postgresql_integration/data/CRMEntity.php (original)
+++ vtigercrm/branches/4.2_postgresql_integration/data/CRMEntity.php Mon Apr  3 11:02:13 2006
@@ -753,8 +753,9 @@
 
         $current_time = date('Y-m-d H:i:s');
 
-	$comment = addslashes($_REQUEST['comments']);
-	$sql = "insert into faqcomments values('',".$this->id.",'".$comment."','".$current_time."')";
+	$comment = $adb->quote($_REQUEST['comments']);
+	$id = $adb->getUniqueID("faqcomments_commentid");
+	$sql = "insert into faqcomments values(".$id.",".$this->id.",".$comment.",'".$current_time."')";
 	$adb->query($sql);
 }
 function insertIntoReminderTable($table_name,$module,$recurid)

Modified: vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.php
==============================================================================
--- vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.php (original)
+++ vtigercrm/branches/4.2_postgresql_integration/install/5createTables.inc.php Mon Apr  3 11:02:13 2006
@@ -235,6 +235,7 @@
 $db->getUniqueID("customview");
 $db->getUniqueID("def_org_share");
 $db->getUniqueID("emailtemplates");
+$db->getUniqueID("faqcomments_commentid");
 $db->getUniqueID("field");
 $db->getUniqueID("import_maps");
 $db->getUniqueID("inventorynotification");





More information about the vtigercrm-commits mailing list