summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-13 11:46:39 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-13 11:46:39 +0000
commit94488269d1c3e117fad4acc9be27af10141a32cf (patch)
tree9bf7535e985981316233bb72adb39faaa7d656a7
parent3d0fbea9fdfdea61eaade8bb11d30c472a7c0e7e (diff)
downloadredmine-94488269d1c3e117fad4acc9be27af10141a32cf.tar.gz
redmine-94488269d1c3e117fad4acc9be27af10141a32cf.zip
Merged r2768, r2773, r2774, r2775, r2796 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2882 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/messages_controller.rb2
-rw-r--r--app/controllers/timelog_controller.rb3
-rw-r--r--app/controllers/wiki_controller.rb1
-rw-r--r--app/models/changeset.rb2
-rw-r--r--app/models/query.rb4
-rw-r--r--app/views/common/feed.atom.rxml2
-rw-r--r--app/views/issues/changes.rxml2
-rw-r--r--doc/CHANGELOG4
-rw-r--r--test/fixtures/attachments.yml12
-rw-r--r--test/fixtures/journals.yml7
-rw-r--r--test/functional/issues_controller_test.rb8
-rw-r--r--test/unit/query_test.rb12
12 files changed, 49 insertions, 10 deletions
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index af39efb21..ae11fd2e0 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -46,6 +46,7 @@ class MessagesController < ApplicationController
@message.sticky = params[:message]['sticky']
end
if request.post? && @message.save
+ call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
attach_files(@message, params[:attachments])
redirect_to :action => 'show', :id => @message
end
@@ -58,6 +59,7 @@ class MessagesController < ApplicationController
@reply.board = @board
@topic.children << @reply
if !@reply.new_record?
+ call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
attach_files(@reply, params[:attachments])
end
redirect_to :action => 'show', :id => @topic
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index 58df1f5bc..60cc3916b 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -197,6 +197,9 @@ class TimelogController < ApplicationController
render_403 and return if @time_entry && !@time_entry.editable_by?(User.current)
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
@time_entry.attributes = params[:time_entry]
+
+ call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
+
if request.post? and @time_entry.save
flash[:notice] = l(:notice_successful_update)
redirect_back_or_default :action => 'details', :project_id => @time_entry.project
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index 2dcc6f971..2828941ee 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -82,6 +82,7 @@ class WikiController < ApplicationController
@content.author = User.current
# if page is new @page.save will also save content, but not if page isn't a new record
if (@page.new_record? ? @page.save : @content.save)
+ call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
redirect_to :action => 'index', :id => @project, :page => @page.title
end
end
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index 759d240df..d8b0c18f3 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -112,6 +112,8 @@ class Changeset < ActiveRecord::Base
journal = issue.init_journal(user || User.anonymous, l(:text_status_changed_by_changeset, csettext))
issue.status = fix_status
issue.done_ratio = done_ratio if done_ratio
+ Redmine::Hook.call_hook(:model_changeset_scan_commit_for_issue_ids_pre_issue_update,
+ { :changeset => self, :issue => issue })
issue.save
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
end
diff --git a/app/models/query.rb b/app/models/query.rb
index f3dedf04d..5edefdadf 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -368,9 +368,9 @@ class Query < ActiveRecord::Base
Time.now.at_beginning_of_week
sql = "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(from), connection.quoted_date(from + 7.days)]
when "~"
- sql = "#{db_table}.#{db_field} LIKE '%#{connection.quote_string(value.first)}%'"
+ sql = "LOWER(#{db_table}.#{db_field}) LIKE '%#{connection.quote_string(value.first.to_s.downcase)}%'"
when "!~"
- sql = "#{db_table}.#{db_field} NOT LIKE '%#{connection.quote_string(value.first)}%'"
+ sql = "LOWER(#{db_table}.#{db_field}) NOT LIKE '%#{connection.quote_string(value.first.to_s.downcase)}%'"
end
return sql
diff --git a/app/views/common/feed.atom.rxml b/app/views/common/feed.atom.rxml
index a24a33de6..f50b1f2f8 100644
--- a/app/views/common/feed.atom.rxml
+++ b/app/views/common/feed.atom.rxml
@@ -24,7 +24,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
end if author
xml.content "type" => "html" do
- xml.text! textilizable(item.event_description)
+ xml.text! textilizable(item, :event_description, :only_path => false)
end
end
end
diff --git a/app/views/issues/changes.rxml b/app/views/issues/changes.rxml
index 43324cfb8..4c1e678bf 100644
--- a/app/views/issues/changes.rxml
+++ b/app/views/issues/changes.rxml
@@ -23,7 +23,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.text! '<li>' + show_detail(detail, false) + '</li>'
end
xml.text! '</ul>'
- xml.text! textilizable(change.notes) unless change.notes.blank?
+ xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
end
end
end
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index c44079123..5bdda5b41 100644
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -11,8 +11,10 @@ http://www.redmine.org/
* Do not require a non-word character after a comma in Redmine links
* Include issue hyperlinks in reminder emails
* Fixed: 500 Internal Server Error is raised if add an empty comment to the news
-* Fixes: Atom links for wiki pages are not correct
+* Fixed: Atom links for wiki pages are not correct
* Fixed: Atom feeds leak email address
+* Fixed: Case sensitivity in Issue filtering
+* Fixed: When reading RSS feed, the inline-embedded images are not properly shown
== 2009-05-17 v0.8.4
diff --git a/test/fixtures/attachments.yml b/test/fixtures/attachments.yml
index 2497bd9a3..94c118f9e 100644
--- a/test/fixtures/attachments.yml
+++ b/test/fixtures/attachments.yml
@@ -109,4 +109,16 @@ attachments_009:
filename: version_file.zip
author_id: 2
content_type: application/octet-stream
+attachments_010:
+ created_on: 2006-07-19 21:07:27 +02:00
+ container_type: Issue
+ container_id: 2
+ downloads: 0
+ disk_filename: 060719210727_picture.jpg
+ digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
+ id: 10
+ filesize: 452
+ filename: picture.jpg
+ author_id: 2
+ content_type: image/jpeg
\ No newline at end of file
diff --git a/test/fixtures/journals.yml b/test/fixtures/journals.yml
index 70aa5da73..3ee66ae6b 100644
--- a/test/fixtures/journals.yml
+++ b/test/fixtures/journals.yml
@@ -13,4 +13,11 @@ journals_002:
journalized_type: Issue
user_id: 2
journalized_id: 1
+journals_003:
+ created_on: <%= 1.days.ago.to_date.to_s(:db) %>
+ notes: "A comment with inline image: !picture.jpg!"
+ id: 3
+ journalized_type: Issue
+ user_id: 2
+ journalized_id: 2
\ No newline at end of file
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 842f9f35d..3836185e4 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -255,6 +255,14 @@ class IssuesControllerTest < Test::Unit::TestCase
:child => { :tag => 'legend',
:content => /Notes/ } }
end
+
+ def test_show_atom
+ get :show, :id => 2, :format => 'atom'
+ assert_response :success
+ assert_template 'changes'
+ # Inline image
+ assert @response.body.include?("&lt;img src=\"http://test.host/attachments/download/10\" alt=\"\" /&gt;")
+ end
def test_show_export_to_pdf
get :show, :id => 3, :format => 'pdf'
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index ac3e3cadc..1f1b96b41 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -150,15 +150,17 @@ class QueryTest < Test::Unit::TestCase
def test_operator_contains
query = Query.new(:project => Project.find(1), :name => '_')
- query.add_filter('subject', '~', ['string'])
- assert query.statement.include?("#{Issue.table_name}.subject LIKE '%string%'")
- find_issues_with_query(query)
+ query.add_filter('subject', '~', ['uNable'])
+ assert query.statement.include?("LOWER(#{Issue.table_name}.subject) LIKE '%unable%'")
+ result = find_issues_with_query(query)
+ assert result.empty?
+ result.each {|issue| assert issue.subject.downcase.include?('unable') }
end
def test_operator_does_not_contains
query = Query.new(:project => Project.find(1), :name => '_')
- query.add_filter('subject', '!~', ['string'])
- assert query.statement.include?("#{Issue.table_name}.subject NOT LIKE '%string%'")
+ query.add_filter('subject', '!~', ['uNable'])
+ assert query.statement.include?("LOWER(#{Issue.table_name}.subject) NOT LIKE '%unable%'")
find_issues_with_query(query)
end