We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Database problem //SOLVED - CKEditor | Forum

Peter
Peter Feb 9 '20
Hello, can you help mi with this:

After publishing blog post with Ckeditor enabled, and then editing and saving thi post, the table: "ow_newsfeed_action" row related to this blog post, is filled wit too many garbage data like this "\\\\\\"
When you edit and save the same post for example 20 times, the column "data" "in ow_newsfeed_action" table is filled with this data to a level, that will drop the database connection because "max_allowed_packet" size.
I have max_allowed_packet set to 1024 MB, and after I edit post 20 times, the process kill the database, even it is set to such a high level.

Testing on default oxwall installation, default plugins.

Please can you reproduce that?
The Forum post is edited by Peter Feb 9 '20
ArtMedia
ArtMedia Feb 9 '20
this could be related with disabling filtering html tags on wysiwyg textarea field. Problem is when somebody copy text from eg. Word to ckeditor textarea field, then you have many unwanted tags on source code
Peter
Peter Feb 9 '20

This is an example of the given "data" value in the above table after 10 edits and sample text. After first publishing everything is OK.  The problem  with "\\\\\\\" only occurs after editing.


{"time":1581284948,"ownerId":"1","string":{"key":"blogs+feed_add_item_label"},"content":{"format":"content","vars":{"title":"test","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Etiam non quam lacus suspe...","url":{"routeName":"post","vars":{"id":"27"}},"iconClass":"ow_ic_blog"}},"view":{"iconClass":"ow_ic_write"},"actionDto":{"entityId":27,"entityType":"blog-post","pluginKey":"blogs","data":"{\"time\":1581284948,\"ownerId\":\"1\",\"string\":{\"key\":\"blogs+feed_add_item_label\"},\"content\":{\"format\":\"content\",\"vars\":{\"title\":\"test\",\"description\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Etiam non quam lacus suspe...\",\"url\":{\"routeName\":\"post\",\"vars\":{\"id\":\"27\"}},\"iconClass\":\"ow_ic_blog\"}},\"view\":{\"iconClass\":\"ow_ic_write\"},\"actionDto\":{\"entityId\":27,\"entityType\":\"blog-post\",\"pluginKey\":\"blogs\",\"data\":\"{\\\"time\\\":1581284948,\\\"ownerId\\\":\\\"1\\\",\\\"string\\\":{\\\"key\\\":\\\"blogs+feed_add_item_label\\\"},\\\"content\\\":{\\\"format\\\":\\\"content\\\",\\\"vars\\\":{\\\"title\\\":\\\"test\\\",\\\"description\\\":\\\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Etiam non quam lacus suspe...\\\",\\\"url\\\":{\\\"routeName\\\":\\\"post\\\",\\\"vars\\\":{\\\"id\\\":\\\"27\\\"}},\\\"iconClass\\\":\\\"ow_ic_blog\\\"}},\\\"view\\\":{\\\"iconClass\\\":\\\"ow_ic_write\\\"},\\\"actionDto\\\":{\\\"entityId\\\":27,\\\"entityType\\\":\\\"blog-post\\\",\\\"pluginKey\\\":\\\"blogs\\\",\\\"data\\\":\\\"{\\\\\\\"time\\\\\\\":1581284948,\\\\\\\"ownerId\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"string\\\\\\\":{\\\\\\\"key\\\\\\\":\\\\\\\"blogs+feed_add_item_label\\\\\\\"},\\\\\\\"content\\\\\\\":{\\\\\\\"format\\\\\\\":\\\\\\\"content\\\\\\\",\\\\\\\"vars\\\\\\\":{\\\\\\\"title\\\\\\\":\\\\\\\"test\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Etiam non quam lacus suspe...\\\\\\\",\\\\\\\"url\\\\\\\":{\\\\\\\"routeName\\\\\\\":\\\\\\\"post\\\\\\\",\\\\\\\"vars\\\\\\\":{\\\\\\\"id\\\\\\\":\\\\\\\"27\\\\\\\"}},\\\\\\\"iconClass\\\\\\\":\\\\\\\"ow_ic_blog\\\\\\\"}},\\\\\\\"view\\\\\\\":{\\\\\\\"iconClass\\\\\\\":\\\\\\\"ow_ic_write\\\\\\\"},\\\\\\\"actionDto\\\\\\\":{\\\\\\\"entityId\\\\\\\":27,\\\\\\\"entityType\\\\\\\":\\\\\\\"blog-post\\\\\\\",\\\\\\\"pluginKey\\\\\\\":\\\\\\\"blogs\\\\\\\",\\\\\\\"data\\\\\\\":\\\\\\\"{\\\\\\\\\\\\\\\"time\\\\\\\\\\\\\\\":1581284948,\\\\\\\\\\\\\\\"ownerId\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"1\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"string\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"key\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"blogs+feed_add_item_label\\\\\\\\\\\\\\\"},\\\\\\\\\\\\\\\"content\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"format\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"content\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"vars\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"title\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"test\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"description\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Etiam non quam lacus suspe...\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"url\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"routeName\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"post\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"vars\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"id\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"27\\\\\\\\\\\\\\\"}},\\\\\\\\\\\\\\\"iconClass\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"ow_ic_blog\\\\\\\\\\\\\\\"}},\\\\\\\\\\\\\\\"view\\\\\\\\\\\\\\\":{\\\\\\\\\\\\\\\"iconClass\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"ow_ic_write\\\\\\\\\\\\\\\"}}\\\\\\\",\\\\\\\"format\\\\\\\":\\\\\\\"content\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"92\\\\\\\"}}\\\",\\\"format\\\":\\\"content\\\",\\\"id\\\":\\\"92\\\"}}\",\"format\":\"content\",\"id\":\"92\"}}","format":"content","id":"92"}}

Peter
Peter Feb 9 '20
I tested it with a plain filtered text from notepad, so html is not the issue i think.
Quote from ArtMedia this could be related with disabling filtering html tags on wysiwyg textarea field. Problem is when somebody copy text from eg. Word to ckeditor textarea field, then you have many unwanted tags on source code


The Forum post is edited by Peter Feb 9 '20
ArtMedia
ArtMedia Feb 9 '20

i check blog plugin and here have code


$content= nl2br(UTIL_String::truncate(strip_tags($post->post), 150, '...'));$title= UTIL_String::truncate(strip_tags($post->title), 100, '...');


so tags are deleted and this couldn't be related with my plugin, but with oxwall event "feed.on_entity_update"


i see similar errors on oxwall forum, where users don't have my plugin


my plugin don't do anything with newsfeed statuses

The Forum post is edited by ArtMedia Feb 9 '20
Peter
Peter Feb 9 '20

Yes, this is probably caused by the plugin blog. But I turned to you because you seem to be able to solve these problems, like a boss :)



I'll try to dig in the oxwall event "feed.on_entity_update" and write down how it turned out.


Thank you anyway

ArtMedia
ArtMedia Feb 9 '20

check if your server don't escaping strings, because this is whats look.


oxwall saves json data as string on database, so your server when see double quotes, then try escaping it

Peter
Peter Feb 9 '20
Yes, it will probably be this. Thank you man! And is it safe to turn off escape strings in a live environment?
You do not have permission to reply this topic