4
4
479112021-04-06 12:22:52
PHP
47911, 2021-04-06 12:22:52

Why is the string truncated to length 65535?

There is Joomla! 3.9.24 + php-fpm 7.4
In general, a situation arises: in the "JomSocial" component, I insert an article into discussions, click save, and an error is generated:
>>
0 - Error decoding JSON data: Syntax error
<<
In debugging, I found a place for write "var_dump", and it turned out that the error pops up when the length of the input string reaches 65535. Actually - how to solve the problem? What limits to twist?

Russian text is sent, html code (it is saved). All Russian characters are converted to "\uXXXX" and that's where the number of characters comes from.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
4
47911, 2021-04-11
@47911

Solution found.
There are tables:
#__community_notifications
#__community_activities
#__community_groups_discuss
#__community_mailq
They have fields where information about the discussion is written (let me remind you: the JomSocial component, I'm trying to push text longer than 65535 into the discussion) - an error is thrown, because. one or more tables have fields with "field length" up to 65535 characters - an error occurs. You need to change the field length to a larger one (Field type: mediumtext - thanks Sergey delphinpro , Dmitry , you were right. The data is simply not written in the 1st place). I don’t give the names of the fields because: if you yourself can’t figure it out, it’s better not to go there yourself.

S
Sergey delphinpro, 2021-04-06
@delphinpro

The column in the database that stores the json string is 65535 bytes long
. Given that the component is quite old, it is probably of type TEXT and not JSON. You can try to change to MEDIUMTEXT.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question