Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-4558

Increase db text size for all user inputs

    Details

      Description

      As CKEditor now turns images into base64 strings when a user pastes an image, we need to increase the TEXT columns in the DB to MEDIUMTEXT.

      TEXT allows 64 KB which seems to be quite small for a medium size picture turned into base64 string.

      Therefore the next size up is MEDIUMTEXT which would allow 16MB instead.

      Now, by no means we will encourage people to paste image rather than uploading them, but this is a trend that will continue to occur and a behaviour that users now expect.

        Issue Links

          Activity

          Hide
          ernieg Ernie Ghiglione added a comment -
          Fiona, I have identified all the following fields that would require changes. I did this by dumping the db and going thru all the TEXT column types and evaluate whether they are user input and use the CKEditor (or potentially can use it).

          As such, I came up with the file attached.

          Now, can you please review these and add these to patch files for each of the projects involved?

          While it might sound convenient to just run this as a patch in common/central, we have had a lot of issues doing that in the past where tools weren't installed, so it's better to have them each in each tool.

          Let me know if you think I have missed any other table/columns.

          Thanks
          Show
          ernieg Ernie Ghiglione added a comment - Fiona, I have identified all the following fields that would require changes. I did this by dumping the db and going thru all the TEXT column types and evaluate whether they are user input and use the CKEditor (or potentially can use it). As such, I came up with the file attached. Now, can you please review these and add these to patch files for each of the projects involved? While it might sound convenient to just run this as a patch in common/central, we have had a lot of issues doing that in the past where tools weren't installed, so it's better to have them each in each tool. Let me know if you think I have missed any other table/columns. Thanks
          Hide
          fionam Fiona Malikoff added a comment -
          Changes needed to the environment to support non-trivial sized pictures:

          (1) Set/increase the max_allowed_packet in mysql as it trips the default 4MB limit.
          In your my.ini / my.cnf add
          [mysqld]
          max_allowed_packet=20MB

          (2) Increase the Java Heap Space to at least -Xmx1024m, rather than the default -Xmx512m. If you are using larger photos or In production it will probably need to be -Xmx2048m.

          Changes to Ernie's original list of columns:
          ASSESSMENT
          ALTER TABLE tl_laasse10_question_option MODIFY question MEDIUMTEXT;
          ALTER TABLE tl_laasse10_question_option MODIFY option_string MEDIUMTEXT; -- modified table name
          ALTER TABLE tl_laasse10_question_option MODIFY feedback MEDIUMTEXT; -- modified table name
          ALTER TABLE tl_laasse10_question_result MODIFY answer_string MEDIUMTEXT;

          Doku
          ALTER TABLE tl_ladoku11_dokumaran MODIFY content MEDIUMTEXT; -- added to list
          ALTER TABLE tl_ladoku11_dokumaran MODIFY reflect_instructions MEDIUMTEXT; -- added to list

          Show
          fionam Fiona Malikoff added a comment - Changes needed to the environment to support non-trivial sized pictures: (1) Set/increase the max_allowed_packet in mysql as it trips the default 4MB limit. In your my.ini / my.cnf add [mysqld] max_allowed_packet=20MB (2) Increase the Java Heap Space to at least -Xmx1024m, rather than the default -Xmx512m. If you are using larger photos or In production it will probably need to be -Xmx2048m. Changes to Ernie's original list of columns: ASSESSMENT ALTER TABLE tl_laasse10_question_option MODIFY question MEDIUMTEXT; ALTER TABLE tl_laasse10_question_option MODIFY option_string MEDIUMTEXT; -- modified table name ALTER TABLE tl_laasse10_question_option MODIFY feedback MEDIUMTEXT; -- modified table name ALTER TABLE tl_laasse10_question_result MODIFY answer_string MEDIUMTEXT; Doku ALTER TABLE tl_ladoku11_dokumaran MODIFY content MEDIUMTEXT; -- added to list ALTER TABLE tl_ladoku11_dokumaran MODIFY reflect_instructions MEDIUMTEXT; -- added to list
          Hide
          fionam Fiona Malikoff added a comment -
          Ready to test.
          Show
          fionam Fiona Malikoff added a comment - Ready to test.
          Hide
          ernieg Ernie Ghiglione added a comment -
          Tested and closed. Thanks Fiona
          Show
          ernieg Ernie Ghiglione added a comment - Tested and closed. Thanks Fiona
          Hide
          ernieg Ernie Ghiglione added a comment -
          Fiona,

          As you have pointed out, the filename are 1 month into the future :-)

          Thanks
          Show
          ernieg Ernie Ghiglione added a comment - Fiona, As you have pointed out, the filename are 1 month into the future :-) Thanks
          Hide
          fionam Fiona Malikoff added a comment -
          Filenames fixed.
          Show
          fionam Fiona Malikoff added a comment - Filenames fixed.
          Hide
          ernieg Ernie Ghiglione added a comment -
          Thanks Fiona once again.
          Show
          ernieg Ernie Ghiglione added a comment - Thanks Fiona once again.

            People

            • Assignee:
              fionam Fiona Malikoff
              Reporter:
              ernieg Ernie Ghiglione
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development