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.
By default, dragging the Underline button into the toolbar will not enable the Underline button in the Basic CKEditor config. It just doesn't show up in the user's toolbar.
Un-checking "Limit allowed HTML tags and correct faulty HTML" in the Basic CKEditor config allows users of the Basic config to see the Underline button.
This issue #2598070: [regression] CKEditor Link button does not show if HTML filtering is enabled may be related
Comments
Comment #2
cilefen CreditAttribution: cilefen commentedI cannot reproduce the problem on 8.0.x or 8.1.x.
I went to admin/config/content/formats/manage/basic_html and dragged the underline button to the toolbar, saved the configuration, then added an article. The underline button was there, and it works.
Comment #3
Ameer Khan CreditAttribution: Ameer Khan as a volunteer commentedI have tested with drupal-8.0.5 but I can't reproduce the issue. I can drag the underline button.
Comment #4
Wim LeersMany thanks, cilefen & Ameer Khan!
I suspect a browser cache problem.
Comment #5
Wim LeersComment #6
iainH CreditAttribution: iainH as a volunteer commentedIssue still persists in Drupal site live in beta for a couple of weeks - i.e. can't see how this can be browser cache related.
It's on a body field in a custom content type where editing is restricted to a single role "Officer" using a Basic HTML.
And the Basic HTML editor configuration shows Underlining in the toolbar but this does not display either to the user with that "Officer" role or to an "Administrator" who's also checked to use this edit profile. (See screenshots)
Comment #7
Wim LeersNote that users don't see closed issues. So you're very lucky I accidentally stumbled upon this issue.
Please export your
text editor & text format and post their YAML here. That should allow me to reproduce the problem.Comment #8
DuaelFrMaybe related to #2671780: Additional fields doesn't show even with HTML filter disabled
Comment #9
iainH CreditAttribution: iainH as a volunteer commentedGlad you did stumble upon this as I didn't notice it was closed. Thanks for looking into this.
Text editor >> Basic HTML:
Text format >> Basic HTML
Comment #10
iainH CreditAttribution: iainH as a volunteer commentedComment #11
iainH CreditAttribution: iainH as a volunteer commentedAnd heres a body field in a node whose editor toolbar doesn't display the Underline button.
Comment #12
Wim LeersThe underline tag (
<u>
) is not listed there. That's why it doesn't show up. CKEditor has your back: it doesn't show buttons that it knows will be stripped anyway.You need to add that tag there.
Now, that tag should have been added there automatically. When you dragged the "Underline" button onto the toolbar, a JS error must have occurred that prevented this from happening. But I'm happy to see that this automatic whitelisting actually did work for various other things you did. For example,
<table> <caption> <tbody> <thead> <tfoot> <th> <td> <tr>
was whitelisted because you added the "Table" button.I don't know what happened there exactly, but in this case, the most sensible thing is to just fix it manually: just add
<u>
.Comment #13
iainH CreditAttribution: iainH as a volunteer commentedIt's a great idea to automatically manage the text formats t suit the editor settings but ... and apologies for not letting this go for the moment ... want to ensure that there's nothing sinister lurking there.
I would have expected the following to automatically update the text formats config by adding a
<u>
tag - but it doesn't<u>
<u>
tagBut this last step doesn't happen. It's still not adding in the
<u>
tag.Why do you think this is?
Comment #14
Wim LeersI just tried it manually, because you had me thinking this indeed is an actual bug. But it works fine here! :( Very strange.
Comment #15
iainH CreditAttribution: iainH as a volunteer commentedOK, so I went to to https://simplytest.me/project/drupal/8.1.x and configured Basic HTML exactly as its configured on our (8.0.6) site.
Yes, the simplytest.e site generates a
<u>
tags as expected whereas our does not - whatever strategy I try and no, there are no browser errors and, since I wrote all the modules and js behaviors that are not from d.o. I can be pretty sure I am not interfering with any of the js that manages the allowed tags on the editor configuration page. ... so it's a mystery.I added the
<u>
tag by hand to the allowed tags and we have an Underline button and the config exports to the live site OK. So I have a workaround but no solution. ... and I've run out of time to explore forth so I'll close this issue.Again. Thanks for your time taken looking into this.