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:

This issue is about fixing these above issues in one fell swoop so that we have a working Drupal 8 module.

Comments

jwilson3 created an issue. See original summary.

jwilson3’s picture

StatusFileSize
new9.35 KB

This patch addresses all of the issues mentioned in the issue summary:

  • Removes legacy inline comments and commented-out code.
  • Removes one level of code nesting by using the same technique used in previous sections -- negate the if statement and use continue;
  • Adds support for a number of additional field widgets, including:
    • Multi-value fields (i.e., dragable table) -- moved the label help out of the table row, and into the table header where the label is located.
    • Fieldset widgets, like Link fields and Date fields.
    • Details widget, like Entity Browser, or Address fields.
    • Client-side hierarchical select (cshs) fields.
  • Make the HTML output themable with a label-help.html.twig that you can override in your theme.
  • Provide some theming enhancements and fixes for the core Seven theme

This patch should also resolve the following issues:

jwilson3’s picture

Status: Active » Needs review

This has been manually tested with Drupal core 8.4.5

jwilson3’s picture

StatusFileSize
new927.19 KB
new465.19 KB

Here 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

jwilson3’s picture

Issue summary: View changes
StatusFileSize
new9.61 KB
new905 bytes

Minor 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!)

jcaritas’s picture

This is a big improvement, but it still doesn't seem to be working for checkbox/radio button fieldset types...? Any plans for that?

jwilson3’s picture

Status: Needs review » Fixed

I'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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.