Element description overridden by Bootstrap when using defaults

Created on 21 October 2024, 6 months ago

Problem/Motivation

I think this is very similar to but different from 🐛 Element description position overridden by Bootstrap Fixed . The description for a text area didn't show up as expected after the text area. (Particularly fun was that it worked locally but not on staging, which I think is due to the increased length of the field with HTML comments preventing tooltips being used!) If I explicitly set either the specific element or the global (admin/structure/webform/config/elements#edit-element-default-description-display) description display to it works; but I can't have it set to .

Steps to reproduce

  • Enable bootstrap theme and webform_bootstrap.
  • Configure the theme at /admin/appearance/settings/bootstrap to use smart form descriptions via tooltips.
  • Go to admin/structure/webform/config/elements#edit-element-default-description-display and ensure the element display is set to
  • Add a webform with a textarea and add a short description. Configure the description to display with default settings.
  • View webform.

Proposed resolution

Given that the FAPI defaults to after can we just update the condition to something like this?

<?php

if ($smart_description_enabled
&& isset($element['#description'])
&& empty($element['#smart_description'])
&& (!isset($element['#description_display']) || $element['#description_display'] === 'after' || $element['#description_display'] === 'before')) {
$element['#smart_description'] = FALSE;
}

(Current code here.)

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

6.3

Component

Code

Created by

🇬🇧United Kingdom AndyF

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

Merge Requests

Comments & Activities

  • Issue created by @AndyF
  • 🇬🇧United Kingdom AndyF
  • 🇬🇧United Kingdom AndyF

    Let's see what testbot says, thanks!

  • Pipeline finished with Failed
    6 months ago
    Total: 50s
    #316114
  • Pipeline finished with Success
    5 months ago
    Total: 185s
    #347794
  • Pipeline finished with Failed
    3 months ago
    Total: 805s
    #392434
  • Pipeline finished with Failed
    3 months ago
    Total: 996s
    #397438
  • Pipeline finished with Failed
    3 months ago
    Total: 2134s
    #397445
  • Pipeline finished with Failed
    3 months ago
    Total: 1089s
    #397723
  • Pipeline finished with Failed
    3 months ago
    Total: 1053s
    #397902
  • Pipeline finished with Failed
    3 months ago
    Total: 332s
    #397952
  • Pipeline finished with Failed
    3 months ago
    Total: 880s
    #397956
  • Pipeline finished with Canceled
    3 months ago
    Total: 120s
    #397984
  • Pipeline finished with Success
    3 months ago
    Total: 846s
    #397986
  • Pipeline finished with Success
    3 months ago
    Total: 813s
    #398223
  • Pipeline finished with Failed
    3 months ago
    Total: 978s
    #400375
  • Pipeline finished with Failed
    3 months ago
    Total: 873s
    #400406
  • Pipeline finished with Success
    3 months ago
    Total: 807s
    #400426
  • Pipeline finished with Success
    3 months ago
    Total: 798s
    #400437
  • Pipeline finished with Success
    3 months ago
    Total: 901s
    #400441
  • Pipeline finished with Failed
    3 months ago
    Total: 806s
    #401507
  • Pipeline finished with Failed
    3 months ago
    Total: 842s
    #401570
  • Pipeline finished with Success
    3 months ago
    Total: 872s
    #401682
  • Pipeline finished with Success
    3 months ago
    Total: 868s
    #401703
  • Pipeline finished with Success
    3 months ago
    Total: 844s
    #402114
  • Pipeline finished with Failed
    3 months ago
    Total: 931s
    #402153
  • Pipeline finished with Success
    3 months ago
    Total: 1097s
    #402159
  • Pipeline finished with Failed
    3 months ago
    Total: 850s
    #402187
  • Pipeline finished with Failed
    3 months ago
    Total: 858s
    #402194
  • Pipeline finished with Canceled
    3 months ago
    Total: 68s
    #402200
  • Pipeline finished with Failed
    3 months ago
    Total: 1334s
    #402201
  • Pipeline finished with Canceled
    3 months ago
    Total: 659s
    #402219
  • Pipeline finished with Success
    3 months ago
    Total: 984s
    #402226
  • Pipeline finished with Success
    29 days ago
    Total: 1892s
    #452609
Production build 0.71.5 2024