Issue didnt show under a project
Jeremy D

Jeremy D commited on 2011-11-06 16:30:17
Showing 1 changed files, with 7 additions and 3 deletions.

... ...
@@ -32,6 +32,9 @@ ini_set('display_errors', 1);
32 32
 * Converting categories doesn't sort them properly for which category they existed.
33 33
 * Converting versions doesn't work when repeated due to the data existing in builds already and is skipped.  Step 0 anyone?
34 34
 * Doesn't add the default wiki pages upon creating a project.
35
+* Issue conversion doesn't fix state.
36
+* Issue conversion doesn't fix issuetype.
37
+* Issue conversion doesn't fix severity.
35 38
 */
36 39
 
37 40
 class tbg_converter
... ...
@@ -819,9 +822,10 @@ class mbt_to_tbg extends tbg_converter
819 822
 
820 823
 		$query = '
821 824
 			SELECT
822
-				bt.id, bt.project_id, bt.summary AS title, bt.handler_id AS assigned_to, bt.duplicate_id AS duplicate_of,
825
+				bt.id, bt.id AS issue_no, bt.project_id, bt.summary AS title, bt.handler_id AS assigned_to, bt.duplicate_id AS duplicate_of,
823 826
 				bt.date_submitted AS posted, bt.last_updated,
824 827
 				0 AS state /* NEEDS FIXED */,
828
+				1 AS issuetype /* NEEDS FIXED */,
825 829
 				
826 830
 				bt.category_id AS category, bt.resolution,
827 831
 				bt.priority,
... ...
@@ -843,8 +847,8 @@ class mbt_to_tbg extends tbg_converter
843 847
 		foreach ($this->mantis_db->query($query) as $row)
844 848
 		{
845 849
 			$this->tbg_db->query('
846
-				REPLACE INTO ' . $this->tbg_db_prefix . 'issues (id, project_id, title, assigned_to, duplicate_of, posted, last_updated, state, category, resolution, priority, severity, reproducability)
847
-				VALUES (' . $row['id'] . ', ' . $row['project_id'] . ', "' . $row['title'] . '", ' . $row['assigned_to'] . ', ' . $row['duplicate_of'] . ', ' . $row['posted'] . ', ' . $row['last_updated'] . ', ' . $row['state'] . ', ' . $row['category'] . ',  ' . $row['resolution'] . ', ' . $row['priority'] . ', ' . $row['severity'] . ', ' . $row['reproducability'] . ')
850
+				REPLACE INTO ' . $this->tbg_db_prefix . 'issues (id, issue_no, project_id, title, assigned_to, duplicate_of, posted, last_updated, state, issuetype, category, resolution, priority, severity, reproducability)
851
+				VALUES (' . $row['id'] . ', ' . $row['issue_no'] . ', ' . $row['project_id'] . ', "' . $row['title'] . '", ' . $row['assigned_to'] . ', ' . $row['duplicate_of'] . ', ' . $row['posted'] . ', ' . $row['last_updated'] . ', ' . $row['state'] . ', ' . $row['issuetype'] . ', ' . $row['category'] . ',  ' . $row['resolution'] . ', ' . $row['priority'] . ', ' . $row['severity'] . ', ' . $row['reproducability'] . ')
848 852
 			');
849 853
 
850 854
 			// This attempts to find any versions that got missed, but isn't accurate.
851 855