From f165cbfbc2e48319756365819affbcc29f579782 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 16 Aug 2019 08:47:32 +0200 Subject: [PATCH] Fixes issue #2696 - Limit on copy and paste in note box for new articles --- .../controllers/ticket_zoom/article_new.coffee | 2 +- ...ribute_ticket_article_body_maxlength_change.rb | 15 +++++++++++++++ db/seeds/object_manager_attributes.rb | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20190814000001_object_manager_attribute_ticket_article_body_maxlength_change.rb diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee index f8551aa6a..229457f96 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee @@ -168,7 +168,7 @@ class App.TicketZoomArticleNew extends App.Controller @$('[data-name="body"]').ce({ mode: 'richtext' multiline: true - maxlength: 50000 + maxlength: 150000 }) html5Upload.initialize( diff --git a/db/migrate/20190814000001_object_manager_attribute_ticket_article_body_maxlength_change.rb b/db/migrate/20190814000001_object_manager_attribute_ticket_article_body_maxlength_change.rb new file mode 100644 index 000000000..bf22ba4bf --- /dev/null +++ b/db/migrate/20190814000001_object_manager_attribute_ticket_article_body_maxlength_change.rb @@ -0,0 +1,15 @@ +class ObjectManagerAttributeTicketArticleBodyMaxlengthChange < ActiveRecord::Migration[5.1] + def up + return if !Setting.find_by(name: 'system_init_done') + + attribute = ObjectManager::Attribute.get( + object: 'TicketArticle', + name: 'body', + ) + return if !attribute + + attribute.data_option[:maxlength] = 150_000 + attribute.save! + end + +end diff --git a/db/seeds/object_manager_attributes.rb b/db/seeds/object_manager_attributes.rb index c8a3ae0a4..21e6e6e7e 100644 --- a/db/seeds/object_manager_attributes.rb +++ b/db/seeds/object_manager_attributes.rb @@ -447,7 +447,7 @@ ObjectManager::Attribute.add( data_type: 'richtext', data_option: { type: 'richtext', - maxlength: 20_000, + maxlength: 150_000, upload: true, rows: 8, null: true,