Skip to content

Commit ed1823c

Browse files
author
Tom Copeland
committed
Need to flatten forum threads
1 parent b14936c commit ed1823c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.rdoc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ Migration FIXMEs
1717
* need to upgrade base redmine to latest release - 0.9.5
1818
* why does [email protected]/password have no issues here /my/page
1919
* need to populate activity, e.g., /projects/support/activity
20-
* some message threads have missing messages after migration, e.g.
21-
http://rubyforge.org/forum/message.php?msg_id=92
22-
vs
23-
http://localhost:3000/boards/1/topics/13
2420

2521
Redmine FIXMEs
2622
* will need to modify Redmine auth to use MD5 since that's what GForge uses
@@ -58,6 +54,7 @@ Some notes on the differences between the GForge and the Redmine object models:
5854
* GForge stores the user language setting as a foreign key into the <tt>supported_languages</tt> table. Redmine stores it as a two letter string (e.g., 'en') in <tt>users.language</tt>.
5955
* The GForge <tt>artifact_group_list</tt> table gets mapped into rows in the Redmine <tt>projects_trackers</tt> table (<tt>projects</tt> HABTM <tt>trackers</tt>). Redmine <tt>trackers</tt> are not per <tt>project</tt>; they are shared for the whole system. The current migration only provisions rows in the <tt>projects_trackers</tt> table as they are needed - e.g., a <tt>project</tt> won't get a "Bug" <tt>tracker</tt> unless there's a GForge <tt>artifact</tt> in a "Bug" GForge <tt>artifact_group_list</tt> in this project. If there's a GForge <tt>artifact_group_list</tt> with an unexpected name (e.g., "Tom's Issues") those get mapped into the "Bug" <tt>tracker</tt>.
6056
* GForge <tt>artifacts</tt> have only three statuses (open/closed/deleted) whereas Redmine issues have six possible <tt>IssueStatus</tt> settings, so I just map them over to the <tt>IssueStatus</tt> with the same name. GForge <tt>artifacts</tt> have five priority levels; these map onto Redmine's five standard <tt>IssueCategory</tt> values.
57+
* The GForge forum system handles nested message threads whereas Redmine forum threads are flat (<a href="http://www.redmine.org/boards/1/topics/15509">details</a>). So there's some lost information there, but, meh.
6158

6259

6360
=== GForge table to Redmine table mapping

lib/tasks/migrate_from_gforge.rake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,15 @@ namespace :redmine do
9999
end
100100
board_threads[forum_message.id] = message
101101
if forum_message.is_followup_to
102-
message.parent = board_threads[forum_message.is_followup_to]
102+
possible_parent = board_threads[forum_message.is_followup_to]
103+
# Redmine has flat message replies, GForge has nested replies
104+
# See http://www.redmine.org/boards/1/topics/15509 for more details
105+
# So, flattening the GForge threads
106+
if possible_parent && possible_parent.parent
107+
message.parent = possible_parent.parent
108+
else
109+
message.parent = possible_parent
110+
end
103111
message.save!
104112
end
105113
end

0 commit comments

Comments
 (0)