HTML being stripped when manually adding HTML content to a db TEXT field in DB Manager. If add via benchmark the HTML is included, but then stripped if I edit the field in DB Manager

Wappler Version : 3.5.5
Operating System : Mac
Server Model: NodeJS
Database Type: MySql
Hosting Type: Docker

Expected behavior

What do you think should happen?

I should be able to paste formatted content into the html editor in Summernote, or simply paste text and then format - I then save this to a DB field called ‘content’. I expect the HTML / formatted content to be saved as such.

My DB field is ‘Text’ and I’m using a $post to send it through to the SC.

Actual behavior

What actually happens?

The content gets stripped of all formatting/HTML tags and is inserted in plain text.

I might be doing something wrong here - but I can’t see anything obvious.

Gentle bump! Need to swap over our blog this week, and I can’t seem to find a reason why it would be stripping the HTML from the content.

Hey @Teodor any guidance here please?

Hello @mgaussie
So if you format your text in the Summernote textarea you see that it’s formatted, right?
What do you see in the sent form data in the dev tools when you run your server action? Do you see the HTML tags? Or just the text?
What expression exactly is used in the insert record?

1 Like

Hey @Teodor running a couple of tests, per your feedback.

Couple of things to note:
When I manually add the HTML code to the DB field via the DB Manager - it strips the HTML off even then. Is that expected?

Currently the summernote input is not passing to the SC, I’ve checked everything, names are correct, etc. etc. and it’s not being received, so testing to see if I can resolve that.

Regarding the expression used, just a simple: {{$_POST.content_edit}}

@Teodor I had to rebuild the workflow for summernote, it wasn’t working without a form submit (even though I was trying to pass the values via the form inputs). So editing and passing the html code to the DB update action is now working, thank you for pushing me in that direction.

The only outstanding issue, if I try to copy/paste a full HTML post into the DB field via DB Manager, it strips all html tags.

Can you advise on this?

I’ve tried copying directly from the source (currently sitting in a csv export file), I’ve tried copying into sublime and then copying over - it just strips the tags. I’m going to try benchmark to see if it’s Wappler DB Manager specific.

UPDATE:
Benchmark was able to inset the full HTML code into the DB Field, if I then render the page the correct formatting is displayed.

However, if I then double click that field in the DB MAnager in Wappler - it again strips the entire HTML code out of it, and it goes to plain text.

@Teodor can you advise on this, please?

Updated the title to more suit the issue now.

Currently the Database Manager has only basic data editing support . It doesn’t edits rich html encoded data.

When we add more rich database types and validation to the database schema, we will also extend it to auto generate a whole editing form instead of just grid. So that will improve.

It might take a while to implement thought.

3 Likes

This should be fixed in Wappler 3.7.5

This topic was automatically closed after 45 hours. New replies are no longer allowed.