New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modules break if content entered exceeds 65535 characters #24631
Comments
Why on earth are you putting war and peace in a module? |
Heheh. It was actually an admin copy-pasting an image which triggered it - the editor converts that to base64 (which uses a lot of characters). This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24631. |
This happened to one extension of mine too. |
If you submitted a PR then everyone would benefit |
This is a repeat of the usual "X field in Y table should be changed from TEXT to LONGTEXT because I'm trying to store too much data into this database column" request, only I think this might be the first for |
Maybe this one #19618 |
I don't think it should be changed to LONGTEXT - it's ultimately a mistake to add that much text. The bug I'm reporting is that it breaks the site rather than fails gracefully, due to the field containing a JSON string which is not being validated for its length and so becomes invalid when it doesn't save properly. Admins always do unexpected things they they need to be told not to - massive images etc, but to be able to actually break the site doing something unwise but understandable (pasting an image into the editor in this case) seems like a bug that needs fixing. It could perhaps be argued that the issue is TinyMCE converting pasted images to base64, I suppose. The result is the same. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24631. |
with #24635 now a check is made to prevent this behaviour |
Closed as having Pull Request. |
Steps to reproduce the issue
Create a module containing a field type of editor.
Using this module, enter any content which exceeds 65535 characters.
Expected result
An admin would expect it just to save all the content, but realistically a warning saying you cannot enter that much content, and the ability to edit down accordingly would seem sensible.
Actual result
An "Error decoding JSON data" error appears on both the front and back end of the site (when you try and edit the module, or view it on the front). The module cannot then be accessed via the admin, and if you go into the database you notice that the JSON string is incomplete, as it has only saved the first 65535 characters.
Additional comments
I suspect what is required is to validate the json string for length before adding it to the database.
I tried using the customContent method of adding data. This doesn't break as seriously (as it does not use json), but any additional characters are also cropped.
The text was updated successfully, but these errors were encountered: