Index: test/unit/wiki_content_test.rb
===================================================================
--- test/unit/wiki_content_test.rb	(révision 1736)
+++ test/unit/wiki_content_test.rb	(copie de travail)
@@ -40,6 +40,16 @@
     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
Index: test/functional/issues_controller_test.rb
===================================================================
--- test/functional/issues_controller_test.rb	(révision 1736)
+++ test/functional/issues_controller_test.rb	(copie de travail)
@@ -448,6 +448,7 @@
          :attachments => {'1' => {'file' => test_uploaded_file('testfile.txt', 'text/plain')}}
     assert_redirected_to 'issues/show/1'
     j = Issue.find(1).journals.find(:first, :order => 'id DESC')
+    puts j.notes
     assert j.notes.blank?
     assert_equal 1, j.details.size
     assert_equal 'testfile.txt', j.details.first.value
Index: app/controllers/wiki_controller.rb
===================================================================
--- app/controllers/wiki_controller.rb	(révision 1736)
+++ app/controllers/wiki_controller.rb	(copie de travail)
@@ -72,10 +72,13 @@
       @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)
Index: lang/lt.yml
===================================================================
--- lang/lt.yml	(révision 1736)
+++ lang/lt.yml	(copie de travail)
@@ -637,3 +637,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/uk.yml
===================================================================
--- lang/uk.yml	(révision 1736)
+++ lang/uk.yml	(copie de travail)
@@ -636,3 +636,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/ro.yml
===================================================================
--- lang/ro.yml	(révision 1736)
+++ lang/ro.yml	(copie de travail)
@@ -634,3 +634,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/zh.yml
===================================================================
--- lang/zh.yml	(révision 1736)
+++ lang/zh.yml	(copie de travail)
@@ -635,3 +635,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/pt.yml
===================================================================
--- lang/pt.yml	(révision 1736)
+++ lang/pt.yml	(copie de travail)
@@ -634,3 +634,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/da.yml
===================================================================
--- lang/da.yml	(révision 1736)
+++ lang/da.yml	(copie de travail)
@@ -636,3 +636,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/sr.yml
===================================================================
--- lang/sr.yml	(révision 1736)
+++ lang/sr.yml	(copie de travail)
@@ -635,3 +635,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/ru.yml
===================================================================
--- lang/ru.yml	(révision 1736)
+++ lang/ru.yml	(copie de travail)
@@ -638,3 +638,4 @@
 text_email_delivery_not_configured: "Параметры работы с почтовым сервером не настроены и функция уведомления по email не активна.\nНастроить параметры для вашего SMTP сервера вы можете в файле config/email.yml. Для применения изменений перезапустите приложение."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/de.yml
===================================================================
--- lang/de.yml	(révision 1736)
+++ lang/de.yml	(copie de travail)
@@ -635,3 +635,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/bg.yml
===================================================================
--- lang/bg.yml	(révision 1736)
+++ lang/bg.yml	(copie de travail)
@@ -634,3 +634,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/sv.yml
===================================================================
--- lang/sv.yml	(révision 1736)
+++ lang/sv.yml	(copie de travail)
@@ -635,3 +635,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/ja.yml
===================================================================
--- lang/ja.yml	(révision 1736)
+++ lang/ja.yml	(copie de travail)
@@ -635,3 +635,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/he.yml
===================================================================
--- lang/he.yml	(révision 1736)
+++ lang/he.yml	(copie de travail)
@@ -634,3 +634,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/fi.yml
===================================================================
--- lang/fi.yml	(révision 1736)
+++ lang/fi.yml	(copie de travail)
@@ -634,3 +634,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/en.yml
===================================================================
--- lang/en.yml	(révision 1736)
+++ lang/en.yml	(copie de travail)
@@ -635,3 +635,4 @@
 enumeration_issue_priorities: Issue priorities
 enumeration_doc_categories: Document categories
 enumeration_activities: Activities (time tracking)
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/cs.yml
===================================================================
--- lang/cs.yml	(révision 1736)
+++ lang/cs.yml	(copie de travail)
@@ -639,3 +639,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/fr.yml
===================================================================
--- lang/fr.yml	(révision 1736)
+++ lang/fr.yml	(copie de travail)
@@ -609,6 +609,7 @@
 text_enumeration_destroy_question: 'Cette valeur est affectée à %d objets.'
 text_enumeration_category_reassign_to: 'Réaffecter les objets à cette valeur:'
 text_email_delivery_not_configured: "L'envoi de mail n'est pas configuré, les notifications sont désactivées.\nConfigurez votre serveur SMTP dans config/email.yml et redémarrez l'application pour les activer."
+text_wiki_content_too_large: Le contenu du wiki est trop grand pour votre base de données. Merci de tronquer ce contenu.
 
 default_role_manager: Manager
 default_role_developper: Développeur
Index: lang/es.yml
===================================================================
--- lang/es.yml	(révision 1736)
+++ lang/es.yml	(copie de travail)
@@ -637,3 +637,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/nl.yml
===================================================================
--- lang/nl.yml	(révision 1736)
+++ lang/nl.yml	(copie de travail)
@@ -635,3 +635,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/ko.yml
===================================================================
--- lang/ko.yml	(révision 1736)
+++ lang/ko.yml	(copie de travail)
@@ -634,3 +634,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/zh-tw.yml
===================================================================
--- lang/zh-tw.yml	(révision 1736)
+++ lang/zh-tw.yml	(copie de travail)
@@ -635,3 +635,4 @@
 enumeration_activities: 活動 (時間追蹤)
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/pl.yml
===================================================================
--- lang/pl.yml	(révision 1736)
+++ lang/pl.yml	(copie de travail)
@@ -634,3 +634,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/th.yml
===================================================================
--- lang/th.yml	(révision 1736)
+++ lang/th.yml	(copie de travail)
@@ -637,3 +637,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/no.yml
===================================================================
--- lang/no.yml	(révision 1736)
+++ lang/no.yml	(copie de travail)
@@ -600,6 +600,7 @@
 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
@@ -635,3 +636,4 @@
 text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/email.yml and restart the application to enable them."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/it.yml
===================================================================
--- lang/it.yml	(révision 1736)
+++ lang/it.yml	(copie de travail)
@@ -634,3 +634,4 @@
 text_email_delivery_not_configured: "La consegna via e-mail non è configurata e le notifiche sono disabilitate.\nConfigura il tuo server SMTP in config/email.yml e riavvia l'applicazione per abilitarle."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
Index: lang/hu.yml
===================================================================
--- lang/hu.yml	(révision 1736)
+++ lang/hu.yml	(copie de travail)
@@ -635,3 +635,4 @@
 text_email_delivery_not_configured: "Az E-mail küldés nincs konfigurálva, és az értesítések ki vannak kapcsolva.\nÁllítsd be az SMTP szervert a config/email.yml fájlban és indítsd újra az alkalmazást, hogy érvénybe lépjen."
 field_parent_title: Parent page
 label_issue_watchers: Watchers
+text_wiki_content_too_large: Wiki content is too large for your database. Please truncate it.
