Does Elgg's longtext have a character limit, if yes, how can I increase this limit?

I am trying to add a very long page text, after adding the text in the longtext box, when I save it, the saved text is truncated, that is, a part of the message is removed like a character limit has been exceeded. Take a look at the descriptive images below.

 

  • Fix MySQL tables:

    1 - backup your Elgg DB

    2 - via SSH  type following  SQL commands:

    mysql -u {USERNAME} -p{PASSWORD}

    mysql > use {DATABASE};

    mysql > ALTER TABLE `PREFIX_metastrings` CHANGE `string` `string` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;

    mysql > ALTER TABLE `PREFIX_objects_entity` CHANGE `description` `description` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

    Note: replace PREFIX with your own table prefix (usually elgg_)

    This is allows to store larger texts and an output display limit at 4Gb

  • Thanks @rivervanrain perhaps, there is an alternative method to modifying the database using Elgg's API functions as iinoly had discouraged directly modifying the database in a reply to an earlier discussion:

    https://elgg.org/discussion/view/2631567/fields-in-the-elgg-database-in-231#elgg-object-2631841

    @iionly how can i resolve this issue from the Elgg's API functions you had encouraged for use in retrieving or modifying database entries. Thank you.

  • I was referring to database entries when saying that manual modification of database content is risky and better not done directly but with the Elgg API functions. This way you can be sure that the consistency of the database doesn't get broken. The point is: there's not just a stand-alone single row in a specific database table alone that makes up all of a database entity like a user or content entity. If you know exactly what to do, you can manipulate the database directly. But in most cases this is not even necessary.

    But the maximum length of a database column entry is something else. There's no Elgg API function available that I know of that would change that. Elgg creates the database on installation with a specific structure and the database columns will have the types as seen right by the Elgg developers and that should be sufficient under normal conditions.

    If you think it necessary to save larger amount of content (e.g. text) in a single object like a blog or comment, it will require to modify the database structure as @RvR described (never did that myself so I can't say if there are any negative consequences to be expected by doing so).

    But does it make sense to save such large amount of content in a single text-type entity like a comment or blog? It seems awefully annoying if I would have such an endless single posting to read. Why not split the text into smaller parts? Or why not uploading it as a file (e.g. txt or pdf or doc etc.) using the files plugin instead?

  • @iionly thanks for the clearification and suggestions. Now i have all options to consider and thanks again @RvR.