This is a followup to #2409351: Update module to Drupal 8.
The Drupal 8 version has the basic implementation, but the main module logic inside the hook_form_alter has various issues:
- lacks support for a number of standard field types, as evidenced by a number of issues in the queue:
- incomplete, confusing and/or legacy documentation (the
//inline comments are confusing,#theme_optionscomments are not accurate or needed). - there is needless legacy code (variable
$theme_optionsis set but never used). - the code is needlessly nested inside too many
ifstatements - there is needless commented-out legacy code (see the
cshssection). - there is no way to alter the HTML output generated by the module -- it needs a Twig template.
- the output generated has whitespace issues with standard core seven theme.
This issue is about fixing these above issues in one fell swoop so that we have a working Drupal 8 module.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | interdiff.txt | 905 bytes | jwilson3 |
| #5 | label_help-2948501-5.patch | 9.61 KB | jwilson3 |
| #4 | 2948501-example-2.png | 465.19 KB | jwilson3 |
| #4 | 2948501-example-1.png | 927.19 KB | jwilson3 |
Comments
Comment #2
jwilson3This patch addresses all of the issues mentioned in the issue summary:
continue;cshs) fields.label-help.html.twigthat you can override in your theme.This patch should also resolve the following issues:
Comment #3
jwilson3This has been manually tested with Drupal core 8.4.5
Comment #4
jwilson3Here are some screenshots of how I'm using the module with the patch in #2 PLUS a little special sauce (additional css that makes the help text appear inline with the labels).
Example 1
Example 2
Comment #5
jwilson3Minor fix for certain kinds of container elements that have a ['widget']['title'] component, instead of a ['widget']['#title'] (Gotta love all the inconsistencies in Drupal Render arrays of doom!)
Comment #6
jcaritas commentedThis is a big improvement, but it still doesn't seem to be working for checkbox/radio button fieldset types...? Any plans for that?
Comment #7
jwilson3I've been granted maintainership to help shepherd the Drupal 9 compatibility fixes.
I've been using the patch in #5 for a few years now and feel comfortable releasing this change on a 2.0.x branch and a 2.00-beta1 release.
Re: comment #6, there is an existing issue for checkbox support here: #2883840: Label Help support for List (text) field with Radios/Checkboxes widget