Add support for #description_display for container types that support it

Created on 25 March 2021, over 3 years ago
Updated 25 June 2024, 6 days ago

Problem/Motivation

Although it's currently buggy (e.g. #2396145: Option #description_display for form element fieldset is not changing anything β†’ and #2443815: #description_display broken for details elements β†’ ), most of the container elements that field_group supports have a #description_display property. It'd be great if there was support in field_group to configure values for them.

Proposed resolution

Add support for #description_display:

  1. Update the config settings schema.
  2. Add form element for it to the settings forms.
  3. Ensure we propagate the value to the underlying render element.
  4. Add/update tests.

Remaining tasks

  1. Agree on the plan.
  2. Do it.
  3. Reviews / refinements.
  4. RTBC.
  5. Commit.

User interface changes

  • New setting for #description_display in Details, Fieldset and Tab group formatters.
  • Additional summary item about it when customized.
  • End-user sees description in a different location (assuming core has been updated and/or patched for the elements in use).

API changes

Add shared code among formatter plugins that deal with #description_display. Either:

a) Additions to FieldGroupFormatterBase (current implementation).

or

b) A new interface and trait called something like DescriptionDisplayFormatter(Interface|Trait).

Data model changes

New setting for #description_display in config schema for field group Details, Fieldset and Tab formatter plugins.

✨ Feature request
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dww

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΉAustria maxilein

    Just tried to apply this. There seems to be an incompatibility with some other patches.
    Maybe it would help to make a new dev version.

      - Installing drupal/field_group (dev-3.x 710c6a6): Cloning 710c6a6436 from cache
      - Applying patches for drupal/field_group
        https://www.drupal.org/files/issues/2020-04-23/3130339-2.patch (Horizontal vertical tabs set default tab to last item with #open = TRUE #2)
        https://www.drupal.org/files/issues/2023-04-07/2787179-highlight-html5-validation-85.patch (Ensure visibility of invalid fields JS = TRUE #85)
        https://www.drupal.org/files/issues/2022-08-10/3302908-2.patch ($this->t should be used instead of t = TRUE #2)
        https://www.drupal.org/files/issues/2023-01-12/3098550-17.patch (Nested groups render on other entity forms (or when fields are inaccessible) when they shouldnt #17)
        https://www.drupal.org/files/issues/2022-10-27/3205504-20.patch (Add support for #description_display for container types that support it)
       Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2022-10-27/3205504-20.patch
        https://www.drupal.org/files/issues/add_classes_js-2936973-2.patch (Add classes to JS rewriting in horizontal tabs)
    
  • Status changed to Needs work 3 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Would be great, if this could be turned into a MR please for final review and testing.

  • First commit to issue fork.
  • Pipeline finished with Failed
    6 days ago
    Total: 355s
    #207103
  • Status changed to Needs review 6 days ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    I turned the patch into an MR.

  • Status changed to Needs work 6 days ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thanks @DamienMcKenna - now tests are failing and PHPStan is unhappy. Back to NW for the final steps.

  • πŸ‡ͺπŸ‡ΈSpain rteijeiro

    Patch in #20 applies correctly but the MR mentioned in #29 is not applying. Not sure if I created the patch from the MR wrong. I just added .patch to the MR link like this: https://git.drupalcode.org/project/field_group/-/merge_requests/56.patch

Production build 0.69.0 2024