- 🇪🇨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!
- 🇺🇸United States cedewey Denver, CO
jwilson3 → credited cedewey → .
- 🇪🇨Ecuador jwilson3
I'm tagging this issue for identifying it and grouping with others.
- 🇪🇨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.
- Merge request !14Issue-2731637: Fixing label help issue for paragraph fields. → (Open) created by Unnamed author
- Status changed to Needs review
7 months ago 12:34pm 6 June 2024 - 🇪🇨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.
- 🇪🇨Ecuador jwilson3
I've created 📌 Refactor Label Help to use hook_field_widget_WIDGET_TYPE_form_alter Active