Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS



4 Posts   1570 Views


21 October 2009 at 4:45am Community Member, 47 Posts


I'm writing a module to extend SilverStripe. In the module I create serveral form fields (TextField, TextareaField and so on). Furthemore I can save everything into my MySQL database. But there is a problem: I can't save the modified content of an HTMLEditorField. If I edit manually the HTML content in the database, it will displayed without any problems. But in the CMS Backend no chance, the content will ignored. The database array field is set to 'HTMLText'. So this isn't the problem.

My function getEditForm($id) return form. The AJAX request works! So I looked into the requested object and there is no value of the form field with the HTML text. If I changed the HTMLEditorField into a TextareaField everything works and the content will updated in the database. So my question is why does the requested object doesn't have the value of a form field of type HTMLEditorField.

Best regards,



21 October 2009 at 12:27pm Forum Moderator, 5511 Posts

Is your database field a 'HTMLText' field?


21 October 2009 at 6:49pm Community Member, 47 Posts

Yes, my database field is a HTMLText. If I don't set this type, I will get a error in the function saveInto() on the class HTMLEditorField
So this isn't the reason for my problem. I hope you have another solution.


2 November 2009 at 8:32am Forum Moderator, 801 Posts

> But there is a problem: I can't save the modified content of an HTMLEditorField

So no content is saved at all? Or saved as escaped HTML instead of raw? Does the data get submitted with the POST ajax request? (you can check this with Keep in mind that in case you're using some custom TinyMCE or otherWYSIWYG formfield thats not a plain HTMLEditorField, you'll likely need to tell the editor via JavaScript to extract the HTML *before* saving.