Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To reproduce:
- Create a ckeditor plugin module or install https://www.drupal.org/project/ckeditor_bootstrap_buttons
- Add the button to a text format (such as basic html) active toolbar
- Turn on 'Limit allowed HTML tags and correct faulty HTML' filter
- Load a content edit form that uses the text format
The button will then not be added to the ckeditor interface.
If you then go back to the text format and remove the 'Limit allowed HTML tags and correct faulty HTML filter' the button will be available from the user interface.
Please not that this is NOT an issue with the above mentioned module, and the same happens with all user added ckeditor plugins
Comment | File | Size | Author |
---|---|---|---|
#7 | ckeditor.jpg | 180.91 KB | rwam |
Comments
Comment #2
Wim LeersYou need to add the tags/attributes that this CKEditor plugin needs to the list of allowed HTML tags. In this case: https://github.com/smonetti/btbutton/blob/master/plugin.js#L81.
Note that this should happen automatically: https://vimeo.com/62160137
Comment #3
Wim LeersComment #4
Tom.W CreditAttribution: Tom.W commentedHi Wim,
Your completely right about the resolution but interestingly the unidirectional update definitely does not work for us, adding buttons and so forth added nothing at all. I tried this with ckeditor plugins with normal and obfuscated code, and it didnt make a difference. Any idea how we might get this to work properly?
Comment #5
chinhlc CreditAttribution: chinhlc commentedYou check again all tag you have in "Allowed HTML tags". Remove tag make error => done
eg:
<table> <p> ...
Comment #6
Tom.W CreditAttribution: Tom.W commentedchinhcl - I already checked that config many times and this was not the issue
Comment #7
rwam CreditAttribution: rwam commentedSame problem exists with alignment buttons. I've tried to add them to the Basic HTML and the Full HTML text format, but with no luck. Only with deactivated filter the alignment buttons work. See screenshot below. I think it's the same problem like #2598070
Comment #8
rwam CreditAttribution: rwam commentedWait resp. sorry, I've found the solution. The alignment buttons needs a customized filter setting, because the alignment works with class names. So I switched the settings from
…<h6 id> <p> <br> <span>…
to
…<h6 id> <p class=""> <br> <span>…
and it works now. Sorry for the circumstances, but may it's helpful.
Comment #9
Wim Leers#7 + #8: Actually, you want
class="text-align-left text-align-center text-alight-right text-align-justify"
. That's more specific. Those classes should be added automatically as soon as you add those alignment buttons. You probably have JS errors or a contrib module that is breaking that automation (which is happening in JS).Comment #10
rwam CreditAttribution: rwam commentedHi Wim,
no errors, no contrib module. I've tested it with a brand new drupal 8.2.7 installation. Same behavior like described. The class attribute must be added manually. And I must do this for each kind of block format tag when I use the format plugin.
Ciao
Ralf
Comment #11
navalogan CreditAttribution: navalogan commentedThanks rwam it' worked for me too!
Comment #12
tepelena CreditAttribution: tepelena commentedHad the same issue. #8 fixed it for me.
In addition I had the issue with the image embed button not showing.
Added data-src to the img tag and it worked.
This:
<img src class="" data-src alt data-entity-type data-entity-uuid>
Comment #13
tepelena CreditAttribution: tepelena commentedComment #15
loopy1492 CreditAttribution: loopy1492 commentedHad a similar issue with the CKEditor Anchor Link Module. It was adding an ID to the
<a>
tag which was not allowed in the HTML filter settings. I added "id" to the list of properties allowed in the<a>
tag and the button appeared for me.A good way to figure out what properties need to be whitelisted is to have an unrestricted text format. If you add the button there and look at the code produced when you use the button, you can take the properties used there and then add it to your filter settings for the more restrictive text formats.
Comment #19
cilefen CreditAttribution: cilefen commentedI am closing this support request because there have been no recent comments.
I read all comments and it seems to be answered. If I am wrong and this is actually a bug please comment.