Help text not displaying on text area field

Created on 26 September 2023, about 1 year ago

Problem/Motivation

Help text does not appear for text area (formatted text) fields.

Steps to reproduce

  • Create a Text (formatted, long, with summary) field and include help text.
  • Create a field group using the field_group module. Not sure this is relevant but including just in case.
  • Under Manage form display, place the field inside the field group.
  • Edit an entity of the type/bundle you configured the field for. There will be no help text above the field.

Proposed resolution

I'll attach a patch or merge request to add an additional elseif statement which checks for base_type == textarea and attaches the help text to $form[$key]['widget'][0]['#label_suffix']. Currently the logic attaches the help text to $form[$key]['widget'][0]['value']['#field_prefix'] which causes the help text not to render.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States maskedjellybean Portland, OR

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @maskedjellybean
  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update about 1 year ago
    Waiting for branch to pass
  • πŸ‡ΊπŸ‡ΈUnited States maskedjellybean Portland, OR

    Merge request opened. https://git.drupalcode.org/project/label_help/-/merge_requests/5

    This also fixes a couple typos, adds variable names to a docblock and fixes this warning which has been popping up:

    Warning: Undefined array key "#type" in label_help_form_alter() (line 219 of modules/contrib/label_help/label_help.module).
    label_help_form_alter(Array, Object, 'node_event_edit_form') (Line: 562)

    Thank you for this module. Digging into the code made me appreciate how difficult this was to implement!

    For anyone coming to this issue with the same problem, remember you can get a patch by appending .patch to the end of the merge request URL:
    https://git.drupalcode.org/project/label_help/-/merge_requests/5.patch

  • Status changed to Needs review 11 months ago
  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update 7 months ago
    Waiting for branch to pass
  • πŸ‡ͺπŸ‡¨Ecuador jwilson3

    @maskedjellybean: I'm unable to replicate this issue on a normal Text (formatted, long, with summary) field that exists outside of a field group.

    It would be helpful to know which kind of field group config was used, if you happen to know, because there are several permutations that I'll need to test.

  • Status changed to Postponed: needs info 7 months ago
  • πŸ‡ͺπŸ‡¨Ecuador jwilson3

    I've also tested using the "Fieldset", "Details" and "HTML Element (div)" options from Field Group, and still unable to replicate the issue.

  • πŸ‡ͺπŸ‡¨Ecuador jwilson3

    Rebased again on latest 2.0.x branch.

  • πŸ‡ͺπŸ‡¨Ecuador jwilson3

    @maskedjellybean: I believe this issue may be resolved by issue πŸ› Avoid clobbering existing field prefix, descriptions, and label suffix values Active where I've completely refactored how the placement logic works.

    Unfortunately I'm unable to confirm one way or another because I'm still unable to reproduce this issue.

    I would appreciate if you could give that issue a test and if not resolved, write up some more detailed explanation of the field config that is causing the issue here.

    Also, I've pulled over one of the commits from your MR here to fix the warning undefined array key #type. I'll rebase this MR shortly.

  • πŸ‡ͺπŸ‡¨Ecuador jwilson3

    I've rebased the commit on the most recent version of 2.0.x branch, and still unable to reproduce.

    I've introduced a label_help_test submodule. So if you're able still produce this, I would appreciate you enabling the submodule and jiggering the field layouts with field_group or whatever you need (and then export the config to the test submodule config/install folder as part of the test suite to prove that the issue exists and can be fixed by your code change).

    I'm going to keep the status in Postponed until then.

    Thanks.

Production build 0.71.5 2024