hook_field_widget_form_alter is deprecated

Created on 4 September 2023, 10 months ago
Updated 8 January 2024, 6 months ago

hook_field_widget_form_alter is deprecated so configured help text does not work.

๐Ÿ› Bug report
Status

RTBC

Version

2.0

Component

Code

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

Merge Requests

Comments & Activities

  • Issue created by @sachin.bansal27
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ayush.pandey

    Tried the module with version 2.0.0 on Drupal9, and the issue is reproducible. The "summary help text" is working now with the fix in the patch.

  • Status changed to Needs work 9 months ago
  • ๐Ÿ‡ช๐Ÿ‡จEcuador jwilson3

    The patch works and fixes a critical issue. The module is unusable on Drupal 10 without this.

    However, it needs a little love...

    +++ b/text_summary_options.module
    @@ -79,30 +79,30 @@ function text_summary_options_field_widget_form_alter(&$element, FormStateInterf
    +      unset($element["widget"][0]['summary']['#attached']);
    ...
    +      $element["widget"][0]['summary']['#required'] = TRUE;
    ...
    +      if ($element["widget"][0]['summary']['#description'] == $default_summary_text) {
    +        unset($element["widget"][0]['summary']['#description']);
    ...
    +      $element["widget"][0]['summary']['#description'] = $summary_help_setting;
    ...
    +      $element["widget"][0]['summary']['#attributes']['placeholder'] = [$summary_placeholder_setting];
    

    Please don't mix single quotes and double quotes. ("widget")

  • Status changed to Needs review 8 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland sokru

    I think we should rather use hook_field_widget_single_element_form_alter so it works also on multivalue fields and is much smaller change.

  • Status changed to RTBC 7 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom JennyDumitrescu

    Tested #5 on our site as we were having issues with this module not working and it's added the description so working great for our use case.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom JennyDumitrescu
  • ๐Ÿ‡ธ๐Ÿ‡ฆSaudi Arabia martins.bruvelis Thuwal

    martins.bruvelis โ†’ made their first commit to this issueโ€™s fork.

Production build 0.69.0 2024