Closed rbrlortie closed 6 years ago
Based on comments it seems that it is a problem with ckeditor and not with the bundle.
Closing as no reply.
My fix is to extend default twig template and append javascript that adds 'required' attribute after a CKEditor field is processed/rendered.
# config.yml
twig:
form_themes:
- 'Form/ckeditor_widget.html.twig'
# Form/ckeditor_widget.html.twig
{% extends 'FOSCKEditorBundle:Form:ckeditor_widget.html.twig' %}
{% block ckeditor_widget_extra %}
{% if required %}
CKEDITOR.on('instanceReady', function(){
$('#{{ id }}').attr('required', true);
});
{% endif %}
{% endblock %}
Symfony 4 "friendsofsymfony/ckeditor-bundle": "^1.1"
It seems that this issue https://github.com/egeloen/IvoryCKEditorBundle/issues/305 is back / present on this version of the bundle.