Pushing some developing code for Josh
Jeremy D

Jeremy D commited on 2011-11-06 19:33:41
Showing 1 changed files, with 21 additions and 2 deletions.

... ...
@@ -28,6 +28,8 @@ ini_set('display_errors', 1);
28 28
 */
29 29
 
30 30
 /* This is my debugging for debugging queries.
31
+# php converter.php --tbg_loc=/home/dev/thebuggenie-3.1.4/core --tbg_db_pass=test --mantis_loc=/home/dev/mantisbt-1.2.8/
32
+
31 33
 exit(var_dump($this->tbg_db->errorInfo()));
32 34
 */
33 35
 
... ...
@@ -890,17 +892,31 @@ class mbt_to_tbg extends tbg_converter
890 892
 				bn.id, bn.bug_id AS target_id, bn.last_modified AS updated, bn.date_submitted AS posted,
891 893
 				bn.reporter_id AS updated_by, bn.reporter_id AS posted_by, bnt.note AS content
892 894
 				FROM ' . $this->mbt_db_prefix . 'bugnote_table AS bn
893
-					INNER JOIN ' . $this->mbt_db_prefix . 'bugnote_text_table AS bnt ON (bn.id = bnt.id)
895
+					INNER JOIN ' . $this->mbt_db_prefix . 'bugnote_text_table AS bnt ON (bn.bugnote_text_id = bnt.id)
894 896
 			LIMIT ' . $step_size . ' OFFSET ' . $substep;
895 897
 
898
+// The converter doesn't seem to go past 1k comments. WHY!
899
+var_dump($substep); echo "\n";
900
+
896 901
 		$i = 0;
897 902
 		foreach ($this->mantis_db->query($query) as $row)
898 903
 		{
904
+// A random comment we are looking for.  Just contains "*bump*".
905
+if ($row['id'] == 2433)
906
+	var_dump($row);
907
+
908
+			$row['content'] = $this->tbg_db->quote($row['content']);
909
+
910
+
899 911
 			$this->tbg_db->query('
900 912
 				REPLACE INTO ' . $this->tbg_db_prefix . 'comments (id, target_id, target_type, content, posted, updated, updated_by, posted_by)
901 913
 				VALUES (' . $row['id'] . ', ' . $row['target_id'] . ', 1, "' . $row['content'] . '", ' . $row['posted'] . ', ' . $row['updated'] . ', ' . $row['updated_by'] . ', ' . $row['posted_by'] . ')');
902
-
903 914
 			++$i;
915
+
916
+// Only trying to error if we got one.
917
+if ($this->tbg_db->errorCode() != '00000')
918
+	exit(var_dump($this->tbg_db->errorInfo()));
919
+
904 920
 		}
905 921
 
906 922
 		return $i;
... ...
@@ -912,6 +928,9 @@ class mbt_to_tbg extends tbg_converter
912 928
 	*/
913 929
 	function doStep8()
914 930
 	{
931
+// @ TODO REMOVE :P
932
+exit('got done');
933
+
915 934
 		$step_size = 500;
916 935
 		$substep = $this->getSubStep(__FUNCTION__);
917 936
 
918 937