Updated: #4
Problem/Motivation
While porting Wysiwyg Linebreaks to D8 (see #1917702: D8CX: I pledge that Wysiwyg Linebreaks will have a full Drupal 8 release on the day that Drupal 8 is released.), I noticed that there's a blank (empty) vertical tabs area appearing underneath the Toolbar Configuration section on a text format/editor configuration page:
Proposed resolution
Don't display the vertical tabs fieldset if there are no extra settings to be displayed.
Remaining tasks
Test patch in #4.
User interface changes
An ugly, empty vertical tabs area will not be displayed if there are no extra settings to be displayed.
API changes
None.
Related Issues
None.
Comment | File | Size | Author |
---|---|---|---|
#12 | don_t_show_empty-2067323-12.patch | 819 bytes | Valentine94 |
#10 | don_t_show_empty-2067323-1.patch | 839 bytes | Valentine94 |
#5 | empty-vertical-tabs-2067323-5.patch | 859 bytes | jessebeach |
#5 | interdiff.txt | 873 bytes | jessebeach |
#4 | 2067323-4-empty-vertical-tabs-fix.patch | 859 bytes | geerlingguy |
Comments
Comment #1
geerlingguy CreditAttribution: geerlingguy commentedAdding an image to illustrate the sadness.
Comment #2
geerlingguy CreditAttribution: geerlingguy commentedHmm... looking further into this, it looks like there is one plugin with settings loaded—the 'Styles dropdown' (stylescombo)—but the settings only show up if the button is dragged onto the toolbar.
Unfortunately, the default behavior with the Standard install profile makes it look like this admin form is broken, at least until an admin drags the Styles button onto the Wysiwyg toolbar and the settings show up (or if the site has something like Wysiwyg Linebreaks installed).
Comment #3
Wim LeersThe same problem applies to the case of a text format with zero filters enabled, like the Full HTML text format. It's a bug in the vertical tabs system.
i.e. see
admin/config/content/formats/manage/full_html
's filter settings at the very bottom. This has been the case at least since January 2013, if not longer, in Drupal 8.I totally agree we should fix this though :) If you can roll patches, I'll provide reviews!
Comment #4
geerlingguy CreditAttribution: geerlingguy commentedSo, the attached patch works... is this the right approach?
Comment #4.0
geerlingguy CreditAttribution: geerlingguy commentedAdded illustration.
Comment #5
jessebeach CreditAttribution: jessebeach commentedOy, I've never really looked at vertical-tabs.js. It could use some love eventually. geerlingguy, I think you've found a fine solution regardless that works within the spirit of the current code. The only change I suggest is to use
closest()
instead ofparents()
. Otherwise it gets the job done well.Comment #6
geerlingguy CreditAttribution: geerlingguy commentedAh, right, I always seem to forget about
closest()
. Presuming it comes back green (how could it not?), I think this should be RTBC.Comment #7
Wim LeersVery simple, works great! Thanks, geerlingguy!
This probably needs to be backported too.
Comment #8
alexpottCommitted dda8d4d and pushed to 8.x. Thanks!
Comment #9
nod_tag
Comment #9.0
nod_Updated info about patch to test.
Comment #10
Valentine94Back-port to 7.x-dev
Comment #11
vlad.dancer@Valentine94.
There is no such selector ".form-type-vertical-tabs", use instead of it this one ".vertical-tabs". As soon as this patch will be updated fix should works as designed.
Also how to reproduce this error on Drupal 7:
Go to the admin/config/content/formats/filtered_html (for example) and disable all items to test it.
Comment #12
Valentine94Changed a class selector.
Comment #13
vlad.dancerNow it works as expected. Thanks @geerlingguy, @Valentine94!
Comment #14
geerlingguy CreditAttribution: geerlingguy commented+1
Comment #17
idebr CreditAttribution: idebr commentedSetting back to RTBC per #13/#14
Comment #20
Valentine94Comment #21
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks!