From a52417eca9311aabaeaab847873aea52cb78ce52 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 29 Nov 2010 19:34:19 +0000 Subject: [PATCH] Escapes attachment ids in TracMigrate (#6996). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4449 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/tasks/migrate_from_trac.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake index d99e4a32a..0510be51e 100644 --- a/lib/tasks/migrate_from_trac.rake +++ b/lib/tasks/migrate_from_trac.rake @@ -167,7 +167,7 @@ namespace :redmine do has_many :attachments, :class_name => "TracAttachment", :finder_sql => "SELECT DISTINCT attachment.* FROM #{TracMigrate::TracAttachment.table_name}" + " WHERE #{TracMigrate::TracAttachment.table_name}.type = 'ticket'" + - ' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{id}\'' + ' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{TracMigrate::TracAttachment.connection.quote_string(id.to_s)}\'' has_many :customs, :class_name => "TracTicketCustom", :foreign_key => :ticket def ticket_type @@ -207,7 +207,7 @@ namespace :redmine do has_many :attachments, :class_name => "TracAttachment", :finder_sql => "SELECT DISTINCT attachment.* FROM #{TracMigrate::TracAttachment.table_name}" + " WHERE #{TracMigrate::TracAttachment.table_name}.type = 'wiki'" + - ' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{id}\'' + ' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{TracMigrate::TracAttachment.connection.quote_string(id.to_s)}\'' def self.columns # Hides readonly Trac field to prevent clash with AR readonly? method (Rails 2.0)