Add Label Help support for Paragraphs module fields

Created on 23 May 2016, over 8 years ago
Updated 27 May 2024, 7 months ago

Label Help appears to be incompatible with Paragraphs fields.

For an empty Paragraph field, Label Help creates an element on the form item and the form thinks there is a value for the first Paragraph item.

Also, it doesn't display the text.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States pingevt

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.

  • 🇪🇨Ecuador jwilson3

    This module depends on Form API #entity_builders. Therefore the bug here could be related to an issue on Paragraphs issue queue: #3269854: Make #entity_builders work for paragraphs created through widgets →

    I would appreciate help from anyone that is using Paragraphs and Label Help to subscribe to that issue and test out the patch there to see if it solves the issues.

    Thanks!

  • 🇪🇨Ecuador jwilson3
  • 🇺🇸United States cedewey Denver, CO
  • 🇪🇨Ecuador jwilson3
  • 🇪🇨Ecuador jwilson3

    I'm tagging this issue for identifying it and grouping with others.

  • 🇪🇨Ecuador jwilson3

    Updated tag name.

  • 🇪🇨Ecuador jwilson3

    Changing this back to a bug because I'm seeing similar "ghost" element behavior described in the Issue Summary:

    For an empty Paragraph field, Label Help creates an element on the form item and the form thinks there is a value for the first Paragraph item.

  • 🇮🇳India bharath-kondeti Hyderabad

    @jwilson The patch from this issue https://www.drupal.org/project/paragraphs/issues/3269854 → does not resolve the issue.

  • Status changed to Needs review 7 months ago
  • 🇮🇳India bharath-kondeti Hyderabad
  • Pipeline finished with Failed
    7 months ago
    Total: 264s
    #192700
  • Pipeline finished with Success
    7 months ago
    Total: 175s
    #192708
  • 🇪🇨Ecuador jwilson3

    I've rebased the MR on the latest 2.0.x. and added a submodule to test the Paragraphs integration.

    ddev drush en lh_paragraphs_test
    
  • 🇪🇨Ecuador jwilson3

    Upon testing, it turns out the approach here doesn't work with all core field types inside Paragraphs.

    I see the following errors on screen when creating a Node type with paragraphs reference field:

    Warning: Undefined array key 0 in label_help_field_widget_complete_form_alter() (line 68 of /var/www/html/label_help.module).
    Warning: Undefined array key "value" in label_help_field_widget_complete_form_alter() (line 68 of /var/www/html/label_help.module).
    Warning: Undefined array key "#title" in label_help_field_widget_complete_form_alter() (line 68 of /var/www/html/label_help.module).

    While several field types do work and show the Label Help text, I see the following field types do not work inside Paragraphs (but do work on a normal Node).

    • Boolean
    • Link (URL only)
    • Link (URL & Title)
    • List (float)
    • List (integer)
    • List (text)
    • Reference > Node w/ Autocomplete formatter.
    • Reference > Other w/ Select List formatter.
    • Reference > Term w/ Autocomplete (Tags style) formatter.
    • Reference > User w/ Checkbox/radio buttons formatter.
    • Text (formatted)
    • Text (formatted, long)
    • Text (formatted, long, with summary)

    →

  • 🇪🇨Ecuador jwilson3

    After spending several hours on project maintenance over the past weekend, I have a growing suspicion that the entire module architecture should be refactored to utilize hook_field_widget_WIDGET_TYPE_form_alter for different field widget types (i.e. field formatters), which ultimately are the things that have intimate knowledge of each Field API widget's internal array structure and render oddities.

    This should probably be opened as a separate issue, and (likely) would need to be worked on as a precursor to the approach here. And then (wishfully thinking) we may even get Paragraphs support "for free" once the refactor is done.

    Since this could end up being a large refactor that may take significant time (>6 months) and a version bump, feel free to keep iterating on the approach here, if you feel so inclined.

Production build 0.71.5 2024