Patch #1404 » D1071_enlarge_wiki_content.patch
| app/controllers/wiki_controller.rb (working copy) | ||
|---|---|---|
|
@content.attributes = params[:content]
|
||
|
@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)
|
||
|
if (@page.new_record? ? @page.save! : @content.save!)
|
||
|
redirect_to :action => 'index', :id => @project, :page => @page.title
|
||
|
end
|
||
|
end
|
||
|
rescue ActiveRecord::StatementInvalid
|
||
|
# Content too long for database
|
||
|
flash[:error] = l(:text_wiki_content_too_large)
|
||
|
rescue ActiveRecord::StaleObjectError
|
||
|
# Optimistic locking exception
|
||
|
flash[:error] = l(:notice_locking_conflict)
|
||
| db/migrate/095_alter_wiki_content_text_size.rb (revision 0) | ||
|---|---|---|
|
class AlterWikiContentTextSize < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
change_column :wiki_contents, :text, :text, :limit => 64.kilobytes * 2
|
||
|
change_column :wiki_content_versions, :data, :binary, :limit => 64.kilobytes * 2
|
||
|
end
|
||
|
def self.down
|
||
|
change_column :wiki_content_versions, :data, :binary
|
||
|
change_column :wiki_contents, :text, :text
|
||
|
end
|
||
|
end
|
||
| lang/bg.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/cs.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/da.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/de.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/en.yml (working copy) | ||
|---|---|---|
|
text_assign_time_entries_to_project: Assign reported hours to the project
|
||
|
text_reassign_time_entries: 'Reassign reported hours to this issue:'
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
|
default_role_manager: Manager
|
||
|
default_role_developper: Developer
|
||
| lang/es.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/fi.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/fr.yml (working copy) | ||
|---|---|---|
|
text_destroy_time_entries: Supprimer les heures
|
||
|
text_assign_time_entries_to_project: Reporter les heures sur le projet
|
||
|
text_reassign_time_entries: 'Reporter les heures sur cette demande:'
|
||
|
text_user_wrote: '%s a écrit:'
|
||
|
text_user_wrote: '%s a écrit
|
||
|
text_wiki_content_too_large: Le contenu de cette page de wiki est trop grand. Merci de le réduire.
|
||
|
default_role_manager: Manager
|
||
|
default_role_developper: Développeur
|
||
| lang/he.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/hu.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d feladat határidős az elkövetkező napokban"
|
||
|
text_user_wrote: '%s írta:'
|
||
|
label_duplicated_by: duplikálta
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/it.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/ja.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/ko.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/lt.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/nl.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/no.yml (working copy) | ||
|---|---|---|
|
text_assign_time_entries_to_project: Overfør førte timer til prosjektet
|
||
|
text_reassign_time_entries: 'Overfør førte timer til denne saken:'
|
||
|
text_user_wrote: '%s skrev:'
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
|
default_role_manager: Leder
|
||
|
default_role_developper: Utvikler
|
||
| lang/pl.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/pt-br.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/pt.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/ro.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/ru.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d назначенных на вас задач в ближайшие дни"
|
||
|
text_user_wrote: '%s написал:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/sr.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/sv.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/th.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/uk.yml (working copy) | ||
|---|---|---|
|
mail_subject_reminder: "%d issue(s) due in the next days"
|
||
|
text_user_wrote: '%s wrote:'
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/zh-tw.yml (working copy) | ||
|---|---|---|
|
enumeration_issue_priorities: 項目優先權
|
||
|
enumeration_doc_categories: 文件分類
|
||
|
enumeration_activities: 活動 (時間追蹤)
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| lang/zh.yml (working copy) | ||
|---|---|---|
|
enumeration_doc_categories: 文档类别
|
||
|
enumeration_activities: 活动(时间跟踪)
|
||
|
label_duplicated_by: duplicated by
|
||
|
text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
|
||
| test/unit/wiki_content_test.rb (working copy) | ||
|---|---|---|
|
assert_equal User.find(1), content.author
|
||
|
assert_equal content.text, content.versions.last.text
|
||
|
end
|
||
|
|
||
|
def test_very_big_create
|
||
|
page = WikiPage.new(:wiki => @wiki, :title => "Big big page")
|
||
|
big_text = "X" * 1024 * 64
|
||
|
bt_l = big_text.length
|
||
|
puts "text length: #{bt_l}"
|
||
|
page.content = WikiContent.new(:text => big_text, :author => User.find(1), :comments => "Eat that, MySQL")
|
||
|
page.save
|
||
|
assert_equal bt_l, WikiPage.find(page.id).content.text.length, "Wiki content lost!"
|
||
|
end
|
||
|
def test_update
|
||
|
content = @page.content
|
||